From 66e24fa51a7c678853eff627149fe7cbddb0c2a7 Mon Sep 17 00:00:00 2001 From: Benjamin Weder Date: Tue, 14 May 2024 13:23:14 +0200 Subject: [PATCH] Remove unused code --- .../editor/util/ModellingUtilities.js | 114 ------------------ .../replacement/PatternTransformator.js | 2 +- 2 files changed, 1 insertion(+), 115 deletions(-) diff --git a/components/bpmn-q/modeler-component/editor/util/ModellingUtilities.js b/components/bpmn-q/modeler-component/editor/util/ModellingUtilities.js index 8ac5ddca..6a30cde1 100644 --- a/components/bpmn-q/modeler-component/editor/util/ModellingUtilities.js +++ b/components/bpmn-q/modeler-component/editor/util/ModellingUtilities.js @@ -6,120 +6,6 @@ import { } from "./camunda-utils/ExtensionElementsUtil"; import { is } from "bpmn-js/lib/util/ModelUtil"; -/** - * Returns all start events of the workflow defined by the process businessObject - * - * @param processBo The process businessObject containing the workflow - * @returns {*[]} All found start event elements of the workflow. - */ -export function getStartEvents(processBo) { - return processBo.flowElements.filter( - (element) => element.$type === "bpmn:StartEvent" - ); -} - -/** - * Adds a Camunda execution listener to the given element which creates the given process variable. - * - * @param element The element to add the execution listener to. - * @param moddle The moddle module of the current bpmn-js modeler. - * @param processVariable The process variable which should be created through the executionn listener - */ -export function addExecutionListener(element, moddle, processVariable) { - // create the execution listener for the process variable - const listener = { - event: "start", - expression: - '${execution.setVariable("' + - processVariable.name + - '", ' + - processVariable.value + - ")}", - }; - - const elementBo = element.businessObject; - let extensionElements = elementBo.extensionElements; - - // create new extension element if needed - if (!extensionElements) { - extensionElements = moddle.create("bpmn:ExtensionElements"); - } - - if (!extensionElements.values) { - extensionElements.values = []; - } - - // add execution listener to the extension element of the element - extensionElements.values.push( - moddle.create("camunda:ExecutionListener", listener) - ); - elementBo.extensionElements = extensionElements; -} - -/** - * Add the data of the given key value map as properties to a created Camunda form field. The form field is added to the given - * element. - * - * @param elementID The ID of the given element. - * @param name Name of the form field - * @param keyValueMap The key value map - * @param elementRegistry The elementRegistry of the bpmn-js modeler - * @param moddle The moddle module of the bpmn-js modeler - * @param modeling The modeling module of the bpmn-js modeler - */ -export function addFormFieldForMap( - elementID, - name, - keyValueMap, - elementRegistry, - moddle, - modeling -) { - // create the properties of the form field - let formFieldData = { - defaultValue: "", - id: name.replace(/\s+/g, "_"), - label: name, - type: "string", - }; - - // create the form field for the key value map - addFormFieldDataForMap( - elementID, - formFieldData, - keyValueMap, - elementRegistry, - moddle, - modeling - ); -} - -/** - * Add the data of the given key value map as properties to a created Camunda form field defined by the given form field - * data. The form field is added to the given element. - * - * @param elementID The ID of the given element. - * @param formFieldData The given form field data. - * @param keyValueMap The key value map - * @param elementRegistry The elementRegistry of the bpmn-js modeler - * @param moddle The moddle module of the bpmn-js modeler - * @param modeling The modeling module of the bpmn-js modeler - */ -export function addFormFieldDataForMap( - elementID, - formFieldData, - keyValueMap, - elementRegistry, - moddle, - modeling -) { - // create camunda properties for each entry of the key value map - formFieldData.properties = createCamundaProperties(keyValueMap, moddle); - - // create form field for form field data - addFormField(elementID, formFieldData, elementRegistry, moddle, modeling); -} - /** * Create a camunda form filed for the given form field data. * diff --git a/components/bpmn-q/modeler-component/extensions/pattern/replacement/PatternTransformator.js b/components/bpmn-q/modeler-component/extensions/pattern/replacement/PatternTransformator.js index a16850c1..df0c1b25 100644 --- a/components/bpmn-q/modeler-component/extensions/pattern/replacement/PatternTransformator.js +++ b/components/bpmn-q/modeler-component/extensions/pattern/replacement/PatternTransformator.js @@ -434,7 +434,7 @@ function retrieveFlowElements(flowElements, elementRegistry) { (element.type && element.type === "bpmn:SubProcess") ) { console.log("searchFlow", element.id); - // Recursively search through subprocess's children or flowElements + // Recursively search through subprocesses children or flowElements let childrenOrFlowElements = element.children; if (element.children === undefined) { childrenOrFlowElements = element.flowElements;