Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
wederbn committed May 14, 2024
1 parent 57bdfab commit 66e24fa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 115 deletions.
114 changes: 0 additions & 114 deletions components/bpmn-q/modeler-component/editor/util/ModellingUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 66e24fa

Please sign in to comment.