Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/PlanQK/workflow-modeler i…
Browse files Browse the repository at this point in the history
…nto feature/plugin-dependencies
  • Loading branch information
LaviniaStiliadou committed Jun 21, 2023
2 parents d66811c + b903d74 commit 7a769e1
Show file tree
Hide file tree
Showing 42 changed files with 2,650 additions and 220 deletions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
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. -->
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
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. -->
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
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**: #
12 changes: 12 additions & 0 deletions components/bpmn-q/.bpmnlintrc
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"
}
}
3 changes: 2 additions & 1 deletion components/bpmn-q/.gitignore
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/*
15 changes: 15 additions & 0 deletions components/bpmn-q/bpmnlint-plugin-custom/index.js
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'
}
}
}
}
26 changes: 26 additions & 0 deletions components/bpmn-q/bpmnlint-plugin-custom/package.json
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 components/bpmn-q/bpmnlint-plugin-custom/rules/quantme-tasks.js
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
};
};
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 };
};
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
};

};
22 changes: 22 additions & 0 deletions components/bpmn-q/client/index.js
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);
}
]
});
Loading

0 comments on commit 7a769e1

Please sign in to comment.