From c3b6c0bd905e056d56400a97c2b6fe103624dc7a Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 20 Nov 2024 03:41:05 +0100 Subject: [PATCH 1/3] create deep copy of selected element before changing attributes --- src/helper-modules/bpmn-helper/index.d.ts | 253 ++++++++++++------ src/helper-modules/bpmn-helper/src/util.d.ts | 20 +- src/helper-modules/bpmn-helper/src/util.js | 17 ++ .../milestone-selection-section.tsx | 22 +- .../[processId]/properties-panel.tsx | 22 +- 5 files changed, 219 insertions(+), 115 deletions(-) diff --git a/src/helper-modules/bpmn-helper/index.d.ts b/src/helper-modules/bpmn-helper/index.d.ts index 45eb29d8c..b9037b9e2 100644 --- a/src/helper-modules/bpmn-helper/index.d.ts +++ b/src/helper-modules/bpmn-helper/index.d.ts @@ -1,91 +1,168 @@ declare const _exports: { - ensureExtensionElements: typeof proceedExtensions.ensureExtensionElements; - removeEmptyExtensionElements: typeof proceedExtensions.removeEmptyExtensionElements; - ensureContainerElement: typeof proceedExtensions.ensureContainerElement; - removeEmptyContainerElement: typeof proceedExtensions.removeEmptyContainerElement; - setMetaData: typeof proceedExtensions.setMetaData; - setProceedElement: typeof proceedExtensions.setProceedElement; - getExporterName: typeof proceedConstants.getExporterName; - getExporterVersion: typeof proceedConstants.getExporterVersion; - generateBpmnId: typeof proceedConstants.generateBpmnId; - generateDefinitionsId: typeof proceedConstants.generateDefinitionsId; - generateProcessId: typeof proceedConstants.generateProcessId; - generateUserTaskFileName: typeof proceedConstants.generateUserTaskFileName; - getUserTaskImplementationString: typeof proceedConstants.getUserTaskImplementationString; - generateTargetNamespace: typeof proceedConstants.generateTargetNamespace; - initXml: typeof proceedConstants.initXml; - validateCalledProcess: typeof validators.validateCalledProcess; - setDefinitionsId: typeof setters.setDefinitionsId; - setDefinitionsName: typeof setters.setDefinitionsName; - setDefinitionsVersionInformation: typeof setters.setDefinitionsVersionInformation; - setProcessId: typeof setters.setProcessId; - setTemplateId: typeof setters.setTemplateId; - setTargetNamespace: typeof setters.setTargetNamespace; - setStandardDefinitions: typeof setters.setStandardDefinitions; - setDeploymentMethod: typeof setters.setDeploymentMethod; - setMachineInfo: typeof setters.setMachineInfo; - setUserTaskData: typeof setters.setUserTaskData; - addConstraintsToElementById: typeof setters.addConstraintsToElementById; - addCallActivityReference: typeof setters.addCallActivityReference; - removeCallActivityReference: typeof setters.removeCallActivityReference; - removeUnusedCallActivityReferences: typeof setters.removeUnusedCallActivityReferences; - removeColorFromAllElements: typeof setters.removeColorFromAllElements; - addDocumentation: typeof setters.addDocumentation; - addDocumentationToProcessObject: typeof setters.addDocumentationToProcessObject; - updatePerformersOnElement: typeof setters.updatePerformersOnElement; - updatePerformersOnElementById: typeof setters.updatePerformersOnElementById; - getDefinitionsId: typeof getters.getDefinitionsId; - getOriginalDefinitionsId: typeof getters.getOriginalDefinitionsId; - getDefinitionsName: typeof getters.getDefinitionsName; - getDefinitionsInfos: typeof getters.getDefinitionsInfos; - getImports: typeof getters.getImports; - getDefinitionsVersionInformation: typeof getters.getDefinitionsVersionInformation; - getProcessIds: typeof getters.getProcessIds; - getDeploymentMethod: typeof getters.getDeploymentMethod; - getProcessConstraints: typeof getters.getProcessConstraints; - getProcessDocumentation: typeof getters.getProcessDocumentation; - getProcessDocumentationByObject: typeof getters.getProcessDocumentationByObject; - getUserTaskFileNameMapping: typeof getters.getUserTaskFileNameMapping; - getAllUserTaskFileNamesAndUserTaskIdsMapping: typeof getters.getAllUserTaskFileNamesAndUserTaskIdsMapping; - getSubprocess: typeof getters.getSubprocess; - getSubprocessContent: typeof getters.getSubprocessContent; - getTargetDefinitionsAndProcessIdForCallActivityByObject: typeof getters.getTargetDefinitionsAndProcessIdForCallActivityByObject; - getDefinitionsAndProcessIdForEveryCallActivity: typeof getters.getDefinitionsAndProcessIdForEveryCallActivity; - getStartEvents: typeof getters.getStartEvents; - getAllBpmnFlowElements: typeof getters.getAllBpmnFlowElements; - getAllBpmnFlowNodeIds: typeof getters.getAllBpmnFlowNodeIds; - getAllBpmnFlowElementIds: typeof getters.getAllBpmnFlowElementIds; - getChildrenFlowElements: typeof getters.getChildrenFlowElements; - getElementMachineMapping: typeof getters.getElementMachineMapping; - getTaskConstraintMapping: typeof getters.getTaskConstraintMapping; - getIdentifyingInfos: typeof getters.getIdentifyingInfos; - getRootFromElement: typeof getters.getRootFromElement; - getMetaDataFromElement: typeof getters.getMetaDataFromElement; - getMetaData: typeof getters.getMetaData; - getMilestonesFromElement: typeof getters.getMilestonesFromElement; - getMilestonesFromElementById: typeof getters.getMilestonesFromElementById; - getResourcesFromElement: typeof getters.getResourcesFromElement; - getLocationsFromElement: typeof getters.getLocationsFromElement; - getPerformersFromElement: typeof getters.getPerformersFromElement; - getPerformersFromElementById: typeof getters.getPerformersFromElementById; - parseISODuration: typeof getters.parseISODuration; - convertISODurationToMiliseconds: typeof getters.convertISODurationToMiliseconds; - moddle: any; - ensureCorrectProceedNamespace: typeof util.ensureCorrectProceedNamespace; - toBpmnObject: typeof util.toBpmnObject; - toBpmnXml: typeof util.toBpmnXml; - getChildren: typeof util.getChildren; - getElementsByTagName: typeof util.getElementsByTagName; - getAllElements: typeof util.getAllElements; - getElementById: typeof util.getElementById; - getElementDI: typeof util.getElementDI; - manipulateElementById: typeof util.manipulateElementById; - manipulateElementsByTagName: typeof util.manipulateElementsByTagName; + ensureExtensionElements(element: object): object; + removeEmptyExtensionElements(element: any): void; + ensureContainerElement(element: object, containerType: string): object; + removeEmptyContainerElement(element: any, containerType: any, containerElement: any): void; + setMetaData(bpmn: string | object, elId: string, metaValues: object): Promise; + setProceedElement(element: any, proceedElementType: any, value: any, attributes?: {}, oldAttributes?: {}): {}; + getExporterName(): string; + getExporterVersion(): string; + generateBpmnId(prefix?: string): string; + generateDefinitionsId(): string; + generateProcessId(): string; + generateUserTaskFileName(): string; + getUserTaskImplementationString(): string; + generateTargetNamespace(id: any): string; + initXml(processId?: any, startEventId?: string): string; + validateCalledProcess(xml: string, processId: string): Promise; + setDefinitionsId(bpmn: string | object, id: string): Promise; + setDefinitionsName(bpmn: string | object, name: string): Promise; + setDefinitionsVersionInformation(bpmn: string | object, { version, versionName, versionDescription, versionBasedOn, }: { + version?: string | number; + versionName?: string; + versionDescription?: string; + versionBasedOn?: string | number; + }): Promise; + setProcessId(bpmn: string, id: string): Promise; + setTemplateId(bpmn: string, id: string): Promise; + setTargetNamespace(bpmn: string | object, id: string): Promise; + setStandardDefinitions(bpmn: string | object, exporterName: string, exporterVersion: string): Promise; + setDeploymentMethod(bpmn: string | object, method: string): Promise; + setMachineInfo(bpmn: string | object, machineInfo: { + [elementId: string]: { + machineAddress?: string; + machineId?: string; + }; + }): Promise; + setUserTaskData(bpmn: string | object, userTaskId: string, newFileName: string, newImplementation?: string): Promise; + addConstraintsToElementById(bpmn: string | object, elementId: string, constraints: object): Promise; + addCallActivityReference(bpmn: string | object, callActivityId: string, calledBpmn: string, calledProcessLocation: string): Promise; + removeCallActivityReference(bpmn: string | object, callActivityId: string): Promise; + removeUnusedCallActivityReferences(bpmn: string | object): Promise; + removeColorFromAllElements(bpmn: string | object): Promise; + addDocumentation(bpmn: string | object, description?: string): Promise; + addDocumentationToProcessObject(processObj: object, description?: string): void; + updatePerformersOnElement(element: object, performers: any[]): Promise; + updatePerformersOnElementById(bpmn: string | object, elementId: string, performers: any[]): Promise; + getDefinitionsId(bpmn: string | object): Promise; + getOriginalDefinitionsId(bpmn: string | object): Promise; + getDefinitionsName(bpmn: string | object): Promise; + getDefinitionsInfos(bpmn: string | object): Promise; + getImports(bpmn: string | object): Promise; + getDefinitionsVersionInformation(bpmn: string | object): Promise<{ + version?: number; + name?: string; + description?: string; + versionBasedOn?: number; + }>; + getProcessIds(bpmn: string | object): Promise; + getDeploymentMethod(bpmn: string | object): Promise; + getProcessConstraints(bpmn: string | object): Promise<{ + hardConstraints: any[]; + softConstraints: any[]; + }>; + getProcessDocumentation(bpmn: string | object): Promise; + getProcessDocumentationByObject(processObject: object): string; + getUserTaskFileNameMapping(bpmn: string | object): Promise<{ + [userTaskId: string]: { + fileName?: string; + implementation?: string; + }; + }>; + getAllUserTaskFileNamesAndUserTaskIdsMapping(bpmn: string | object): Promise<{ + [userTaskFileName: string]: string[]; + }>; + getSubprocess(bpmn: string | object, subprocessId: string): Promise; + getSubprocessContent(bpmn: string, subprocessId: string): Promise; + getTargetDefinitionsAndProcessIdForCallActivityByObject(bpmnObj: object, callActivityId: string): { + definitionId: string; + processId: string; + version: number; + }; + getDefinitionsAndProcessIdForEveryCallActivity(bpmn: string | object, dontThrow?: boolean): Promise<{ + [callActivityId: string]: { + definitionId: string; + processId: string; + version: number; + }; + }>; + getStartEvents(bpmn: string | object): Promise; + getAllBpmnFlowElements(bpmn: string | object): Promise; + getAllBpmnFlowNodeIds(bpmn: string | object): Promise; + getAllBpmnFlowElementIds(bpmn: string | object): Promise; + getChildrenFlowElements(bpmn: string | object, elementId: any): Promise; + getElementMachineMapping(bpmn: string | object): Promise<{ + [flowNodeId: string]: { + machineAddress?: string; + machineId?: string; + }; + }>; + getTaskConstraintMapping(bpmn: string | object): Promise<{ + [bpmnElementIds: string]: { + hardConstraints: any[]; + softConstraints: any[]; + }; + }>; + getIdentifyingInfos(bpmn: string | object): Promise<{ + id: string; + originalId?: string; + processIds: string[]; + name: string; + description: string; + }>; + getRootFromElement(businessObject: object): object; + getMetaDataFromElement(element: object): { + [key: string]: any; + }; + getMetaData(bpmn: string | object, elId: string): Promise<{ + [key: string]: any; + }>; + getMilestonesFromElement(element: object): { + id: string; + name: string; + description?: string; + }[]; + getMilestonesFromElementById(bpmn: string | object, elementId: string): { + id: string; + name: string; + description?: string; + }[]; + getResourcesFromElement(element: object): { + consumableMaterial: getters.ResourceInfos[]; + tool: getters.ResourceInfos[]; + inspectionInstrument: getters.ResourceInfos[]; + }; + getLocationsFromElement(element: object): { + company: getters.CompanyInfos[]; + factory: getters.FactoryInfos[]; + building: getters.BuildingInfos[]; + area: getters.AreaInfos[]; + workingPlace: getters.WorkingPlaceInfos[]; + }; + getPerformersFromElement(element: object): any[]; + getPerformersFromElementById(bpmn: string | object, elementId: string): any[]; + parseISODuration(isoDuration: string): { + years: number; + months: number; + days: number; + hours: number; + minutes: number; + seconds: number; + }; + convertISODurationToMiliseconds(isoDuration: string): number; + ensureCorrectProceedNamespace(xml: string): string; + toBpmnObject(xml: string, typename?: string): Promise; + toBpmnXml(obj: any): Promise; + deepCopyElementById(bpmn: string | object, elemId: any): Promise; + getChildren(travObj: object): any[]; + getElementsByTagName(travObj: object, tagname: string): any[]; + getAllElements(travObj: object): any[]; + getElementById(travObj: object, id: string): object; + getElementDI(element: object, definitions?: object): any; + manipulateElementById(bpmn: string | object, id: string, manipFunc: util.manipulationFunction): Promise; + manipulateElementsByTagName(bpmn: string | object, tagName: string, manipFunc: util.manipulationFunction): Promise; + moddle: any; }; export = _exports; -import proceedExtensions = require('./src/proceedExtensions'); -import proceedConstants = require('./src/PROCEED-CONSTANTS.js'); -import validators = require('./src/validators.js'); -import setters = require('./src/setters.js'); -import getters = require('./src/getters.js'); -import util = require('./src/util.js'); +import getters = require("./src/getters.js"); +import util = require("./src/util.js"); diff --git a/src/helper-modules/bpmn-helper/src/util.d.ts b/src/helper-modules/bpmn-helper/src/util.d.ts index f59dfdf39..43286c1d6 100644 --- a/src/helper-modules/bpmn-helper/src/util.d.ts +++ b/src/helper-modules/bpmn-helper/src/util.d.ts @@ -28,6 +28,14 @@ export function toBpmnObject(xml: string, typename?: string): Promise; * @returns {Promise} a xml representation of the given object */ export function toBpmnXml(obj: any): Promise; +/** + * Creates a deep copy of an element + * + * @param {string|object} bpmn traversable object representation or bpmn XML + * @param {string} id the id of the element to be copied + * @returns {Promise} - returns the copied object or undefined when no matching object was found + */ +export function deepCopyElementById(bpmn: string | object, elemId: any): Promise; /** * Finds all kinds of childnodes in a given node * @@ -77,11 +85,7 @@ export function getElementDI(element: object, definitions?: object): any; * @param {manipulationFunction} manipFunc - the function that will be used to change the element * @returns {Promise} the BPMN process as bpmn-moddle object or XML string based on input */ -export function manipulateElementById( - bpmn: string | object, - id: string, - manipFunc: manipulationFunction, -): Promise; +export function manipulateElementById(bpmn: (string | object), id: string, manipFunc: manipulationFunction): Promise; /** * Function that changes all elements in the given xml with the given tagname * using the given function @@ -91,8 +95,4 @@ export function manipulateElementById( * @param {manipulationFunction} manipFunc - the function that gets called on each element with a forEach-Loop * @returns {Promise} the BPMN process as bpmn-moddle object or XML string based on input */ -export function manipulateElementsByTagName( - bpmn: string | object, - tagName: string, - manipFunc: manipulationFunction, -): Promise; +export function manipulateElementsByTagName(bpmn: (string | object), tagName: string, manipFunc: manipulationFunction): Promise; diff --git a/src/helper-modules/bpmn-helper/src/util.js b/src/helper-modules/bpmn-helper/src/util.js index afefdc997..14cf5233a 100644 --- a/src/helper-modules/bpmn-helper/src/util.js +++ b/src/helper-modules/bpmn-helper/src/util.js @@ -44,6 +44,22 @@ async function toBpmnXml(obj) { return xml; } +/** + * Creates a deep copy of an element + * + * @param {string|object} bpmn traversable object representation or bpmn XML + * @param {string} id the id of the element to be copied + * @returns {Promise} - returns the copied object or undefined when no matching object was found + */ +async function deepCopyElementById(bpmn, elemId) { + const bpmnObj = + typeof bpmn === 'string' + ? await toBpmnObject(bpmn) + : await toBpmnXml(bpmn).then((bpmnXml) => toBpmnObject(bpmnXml)); + + return getElementById(bpmnObj, elemId); +} + /** * Finds all kinds of childnodes in a given node * @@ -195,6 +211,7 @@ module.exports = { ensureCorrectProceedNamespace, toBpmnObject, toBpmnXml, + deepCopyElementById, getChildren, getElementsByTagName, getAllElements, diff --git a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/milestone-selection-section.tsx b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/milestone-selection-section.tsx index 46818f635..f6fe5b877 100644 --- a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/milestone-selection-section.tsx +++ b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/milestone-selection-section.tsx @@ -6,7 +6,11 @@ import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons'; import styles from './milestone-selection-section.module.scss'; import { Button, Divider, Form, FormInstance, Grid, Input, Modal, Space, Table } from 'antd'; -import { getMilestonesFromElement, setProceedElement } from '@proceed/bpmn-helper'; +import { + deepCopyElementById, + getMilestonesFromElement, + setProceedElement, +} from '@proceed/bpmn-helper'; import type { ElementLike } from 'diagram-js/lib/core/Types'; import useModelerStateStore from './use-modeler-state-store'; import FormSubmitButton from '@/components/form-submit-button'; @@ -163,21 +167,25 @@ const MilestoneSelection: React.FC = ({ selectedEl setIsMilestoneModalOpen(true); }; - const addMilestone = (newMilestone: { id: string; name: string; description?: string }) => { + const addMilestone = async (newMilestone: { id: string; name: string; description?: string }) => { const modeling = modeler!.getModeling(); - setProceedElement(selectedElement.businessObject, 'Milestone', undefined, newMilestone); + const bpmn = await modeler!.getXML(); + const selectedElementCopy = (await deepCopyElementById(bpmn!, selectedElement.id)) as any; + setProceedElement(selectedElementCopy, 'Milestone', undefined, newMilestone); modeling.updateProperties(selectedElement as any, { - extensionElements: selectedElement.businessObject.extensionElements, + extensionElements: selectedElementCopy.extensionElements, }); }; - const removeMilestone = (milestoneId: string) => { + const removeMilestone = async (milestoneId: string) => { const modeling = modeler!.getModeling(); - setProceedElement(selectedElement.businessObject, 'Milestone', null, { + const bpmn = await modeler!.getXML(); + const selectedElementCopy = (await deepCopyElementById(bpmn!, selectedElement.id)) as any; + setProceedElement(selectedElementCopy, 'Milestone', null, { id: milestoneId, }); modeling.updateProperties(selectedElement as any, { - extensionElements: selectedElement.businessObject.extensionElements, + extensionElements: selectedElementCopy.extensionElements, }); }; diff --git a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/properties-panel.tsx b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/properties-panel.tsx index 224a253f2..d5223eb35 100644 --- a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/properties-panel.tsx +++ b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/properties-panel.tsx @@ -10,9 +10,13 @@ import { Input, ColorPicker, Space, Grid, Divider, Modal } from 'antd'; import { CloseOutlined } from '@ant-design/icons'; import { + getElementById, getMetaDataFromElement, setDefinitionsName, + setMetaData, setProceedElement, + toBpmnObject, + deepCopyElementById, } from '@proceed/bpmn-helper'; import CustomPropertySection from './custom-property-section'; import MilestoneSelectionSection from './milestone-selection-section'; @@ -118,27 +122,25 @@ const PropertiesPanelContent: React.FC = ({ }); }; - const updateMetaData = ( + const updateMetaData = async ( name: string, value: any, attributes?: { [key: string]: any }, oldAttributes?: { [key: string]: any }, ) => { const modeling = modeler!.getModeling(); + const bpmn = await modeler!.getXML(); + + // create deep copy of selected element and set proceed element in this object so that bpmn.js event system can recognise changes in object + const selectedElementCopy = (await deepCopyElementById(bpmn!, selectedElement.id)) as any; if (name === 'property') { - setProceedElement( - selectedElement.businessObject, - name, - value.value, - value.attributes, - oldAttributes, - ); + setProceedElement(selectedElementCopy, name, value.value, value.attributes, oldAttributes); } else { - setProceedElement(selectedElement.businessObject, name, value ? value : null, attributes); + setProceedElement(selectedElementCopy, name, value ? value : null, attributes); } modeling.updateProperties(selectedElement as any, { - extensionElements: selectedElement.businessObject.extensionElements, + extensionElements: selectedElementCopy.extensionElements, }); }; From 7de39742158777becdee3bca38c15348635403f8 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 20 Nov 2024 03:54:15 +0100 Subject: [PATCH 2/3] fix prettier issue --- src/helper-modules/bpmn-helper/index.d.ts | 384 +++++++++++-------- src/helper-modules/bpmn-helper/src/util.d.ts | 17 +- 2 files changed, 237 insertions(+), 164 deletions(-) diff --git a/src/helper-modules/bpmn-helper/index.d.ts b/src/helper-modules/bpmn-helper/index.d.ts index b9037b9e2..8f6f3937c 100644 --- a/src/helper-modules/bpmn-helper/index.d.ts +++ b/src/helper-modules/bpmn-helper/index.d.ts @@ -1,168 +1,230 @@ declare const _exports: { - ensureExtensionElements(element: object): object; - removeEmptyExtensionElements(element: any): void; - ensureContainerElement(element: object, containerType: string): object; - removeEmptyContainerElement(element: any, containerType: any, containerElement: any): void; - setMetaData(bpmn: string | object, elId: string, metaValues: object): Promise; - setProceedElement(element: any, proceedElementType: any, value: any, attributes?: {}, oldAttributes?: {}): {}; - getExporterName(): string; - getExporterVersion(): string; - generateBpmnId(prefix?: string): string; - generateDefinitionsId(): string; - generateProcessId(): string; - generateUserTaskFileName(): string; - getUserTaskImplementationString(): string; - generateTargetNamespace(id: any): string; - initXml(processId?: any, startEventId?: string): string; - validateCalledProcess(xml: string, processId: string): Promise; - setDefinitionsId(bpmn: string | object, id: string): Promise; - setDefinitionsName(bpmn: string | object, name: string): Promise; - setDefinitionsVersionInformation(bpmn: string | object, { version, versionName, versionDescription, versionBasedOn, }: { - version?: string | number; - versionName?: string; - versionDescription?: string; - versionBasedOn?: string | number; - }): Promise; - setProcessId(bpmn: string, id: string): Promise; - setTemplateId(bpmn: string, id: string): Promise; - setTargetNamespace(bpmn: string | object, id: string): Promise; - setStandardDefinitions(bpmn: string | object, exporterName: string, exporterVersion: string): Promise; - setDeploymentMethod(bpmn: string | object, method: string): Promise; - setMachineInfo(bpmn: string | object, machineInfo: { - [elementId: string]: { - machineAddress?: string; - machineId?: string; - }; - }): Promise; - setUserTaskData(bpmn: string | object, userTaskId: string, newFileName: string, newImplementation?: string): Promise; - addConstraintsToElementById(bpmn: string | object, elementId: string, constraints: object): Promise; - addCallActivityReference(bpmn: string | object, callActivityId: string, calledBpmn: string, calledProcessLocation: string): Promise; - removeCallActivityReference(bpmn: string | object, callActivityId: string): Promise; - removeUnusedCallActivityReferences(bpmn: string | object): Promise; - removeColorFromAllElements(bpmn: string | object): Promise; - addDocumentation(bpmn: string | object, description?: string): Promise; - addDocumentationToProcessObject(processObj: object, description?: string): void; - updatePerformersOnElement(element: object, performers: any[]): Promise; - updatePerformersOnElementById(bpmn: string | object, elementId: string, performers: any[]): Promise; - getDefinitionsId(bpmn: string | object): Promise; - getOriginalDefinitionsId(bpmn: string | object): Promise; - getDefinitionsName(bpmn: string | object): Promise; - getDefinitionsInfos(bpmn: string | object): Promise; - getImports(bpmn: string | object): Promise; - getDefinitionsVersionInformation(bpmn: string | object): Promise<{ - version?: number; - name?: string; - description?: string; - versionBasedOn?: number; - }>; - getProcessIds(bpmn: string | object): Promise; - getDeploymentMethod(bpmn: string | object): Promise; - getProcessConstraints(bpmn: string | object): Promise<{ - hardConstraints: any[]; - softConstraints: any[]; - }>; - getProcessDocumentation(bpmn: string | object): Promise; - getProcessDocumentationByObject(processObject: object): string; - getUserTaskFileNameMapping(bpmn: string | object): Promise<{ - [userTaskId: string]: { - fileName?: string; - implementation?: string; - }; - }>; - getAllUserTaskFileNamesAndUserTaskIdsMapping(bpmn: string | object): Promise<{ - [userTaskFileName: string]: string[]; - }>; - getSubprocess(bpmn: string | object, subprocessId: string): Promise; - getSubprocessContent(bpmn: string, subprocessId: string): Promise; - getTargetDefinitionsAndProcessIdForCallActivityByObject(bpmnObj: object, callActivityId: string): { - definitionId: string; - processId: string; - version: number; + ensureExtensionElements(element: object): object; + removeEmptyExtensionElements(element: any): void; + ensureContainerElement(element: object, containerType: string): object; + removeEmptyContainerElement(element: any, containerType: any, containerElement: any): void; + setMetaData(bpmn: string | object, elId: string, metaValues: object): Promise; + setProceedElement( + element: any, + proceedElementType: any, + value: any, + attributes?: {}, + oldAttributes?: {}, + ): {}; + getExporterName(): string; + getExporterVersion(): string; + generateBpmnId(prefix?: string): string; + generateDefinitionsId(): string; + generateProcessId(): string; + generateUserTaskFileName(): string; + getUserTaskImplementationString(): string; + generateTargetNamespace(id: any): string; + initXml(processId?: any, startEventId?: string): string; + validateCalledProcess(xml: string, processId: string): Promise; + setDefinitionsId(bpmn: string | object, id: string): Promise; + setDefinitionsName(bpmn: string | object, name: string): Promise; + setDefinitionsVersionInformation( + bpmn: string | object, + { + version, + versionName, + versionDescription, + versionBasedOn, + }: { + version?: string | number; + versionName?: string; + versionDescription?: string; + versionBasedOn?: string | number; + }, + ): Promise; + setProcessId(bpmn: string, id: string): Promise; + setTemplateId(bpmn: string, id: string): Promise; + setTargetNamespace(bpmn: string | object, id: string): Promise; + setStandardDefinitions( + bpmn: string | object, + exporterName: string, + exporterVersion: string, + ): Promise; + setDeploymentMethod(bpmn: string | object, method: string): Promise; + setMachineInfo( + bpmn: string | object, + machineInfo: { + [elementId: string]: { + machineAddress?: string; + machineId?: string; + }; + }, + ): Promise; + setUserTaskData( + bpmn: string | object, + userTaskId: string, + newFileName: string, + newImplementation?: string, + ): Promise; + addConstraintsToElementById( + bpmn: string | object, + elementId: string, + constraints: object, + ): Promise; + addCallActivityReference( + bpmn: string | object, + callActivityId: string, + calledBpmn: string, + calledProcessLocation: string, + ): Promise; + removeCallActivityReference( + bpmn: string | object, + callActivityId: string, + ): Promise; + removeUnusedCallActivityReferences(bpmn: string | object): Promise; + removeColorFromAllElements(bpmn: string | object): Promise; + addDocumentation(bpmn: string | object, description?: string): Promise; + addDocumentationToProcessObject(processObj: object, description?: string): void; + updatePerformersOnElement(element: object, performers: any[]): Promise; + updatePerformersOnElementById( + bpmn: string | object, + elementId: string, + performers: any[], + ): Promise; + getDefinitionsId(bpmn: string | object): Promise; + getOriginalDefinitionsId(bpmn: string | object): Promise; + getDefinitionsName(bpmn: string | object): Promise; + getDefinitionsInfos(bpmn: string | object): Promise; + getImports(bpmn: string | object): Promise; + getDefinitionsVersionInformation(bpmn: string | object): Promise<{ + version?: number; + name?: string; + description?: string; + versionBasedOn?: number; + }>; + getProcessIds(bpmn: string | object): Promise; + getDeploymentMethod(bpmn: string | object): Promise; + getProcessConstraints(bpmn: string | object): Promise<{ + hardConstraints: any[]; + softConstraints: any[]; + }>; + getProcessDocumentation(bpmn: string | object): Promise; + getProcessDocumentationByObject(processObject: object): string; + getUserTaskFileNameMapping(bpmn: string | object): Promise<{ + [userTaskId: string]: { + fileName?: string; + implementation?: string; }; - getDefinitionsAndProcessIdForEveryCallActivity(bpmn: string | object, dontThrow?: boolean): Promise<{ - [callActivityId: string]: { - definitionId: string; - processId: string; - version: number; - }; - }>; - getStartEvents(bpmn: string | object): Promise; - getAllBpmnFlowElements(bpmn: string | object): Promise; - getAllBpmnFlowNodeIds(bpmn: string | object): Promise; - getAllBpmnFlowElementIds(bpmn: string | object): Promise; - getChildrenFlowElements(bpmn: string | object, elementId: any): Promise; - getElementMachineMapping(bpmn: string | object): Promise<{ - [flowNodeId: string]: { - machineAddress?: string; - machineId?: string; - }; - }>; - getTaskConstraintMapping(bpmn: string | object): Promise<{ - [bpmnElementIds: string]: { - hardConstraints: any[]; - softConstraints: any[]; - }; - }>; - getIdentifyingInfos(bpmn: string | object): Promise<{ - id: string; - originalId?: string; - processIds: string[]; - name: string; - description: string; - }>; - getRootFromElement(businessObject: object): object; - getMetaDataFromElement(element: object): { - [key: string]: any; + }>; + getAllUserTaskFileNamesAndUserTaskIdsMapping(bpmn: string | object): Promise<{ + [userTaskFileName: string]: string[]; + }>; + getSubprocess(bpmn: string | object, subprocessId: string): Promise; + getSubprocessContent(bpmn: string, subprocessId: string): Promise; + getTargetDefinitionsAndProcessIdForCallActivityByObject( + bpmnObj: object, + callActivityId: string, + ): { + definitionId: string; + processId: string; + version: number; + }; + getDefinitionsAndProcessIdForEveryCallActivity( + bpmn: string | object, + dontThrow?: boolean, + ): Promise<{ + [callActivityId: string]: { + definitionId: string; + processId: string; + version: number; }; - getMetaData(bpmn: string | object, elId: string): Promise<{ - [key: string]: any; - }>; - getMilestonesFromElement(element: object): { - id: string; - name: string; - description?: string; - }[]; - getMilestonesFromElementById(bpmn: string | object, elementId: string): { - id: string; - name: string; - description?: string; - }[]; - getResourcesFromElement(element: object): { - consumableMaterial: getters.ResourceInfos[]; - tool: getters.ResourceInfos[]; - inspectionInstrument: getters.ResourceInfos[]; + }>; + getStartEvents(bpmn: string | object): Promise; + getAllBpmnFlowElements(bpmn: string | object): Promise; + getAllBpmnFlowNodeIds(bpmn: string | object): Promise; + getAllBpmnFlowElementIds(bpmn: string | object): Promise; + getChildrenFlowElements(bpmn: string | object, elementId: any): Promise; + getElementMachineMapping(bpmn: string | object): Promise<{ + [flowNodeId: string]: { + machineAddress?: string; + machineId?: string; }; - getLocationsFromElement(element: object): { - company: getters.CompanyInfos[]; - factory: getters.FactoryInfos[]; - building: getters.BuildingInfos[]; - area: getters.AreaInfos[]; - workingPlace: getters.WorkingPlaceInfos[]; + }>; + getTaskConstraintMapping(bpmn: string | object): Promise<{ + [bpmnElementIds: string]: { + hardConstraints: any[]; + softConstraints: any[]; }; - getPerformersFromElement(element: object): any[]; - getPerformersFromElementById(bpmn: string | object, elementId: string): any[]; - parseISODuration(isoDuration: string): { - years: number; - months: number; - days: number; - hours: number; - minutes: number; - seconds: number; - }; - convertISODurationToMiliseconds(isoDuration: string): number; - ensureCorrectProceedNamespace(xml: string): string; - toBpmnObject(xml: string, typename?: string): Promise; - toBpmnXml(obj: any): Promise; - deepCopyElementById(bpmn: string | object, elemId: any): Promise; - getChildren(travObj: object): any[]; - getElementsByTagName(travObj: object, tagname: string): any[]; - getAllElements(travObj: object): any[]; - getElementById(travObj: object, id: string): object; - getElementDI(element: object, definitions?: object): any; - manipulateElementById(bpmn: string | object, id: string, manipFunc: util.manipulationFunction): Promise; - manipulateElementsByTagName(bpmn: string | object, tagName: string, manipFunc: util.manipulationFunction): Promise; - moddle: any; + }>; + getIdentifyingInfos(bpmn: string | object): Promise<{ + id: string; + originalId?: string; + processIds: string[]; + name: string; + description: string; + }>; + getRootFromElement(businessObject: object): object; + getMetaDataFromElement(element: object): { + [key: string]: any; + }; + getMetaData( + bpmn: string | object, + elId: string, + ): Promise<{ + [key: string]: any; + }>; + getMilestonesFromElement(element: object): { + id: string; + name: string; + description?: string; + }[]; + getMilestonesFromElementById( + bpmn: string | object, + elementId: string, + ): { + id: string; + name: string; + description?: string; + }[]; + getResourcesFromElement(element: object): { + consumableMaterial: getters.ResourceInfos[]; + tool: getters.ResourceInfos[]; + inspectionInstrument: getters.ResourceInfos[]; + }; + getLocationsFromElement(element: object): { + company: getters.CompanyInfos[]; + factory: getters.FactoryInfos[]; + building: getters.BuildingInfos[]; + area: getters.AreaInfos[]; + workingPlace: getters.WorkingPlaceInfos[]; + }; + getPerformersFromElement(element: object): any[]; + getPerformersFromElementById(bpmn: string | object, elementId: string): any[]; + parseISODuration(isoDuration: string): { + years: number; + months: number; + days: number; + hours: number; + minutes: number; + seconds: number; + }; + convertISODurationToMiliseconds(isoDuration: string): number; + ensureCorrectProceedNamespace(xml: string): string; + toBpmnObject(xml: string, typename?: string): Promise; + toBpmnXml(obj: any): Promise; + deepCopyElementById(bpmn: string | object, elemId: any): Promise; + getChildren(travObj: object): any[]; + getElementsByTagName(travObj: object, tagname: string): any[]; + getAllElements(travObj: object): any[]; + getElementById(travObj: object, id: string): object; + getElementDI(element: object, definitions?: object): any; + manipulateElementById( + bpmn: string | object, + id: string, + manipFunc: util.manipulationFunction, + ): Promise; + manipulateElementsByTagName( + bpmn: string | object, + tagName: string, + manipFunc: util.manipulationFunction, + ): Promise; + moddle: any; }; export = _exports; -import getters = require("./src/getters.js"); -import util = require("./src/util.js"); +import getters = require('./src/getters.js'); +import util = require('./src/util.js'); diff --git a/src/helper-modules/bpmn-helper/src/util.d.ts b/src/helper-modules/bpmn-helper/src/util.d.ts index 43286c1d6..7943c46a9 100644 --- a/src/helper-modules/bpmn-helper/src/util.d.ts +++ b/src/helper-modules/bpmn-helper/src/util.d.ts @@ -35,7 +35,10 @@ export function toBpmnXml(obj: any): Promise; * @param {string} id the id of the element to be copied * @returns {Promise} - returns the copied object or undefined when no matching object was found */ -export function deepCopyElementById(bpmn: string | object, elemId: any): Promise; +export function deepCopyElementById( + bpmn: string | object, + elemId: any, +): Promise; /** * Finds all kinds of childnodes in a given node * @@ -85,7 +88,11 @@ export function getElementDI(element: object, definitions?: object): any; * @param {manipulationFunction} manipFunc - the function that will be used to change the element * @returns {Promise} the BPMN process as bpmn-moddle object or XML string based on input */ -export function manipulateElementById(bpmn: (string | object), id: string, manipFunc: manipulationFunction): Promise; +export function manipulateElementById( + bpmn: string | object, + id: string, + manipFunc: manipulationFunction, +): Promise; /** * Function that changes all elements in the given xml with the given tagname * using the given function @@ -95,4 +102,8 @@ export function manipulateElementById(bpmn: (string | object), id: string, manip * @param {manipulationFunction} manipFunc - the function that gets called on each element with a forEach-Loop * @returns {Promise} the BPMN process as bpmn-moddle object or XML string based on input */ -export function manipulateElementsByTagName(bpmn: (string | object), tagName: string, manipFunc: manipulationFunction): Promise; +export function manipulateElementsByTagName( + bpmn: string | object, + tagName: string, + manipFunc: manipulationFunction, +): Promise; From e2c3d14f5d78d4baff7932a17b46beb46c3ee7f4 Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 13 Jan 2025 15:20:46 +0100 Subject: [PATCH 3/3] fix prettier issue --- src/helper-modules/bpmn-helper/index.d.ts | 391 +++++++++++++--------- 1 file changed, 227 insertions(+), 164 deletions(-) diff --git a/src/helper-modules/bpmn-helper/index.d.ts b/src/helper-modules/bpmn-helper/index.d.ts index d1190ef1c..151094ac9 100644 --- a/src/helper-modules/bpmn-helper/index.d.ts +++ b/src/helper-modules/bpmn-helper/index.d.ts @@ -1,171 +1,234 @@ declare const _exports: { - ensureExtensionElements(element: object): object; - removeEmptyExtensionElements(element: any): void; - ensureContainerElement(element: object, containerType: string): object; - removeEmptyContainerElement(element: any, containerType: any, containerElement: any): void; - setMetaData(bpmn: string | object, elId: string, metaValues: object): Promise; - setProceedElement(element: any, proceedElementType: any, value: any, attributes?: {}, oldAttributes?: {}): {}; - getExporterName(): string; - getExporterVersion(): string; - generateBpmnId(prefix?: string): string; - generateDefinitionsId(): string; - generateProcessId(): string; - generateUserTaskFileName(): string; - generateScriptTaskFileName(): string; - getUserTaskImplementationString(): string; - generateTargetNamespace(id: any): string; - initXml(processId?: any, startEventId?: string): string; - validateCalledProcess(xml: string, processId: string): Promise; - setDefinitionsId(bpmn: string | object, id: string): Promise; - setDefinitionsName(bpmn: string | object, name: string): Promise; - setDefinitionsVersionInformation(bpmn: string | object, { versionId, versionName, versionDescription, versionBasedOn, versionCreatedOn, }: { - versionId?: string; - versionName?: string; - versionDescription?: string; - versionBasedOn?: string; - versionCreatedOn?: string; - }): Promise; - setProcessId(bpmn: string, id: string): Promise; - setTemplateId(bpmn: string, id: string): Promise; - setTargetNamespace(bpmn: string | object, id: string): Promise; - setStandardDefinitions(bpmn: string | object, exporterName: string, exporterVersion: string): Promise; - setDeploymentMethod(bpmn: string | object, method: string): Promise; - setMachineInfo(bpmn: string | object, machineInfo: { - [elementId: string]: { - machineAddress?: string; - machineId?: string; - }; - }): Promise; - setUserTaskData(bpmn: string | object, userTaskId: string, newFileName: string, newImplementation?: string): Promise; - addConstraintsToElementById(bpmn: string | object, elementId: string, constraints: object): Promise; - addCallActivityReference(bpmn: string | object, callActivityId: string, calledBpmn: string, calledProcessLocation: string): Promise; - removeCallActivityReference(bpmn: string | object, callActivityId: string): Promise; - removeUnusedCallActivityReferences(bpmn: string | object): Promise; - removeColorFromAllElements(bpmn: string | object): Promise; - addDocumentation(bpmn: string | object, description?: string): Promise; - addDocumentationToProcessObject(processObj: object, description?: string): void; - updatePerformersOnElement(element: object, performers: any[]): Promise; - updatePerformersOnElementById(bpmn: string | object, elementId: string, performers: any[]): Promise; - getDefinitionsId(bpmn: string | object): Promise; - getOriginalDefinitionsId(bpmn: string | object): Promise; - getDefinitionsName(bpmn: string | object): Promise; - getDefinitionsInfos(bpmn: string | object): Promise; - getImports(bpmn: string | object): Promise; - getDefinitionsVersionInformation(bpmn: string | object): Promise<{ - versionId?: string; - name?: string; - description?: string; - versionBasedOn?: string; - versionCreatedOn: string; - }>; - getProcessIds(bpmn: string | object): Promise; - getDeploymentMethod(bpmn: string | object): Promise; - getProcessConstraints(bpmn: string | object): Promise<{ - hardConstraints: any[]; - softConstraints: any[]; - }>; - getProcessDocumentation(bpmn: string | object): Promise; - getProcessDocumentationByObject(processObject: object): string; - getUserTaskFileNameMapping(bpmn: string | object): Promise<{ - [userTaskId: string]: { - fileName?: string; - implementation?: string; - }; - }>; - getAllUserTaskFileNamesAndUserTaskIdsMapping(bpmn: string | object): Promise<{ - [userTaskFileName: string]: string[]; - }>; - getSubprocess(bpmn: string | object, subprocessId: string): Promise; - getSubprocessContent(bpmn: string, subprocessId: string): Promise; - getTargetDefinitionsAndProcessIdForCallActivityByObject(bpmnObj: object, callActivityId: string): { - definitionId: string; - processId: string; - versionId: string; + ensureExtensionElements(element: object): object; + removeEmptyExtensionElements(element: any): void; + ensureContainerElement(element: object, containerType: string): object; + removeEmptyContainerElement(element: any, containerType: any, containerElement: any): void; + setMetaData(bpmn: string | object, elId: string, metaValues: object): Promise; + setProceedElement( + element: any, + proceedElementType: any, + value: any, + attributes?: {}, + oldAttributes?: {}, + ): {}; + getExporterName(): string; + getExporterVersion(): string; + generateBpmnId(prefix?: string): string; + generateDefinitionsId(): string; + generateProcessId(): string; + generateUserTaskFileName(): string; + generateScriptTaskFileName(): string; + getUserTaskImplementationString(): string; + generateTargetNamespace(id: any): string; + initXml(processId?: any, startEventId?: string): string; + validateCalledProcess(xml: string, processId: string): Promise; + setDefinitionsId(bpmn: string | object, id: string): Promise; + setDefinitionsName(bpmn: string | object, name: string): Promise; + setDefinitionsVersionInformation( + bpmn: string | object, + { + versionId, + versionName, + versionDescription, + versionBasedOn, + versionCreatedOn, + }: { + versionId?: string; + versionName?: string; + versionDescription?: string; + versionBasedOn?: string; + versionCreatedOn?: string; + }, + ): Promise; + setProcessId(bpmn: string, id: string): Promise; + setTemplateId(bpmn: string, id: string): Promise; + setTargetNamespace(bpmn: string | object, id: string): Promise; + setStandardDefinitions( + bpmn: string | object, + exporterName: string, + exporterVersion: string, + ): Promise; + setDeploymentMethod(bpmn: string | object, method: string): Promise; + setMachineInfo( + bpmn: string | object, + machineInfo: { + [elementId: string]: { + machineAddress?: string; + machineId?: string; + }; + }, + ): Promise; + setUserTaskData( + bpmn: string | object, + userTaskId: string, + newFileName: string, + newImplementation?: string, + ): Promise; + addConstraintsToElementById( + bpmn: string | object, + elementId: string, + constraints: object, + ): Promise; + addCallActivityReference( + bpmn: string | object, + callActivityId: string, + calledBpmn: string, + calledProcessLocation: string, + ): Promise; + removeCallActivityReference( + bpmn: string | object, + callActivityId: string, + ): Promise; + removeUnusedCallActivityReferences(bpmn: string | object): Promise; + removeColorFromAllElements(bpmn: string | object): Promise; + addDocumentation(bpmn: string | object, description?: string): Promise; + addDocumentationToProcessObject(processObj: object, description?: string): void; + updatePerformersOnElement(element: object, performers: any[]): Promise; + updatePerformersOnElementById( + bpmn: string | object, + elementId: string, + performers: any[], + ): Promise; + getDefinitionsId(bpmn: string | object): Promise; + getOriginalDefinitionsId(bpmn: string | object): Promise; + getDefinitionsName(bpmn: string | object): Promise; + getDefinitionsInfos(bpmn: string | object): Promise; + getImports(bpmn: string | object): Promise; + getDefinitionsVersionInformation(bpmn: string | object): Promise<{ + versionId?: string; + name?: string; + description?: string; + versionBasedOn?: string; + versionCreatedOn: string; + }>; + getProcessIds(bpmn: string | object): Promise; + getDeploymentMethod(bpmn: string | object): Promise; + getProcessConstraints(bpmn: string | object): Promise<{ + hardConstraints: any[]; + softConstraints: any[]; + }>; + getProcessDocumentation(bpmn: string | object): Promise; + getProcessDocumentationByObject(processObject: object): string; + getUserTaskFileNameMapping(bpmn: string | object): Promise<{ + [userTaskId: string]: { + fileName?: string; + implementation?: string; }; - getDefinitionsAndProcessIdForEveryCallActivity(bpmn: string | object, dontThrow?: boolean): Promise<{ - [callActivityId: string]: { - definitionId: string; - processId: string; - versionId: string; - }; - }>; - getStartEvents(bpmn: string | object): Promise; - getAllBpmnFlowElements(bpmn: string | object): Promise; - getAllBpmnFlowNodeIds(bpmn: string | object): Promise; - getAllBpmnFlowElementIds(bpmn: string | object): Promise; - getChildrenFlowElements(bpmn: string | object, elementId: any): Promise; - getElementMachineMapping(bpmn: string | object): Promise<{ - [flowNodeId: string]: { - machineAddress?: string; - machineId?: string; - }; - }>; - getTaskConstraintMapping(bpmn: string | object): Promise<{ - [bpmnElementIds: string]: { - hardConstraints: any[]; - softConstraints: any[]; - }; - }>; - getIdentifyingInfos(bpmn: string | object): Promise<{ - id: string; - originalId?: string; - processIds: string[]; - name: string; - description: string; - }>; - getRootFromElement(businessObject: object): object; - getMetaDataFromElement(element: object): { - [key: string]: any; + }>; + getAllUserTaskFileNamesAndUserTaskIdsMapping(bpmn: string | object): Promise<{ + [userTaskFileName: string]: string[]; + }>; + getSubprocess(bpmn: string | object, subprocessId: string): Promise; + getSubprocessContent(bpmn: string, subprocessId: string): Promise; + getTargetDefinitionsAndProcessIdForCallActivityByObject( + bpmnObj: object, + callActivityId: string, + ): { + definitionId: string; + processId: string; + versionId: string; + }; + getDefinitionsAndProcessIdForEveryCallActivity( + bpmn: string | object, + dontThrow?: boolean, + ): Promise<{ + [callActivityId: string]: { + definitionId: string; + processId: string; + versionId: string; }; - getMetaData(bpmn: string | object, elId: string): Promise<{ - [key: string]: any; - }>; - getMilestonesFromElement(element: object): { - id: string; - name: string; - description?: string; - }[]; - getMilestonesFromElementById(bpmn: string | object, elementId: string): { - id: string; - name: string; - description?: string; - }[]; - getResourcesFromElement(element: object): { - consumableMaterial: getters.ResourceInfos[]; - tool: getters.ResourceInfos[]; - inspectionInstrument: getters.ResourceInfos[]; + }>; + getStartEvents(bpmn: string | object): Promise; + getAllBpmnFlowElements(bpmn: string | object): Promise; + getAllBpmnFlowNodeIds(bpmn: string | object): Promise; + getAllBpmnFlowElementIds(bpmn: string | object): Promise; + getChildrenFlowElements(bpmn: string | object, elementId: any): Promise; + getElementMachineMapping(bpmn: string | object): Promise<{ + [flowNodeId: string]: { + machineAddress?: string; + machineId?: string; }; - getLocationsFromElement(element: object): { - company: getters.CompanyInfos[]; - factory: getters.FactoryInfos[]; - building: getters.BuildingInfos[]; - area: getters.AreaInfos[]; - workingPlace: getters.WorkingPlaceInfos[]; + }>; + getTaskConstraintMapping(bpmn: string | object): Promise<{ + [bpmnElementIds: string]: { + hardConstraints: any[]; + softConstraints: any[]; }; - getPerformersFromElement(element: object): any[]; - getPerformersFromElementById(bpmn: string | object, elementId: string): any[]; - parseISODuration(isoDuration: string): { - years: number; - months: number; - days: number; - hours: number; - minutes: number; - seconds: number; - }; - convertISODurationToMiliseconds(isoDuration: string): number; - ensureCorrectProceedNamespace(xml: string): string; - toBpmnObject(xml: string, typename?: string): Promise; - toBpmnXml(obj: any): Promise; - deepCopyElementById(bpmn: string | object, elemId: any): Promise; - getChildren(travObj: object): any[]; - getElementsByTagName(travObj: object, tagname: string): any[]; - getAllElements(travObj: object): any[]; - getElementById(travObj: object, id: string): object; - getElementDI(element: object, definitions?: object): any; - manipulateElementById(bpmn: string | object, id: string, manipFunc: util.manipulationFunction): Promise; - manipulateElementsByTagName(bpmn: string | object, tagName: string, manipFunc: util.manipulationFunction): Promise; - moddle: any; + }>; + getIdentifyingInfos(bpmn: string | object): Promise<{ + id: string; + originalId?: string; + processIds: string[]; + name: string; + description: string; + }>; + getRootFromElement(businessObject: object): object; + getMetaDataFromElement(element: object): { + [key: string]: any; + }; + getMetaData( + bpmn: string | object, + elId: string, + ): Promise<{ + [key: string]: any; + }>; + getMilestonesFromElement(element: object): { + id: string; + name: string; + description?: string; + }[]; + getMilestonesFromElementById( + bpmn: string | object, + elementId: string, + ): { + id: string; + name: string; + description?: string; + }[]; + getResourcesFromElement(element: object): { + consumableMaterial: getters.ResourceInfos[]; + tool: getters.ResourceInfos[]; + inspectionInstrument: getters.ResourceInfos[]; + }; + getLocationsFromElement(element: object): { + company: getters.CompanyInfos[]; + factory: getters.FactoryInfos[]; + building: getters.BuildingInfos[]; + area: getters.AreaInfos[]; + workingPlace: getters.WorkingPlaceInfos[]; + }; + getPerformersFromElement(element: object): any[]; + getPerformersFromElementById(bpmn: string | object, elementId: string): any[]; + parseISODuration(isoDuration: string): { + years: number; + months: number; + days: number; + hours: number; + minutes: number; + seconds: number; + }; + convertISODurationToMiliseconds(isoDuration: string): number; + ensureCorrectProceedNamespace(xml: string): string; + toBpmnObject(xml: string, typename?: string): Promise; + toBpmnXml(obj: any): Promise; + deepCopyElementById(bpmn: string | object, elemId: any): Promise; + getChildren(travObj: object): any[]; + getElementsByTagName(travObj: object, tagname: string): any[]; + getAllElements(travObj: object): any[]; + getElementById(travObj: object, id: string): object; + getElementDI(element: object, definitions?: object): any; + manipulateElementById( + bpmn: string | object, + id: string, + manipFunc: util.manipulationFunction, + ): Promise; + manipulateElementsByTagName( + bpmn: string | object, + tagName: string, + manipFunc: util.manipulationFunction, + ): Promise; + moddle: any; }; export = _exports; -import getters = require("./src/getters.js"); -import util = require("./src/util.js"); +import getters = require('./src/getters.js'); +import util = require('./src/util.js');