-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/PlanQK/workflow-modeler i…
…nto feature/plugin-dependencies
- Loading branch information
Showing
42 changed files
with
2,650 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
name: Bug report | ||
about: Describe an occurring bug | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Current Behavior:** | ||
<!-- Describe how the issue/bug manifests. --> | ||
|
||
**Expected Behavior:** | ||
<!-- Describe what the behavior would be without the issue. --> | ||
|
||
**Steps to Reproduce:** | ||
<!-- If you are able to illustrate the bug or feature request with an example, please provide steps to reproduce and if possible a demo using one of the following templates. --> | ||
|
||
1. | ||
1. | ||
1. | ||
|
||
**Other Information:** | ||
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, etc. --> | ||
|
||
**System Information:** | ||
<!-- List any system or platform related information, e.g. version, operating system, etc. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: Feature request | ||
about: Describe the feature | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Problem Statement:** | ||
<!-- Why do we need this feature? Description of the problem you're trying to solve, including any relevant background information. --> | ||
|
||
**Sketch (Optional):** | ||
<!-- Attach or embed a sketch or diagram that illustrates the problem or proposed solution. --> | ||
|
||
**References (Optional):** | ||
<!-- List any relevant articles, websites, or other resources that may be helpful. --> | ||
|
||
**Expected Behavior:** | ||
<!-- What is the feature? Describe what you expect to happen when the problem is solved, or when the proposed solution is implemented. --> | ||
|
||
**Tasks:** | ||
<!-- If possible, split the feature into multiple subtasks. --> | ||
|
||
- [ ] Task 1 | ||
- [ ] Task 2 | ||
- [ ] Task 3 | ||
|
||
**Other Information:** | ||
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, etc. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#### Short Description | ||
<!-- Add a short description of what this pull request resolves --> | ||
|
||
#### Proposed Changes | ||
<!-- List all changes proposed in this pull request --> | ||
|
||
* | ||
* | ||
* | ||
|
||
**Fixes**: # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"extends": [ | ||
"plugin:camunda/recommended", | ||
"plugin:custom/recommended" | ||
], | ||
"rules": { | ||
"custom/quantme-tasks": "warn", | ||
"custom/subprocess-connected-end-event": "warn", | ||
"custom/subprocess-required-start-event": "warn", | ||
"camunda/no-collapsed-sub-processes": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules/* | ||
public/* | ||
!public/index.html | ||
!public/index.html | ||
bpmnlint-plugin-custom/node_modules/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
configs: { | ||
recommended: { | ||
rules: { | ||
} | ||
}, | ||
all: { | ||
rules: { | ||
'quantme-tasks': 'warn', | ||
'subprocess-required-start-event': 'warn', | ||
'subprocess-connected-end-event': 'warn' | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "bpmnlint-plugin-custom", | ||
"version": "0.0.0", | ||
"description": "The bpmnlint custom plug-in", | ||
"main": "index.js", | ||
"scripts": { | ||
"all": "npm test", | ||
"test": "mocha test.js" | ||
}, | ||
"keywords": [ | ||
"bpmnlint", | ||
"plugin" | ||
], | ||
"devDependencies": { | ||
"bpmnlint": "^7.2.1", | ||
"chai": "^4.2.0", | ||
"mocha": "^9.1.3" | ||
}, | ||
"dependencies": { | ||
"bpmnlint-utils": "^1.0.2" | ||
}, | ||
"files": [ | ||
"rules", | ||
"index.js" | ||
] | ||
} |
20 changes: 20 additions & 0 deletions
20
components/bpmn-q/bpmnlint-plugin-custom/rules/quantme-tasks.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
let QuantMEAttributeChecker = require('../../modeler-component/extensions/quantme/replacement/QuantMEAttributeChecker'); | ||
|
||
/** | ||
* Rule that reports QuantME tasks for which no suited replacement model exists | ||
*/ | ||
module.exports = function() { | ||
|
||
function check(node, reporter) { | ||
if (node.$type && node.$type.startsWith('quantme:')) { | ||
if (!QuantMEAttributeChecker.requiredAttributesAvailable(node)) { | ||
reporter.report(node.id, 'Not all required attributes are set. Unable to replace task!'); | ||
return; | ||
} | ||
} | ||
} | ||
|
||
return { | ||
check: check | ||
}; | ||
}; |
46 changes: 46 additions & 0 deletions
46
components/bpmn-q/bpmnlint-plugin-custom/rules/subprocess-connected-end-event.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const { | ||
is, | ||
isAny | ||
} = require('bpmnlint-utils'); | ||
|
||
|
||
/** | ||
* A rule that checks the presence of an end event per scope. | ||
*/ | ||
module.exports = function () { | ||
|
||
function hasEndEvent(node) { | ||
const flowElements = node.flowElements || []; | ||
|
||
return ( | ||
flowElements.some(node => is(node, 'bpmn:EndEvent')) | ||
); | ||
} | ||
|
||
function hasConnectedEndEvent(node) { | ||
const flowElements = node.flowElements || []; | ||
|
||
return ( | ||
flowElements.some(node => { const incomingflow = node.incoming || []; return is(node, 'bpmn:EndEvent') && incomingflow.length === 0; }) | ||
); | ||
|
||
} | ||
|
||
function check(node, reporter) { | ||
console.log(node) | ||
if (!isAny(node, ['bpmn:SubProcess'])) { | ||
return; | ||
} | ||
|
||
if (!hasEndEvent(node)) { | ||
|
||
reporter.report(node.id, 'Subprocess is missing end event'); | ||
} | ||
|
||
if (hasConnectedEndEvent(node)) { | ||
reporter.report(node.id, 'Each end event must have at least one incoming flow'); | ||
} | ||
} | ||
|
||
return { check }; | ||
}; |
38 changes: 38 additions & 0 deletions
38
components/bpmn-q/bpmnlint-plugin-custom/rules/subprocess-required-start-event.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const { | ||
is | ||
} = require('bpmnlint-utils'); | ||
|
||
|
||
/** | ||
* A rule that checks that start events inside a normal sub-processes | ||
* are blank (do not have an event definition). | ||
*/ | ||
module.exports = function () { | ||
|
||
function check(node, reporter) { | ||
|
||
if (!is(node, 'bpmn:SubProcess') || node.triggeredByEvent) { | ||
return; | ||
} | ||
|
||
const flowElements = node.flowElements || []; | ||
|
||
flowElements.forEach(function (flowElement) { | ||
|
||
if (!is(flowElement, 'bpmn:StartEvent')) { | ||
return false; | ||
} | ||
|
||
const eventDefinitions = flowElement.eventDefinitions || []; | ||
|
||
if (eventDefinitions.length > 0) { | ||
reporter.report(flowElement.id, 'Start event must be blank', ['eventDefinitions']); | ||
} | ||
}); | ||
} | ||
|
||
return { | ||
check | ||
}; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Copyright (c) 2021 Institute of Architecture of Application Systems - | ||
* University of Stuttgart | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms the Apache Software License 2.0 | ||
* which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { registerBpmnJSPlugin } from 'camunda-modeler-plugin-helpers'; | ||
|
||
import customLinterConfig from '../.bpmnlintrc'; | ||
|
||
registerBpmnJSPlugin({ | ||
__init__: [ | ||
function(linting) { | ||
linting.setLinterConfig(customLinterConfig); | ||
} | ||
] | ||
}); |
Oops, something went wrong.