Module: @proceed/bpmn-helper

Methods

(async, inner) addCallActivityReference(rootBpmn, callActivityId, calledBpmn, calledProcessLocation)

Add meta information of the called bpmn process to the bpmn file where it's getting called from. This includes a custom namespace in the definitions part, an import element as first child of definitions and the calledElement attribute of the call activity bpmn element

Parameters:
Name Type Description
rootBpmn String

The bpmn file as string where the call activity is in

callActivityId String

The ID of the call activity bpmn element inside the rootBpmn

calledBpmn String

The bpmn file of the called process

calledProcessLocation String

The DefinitionId of the calledBpmn. Combination of process name and process id

Source:

(async, inner) addConstraints(bpmnXML, processConstraints, taskConstraintMapping)

Adds process and task constraints as extension elements to XML after checking for inconsistencies

Parameters:
Name Type Description
bpmnXML
processConstraints
taskConstraintMapping
Source:
Returns:

modified bpmnXML

(inner) getAllElements(travObj) → {array}

A function that given a traversable object returns all occurences

Parameters:
Name Type Description
travObj object

the object we want to search in

Source:
Returns:
  • all nodes within the object
Type
array

(async, inner) getCallActivityDefinitionIdMapping(xml)

Gets definitionIds for all imported Processes used in call Activities

Parameters:
Name Type Description
xml String

the process definition

Source:

(inner) getChildren(travObj) → {array}

Finds all kinds of childnodes in a given node

Parameters:
Name Type Description
travObj object

object of which we want to know the childnodes

Source:
Returns:
  • all childnodes of the given node
Type
array

(async, inner) getDeploymentMethod(xml) → {string}

Gets deployment method of the given process

Parameters:
Name Type Description
xml string

the bpmn diagram that contains the process

Source:
Returns:
  • the deployment method used for the given process
Type
string

(inner) getElementById(travObj, id) → {object|undefined}

A function that given a traversable object returns the nested object with the given id

Parameters:
Name Type Description
travObj object

the object we want to search in

id string

the id of the object we want to find

Source:
Returns:
  • returns the found object or undefined when no matching object was found
Type
object | undefined

(async, inner) getElementMachineMapping(xml) → {object}

Returns a mapping of the ids of the process nodes to the machines they are mapped to

Parameters:
Name Type Description
xml string
Source:
Returns:
  • the mapping from a node id to information about the machine it is mapped to
Type
object

(inner) getElementsByTagName(travObj, tagname) → {array}

A function that given a traversable object returns all occurences of a given tagName

Parameters:
Name Type Description
travObj object

the object we want to search in

tagname string

the name we are searching for

Source:
Returns:
  • all nodes with the given tagName
Type
array

(inner) getExporterName() → {string}

Exporter name is used in the bpmn definitions parts

Source:
Returns:

static exporter name

Type
string

(inner) getExporterVersion() → {string}

Exporter version is used in the bpmn definitions parts

This version should be adjusted when this module (bpmn-helper) changes or any changes in the management-system occur regarding the export

Source:
Returns:

static exporter version

Type
string

(async, inner) getId(xml) → {string}

Returns id of the given process definition

Parameters:
Name Type Description
xml String
Source:
Returns:
  • The id stored in the definitions field of the given bpmn process
Type
string

(async, inner) getImports(xml) → {Array.<Object>}

Returns an array of import elements for a given bpmn xml

Parameters:
Name Type Description
xml string
Source:
Returns:
  • Arry of of import elements inside the given xml
Type
Array.<Object>

(async, inner) getName(xml) → {string}

Returns the name of the given bpmn process definition

Parameters:
Name Type Description
xml string
Source:
Returns:
  • The name stored in the definitions field of the given bpmn process
Type
string

(async, inner) getStartEvents(xml) → {array}

Function that returns ids of all start events in a bpmn process model

Parameters:
Name Type Description
xml string

the bpmn process

Source:
Returns:
  • the ids of all startEvents
Type
array

(async, inner) getSubprocessFromXML(xml, subprocessId) → {string}

Returns a xml with Diagram Elements just from the given subprocess and their nested Processes

Structure of XMl: Defintions

  • Process -FlowElements of the Process (BPMN Part)
  • Process End
  • Diagram (How to visualize the XML in the viewer) Definitions End

This function only remove all Diagram Parts that are not part of the subprocess - the flowElements are still part of the xml

Parameters:
Name Type Description
xml string

XML of the main process

subprocessId string

id of subprocess you want to show

Source:
Returns:
  • xml with only diagram parts for the subprocess
Type
string

(async, inner) manipulateElementById(xml, id, manipFunc)

Function that changes an element in the given xml using the given manipulation function

Parameters:
Name Type Description
xml object

the bpmn xml we want to change

id string

the id of the element we want to change

manipFunc function

the function that will be used to change the element

Source:

(async, inner) manipulateElementsByTagName(xml, tagName, manipFunc)

Function that changes all elements in the given xml with the given tagname using the given function

Parameters:
Name Type Description
xml *

the xml we want to make changes in

tagName *

the tagname of the elements we want to change

manipFunc *

the function that gets called on each element

Source:

(async, inner) removeCallActivityReference(bpmn, callActivityId)

Remove the reference to the called process added in addCallActivityReference but remains the actual bpmn element

Parameters:
Name Type Description
bpmn String

The bpmn file as string with a call activity and the meta information regarding the called process

callActivityId String

The ID of the bpmn element for which the meta information should be removed

Source:

(async, inner) removeUnusedCallActivityReferences(bpmn)

Look up the given bpmn document for unused imports/custom namespaces which don't get referenced by a call activity inside this bpmn document.

Parameters:
Name Type Description
bpmn String

a bpmn document with maybe unused references to other processes

Source:

(async, inner) setDeploymentMethod(bpmn, method) → {string}

Sets deployment method of a process

Parameters:
Name Type Description
bpmn *

the xml we want to update

method *

the method we want to set (dynamic/static)

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setId(bpmn, id) → {string}

Sets id in definitions element to given id

Parameters:
Name Type Description
bpmn string

the xml we want to update

id string

the id we want to set the definitions element to

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setMachineInfo(xml, machineInfo)

Function that sets the machineInfo of all elements in the given xml with the given machineIds

Parameters:
Name Type Description
xml *

the xml we want to make changes in

machineInfo *

the machineAddresses and machineIps of all the elements we want to set

Source:

(async, inner) setName(bpmn, name) → {string}

Adds name attribute to definitions element and sets it to the given name

Parameters:
Name Type Description
bpmn string

the xml we want to update

name string

the name we want to set for our bpmn

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setProcessId(bpmn, id) → {string}

Sets id in process element to given id

Parameters:
Name Type Description
bpmn string

the xml we want to update

id string

the id we want to set for the process inside the bpmn

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setStandardDefinitions(bpmn, exporterVersionopt) → {string}

Sets Exporter in definitions element to PROCEED Management System Sets exporterVersion in definitions element to Version

Parameters:
Name Type Attributes Description
bpmn String

the xml we want to update

exporterVersion String <optional>

the exporter version as optional value

Source:
Returns:

the updated xml

Type
string

(async, inner) setTargetNamespace(bpmn, id) → {string}

Sets targetNamespace in definitions element to https://docs.proceed-labs.org/${id}

Parameters:
Name Type Description
bpmn *

the xml we want to update

id *

the id we want to add

Source:
Returns:
  • the updated xml
Type
string

(inner) toObject(xml, typename) → {Promise.<(object|Error)>}

Function that converts the given xml to a traversable object representation

Parameters:
Name Type Description
xml string

the bpmn xml we want to convert

typename string

name of the root element

Source:
Returns:
  • a taversable object representation of the given xml
Type
Promise.<(object|Error)>

(inner) toXML(bpmn) → {Promise.<(string|Error)>}

Function that converts the given bpmn object to xml

Parameters:
Name Type Description
bpmn object

traversable object representation

Source:
Returns:
  • a xml representation of the given object
Type
Promise.<(string|Error)>

(async, inner) validateCalledProcess(xml, processId)

Checks if a process referenced in a call activity contains only a single non-typed start event

Parameters:
Name Type Description
xml String
processId String
Source:

Methods

(async, inner) addCallActivityReference(rootBpmn, callActivityId, calledBpmn, calledProcessLocation)

Add meta information of the called bpmn process to the bpmn file where it's getting called from. This includes a custom namespace in the definitions part, an import element as first child of definitions and the calledElement attribute of the call activity bpmn element

Parameters:
Name Type Description
rootBpmn String

The bpmn file as string where the call activity is in

callActivityId String

The ID of the call activity bpmn element inside the rootBpmn

calledBpmn String

The bpmn file of the called process

calledProcessLocation String

The DefinitionId of the calledBpmn. Combination of process name and process id

Source:

(async, inner) addConstraints(bpmnXML, processConstraints, taskConstraintMapping)

Adds process and task constraints as extension elements to XML after checking for inconsistencies

Parameters:
Name Type Description
bpmnXML
processConstraints
taskConstraintMapping
Source:
Returns:

modified bpmnXML

(inner) getAllElements(travObj) → {array}

A function that given a traversable object returns all occurences

Parameters:
Name Type Description
travObj object

the object we want to search in

Source:
Returns:
  • all nodes within the object
Type
array

(async, inner) getCallActivityDefinitionIdMapping(xml)

Gets definitionIds for all imported Processes used in call Activities

Parameters:
Name Type Description
xml String

the process definition

Source:

(inner) getChildren(travObj) → {array}

Finds all kinds of childnodes in a given node

Parameters:
Name Type Description
travObj object

object of which we want to know the childnodes

Source:
Returns:
  • all childnodes of the given node
Type
array

(async, inner) getDeploymentMethod(xml) → {string}

Gets deployment method of the given process

Parameters:
Name Type Description
xml string

the bpmn diagram that contains the process

Source:
Returns:
  • the deployment method used for the given process
Type
string

(inner) getElementById(travObj, id) → {object|undefined}

A function that given a traversable object returns the nested object with the given id

Parameters:
Name Type Description
travObj object

the object we want to search in

id string

the id of the object we want to find

Source:
Returns:
  • returns the found object or undefined when no matching object was found
Type
object | undefined

(async, inner) getElementMachineMapping(xml) → {object}

Returns a mapping of the ids of the process nodes to the machines they are mapped to

Parameters:
Name Type Description
xml string
Source:
Returns:
  • the mapping from a node id to information about the machine it is mapped to
Type
object

(inner) getElementsByTagName(travObj, tagname) → {array}

A function that given a traversable object returns all occurences of a given tagName

Parameters:
Name Type Description
travObj object

the object we want to search in

tagname string

the name we are searching for

Source:
Returns:
  • all nodes with the given tagName
Type
array

(inner) getExporterName() → {string}

Exporter name is used in the bpmn definitions parts

Source:
Returns:

static exporter name

Type
string

(inner) getExporterVersion() → {string}

Exporter version is used in the bpmn definitions parts

This version should be adjusted when this module (bpmn-helper) changes or any changes in the management-system occur regarding the export

Source:
Returns:

static exporter version

Type
string

(async, inner) getId(xml) → {string}

Returns id of the given process definition

Parameters:
Name Type Description
xml String
Source:
Returns:
  • The id stored in the definitions field of the given bpmn process
Type
string

(async, inner) getImports(xml) → {Array.<Object>}

Returns an array of import elements for a given bpmn xml

Parameters:
Name Type Description
xml string
Source:
Returns:
  • Arry of of import elements inside the given xml
Type
Array.<Object>

(async, inner) getName(xml) → {string}

Returns the name of the given bpmn process definition

Parameters:
Name Type Description
xml string
Source:
Returns:
  • The name stored in the definitions field of the given bpmn process
Type
string

(async, inner) getStartEvents(xml) → {array}

Function that returns ids of all start events in a bpmn process model

Parameters:
Name Type Description
xml string

the bpmn process

Source:
Returns:
  • the ids of all startEvents
Type
array

(async, inner) getSubprocessFromXML(xml, subprocessId) → {string}

Returns a xml with Diagram Elements just from the given subprocess and their nested Processes

Structure of XMl: Defintions

  • Process -FlowElements of the Process (BPMN Part)
  • Process End
  • Diagram (How to visualize the XML in the viewer) Definitions End

This function only remove all Diagram Parts that are not part of the subprocess - the flowElements are still part of the xml

Parameters:
Name Type Description
xml string

XML of the main process

subprocessId string

id of subprocess you want to show

Source:
Returns:
  • xml with only diagram parts for the subprocess
Type
string

(async, inner) manipulateElementById(xml, id, manipFunc)

Function that changes an element in the given xml using the given manipulation function

Parameters:
Name Type Description
xml object

the bpmn xml we want to change

id string

the id of the element we want to change

manipFunc function

the function that will be used to change the element

Source:

(async, inner) manipulateElementsByTagName(xml, tagName, manipFunc)

Function that changes all elements in the given xml with the given tagname using the given function

Parameters:
Name Type Description
xml *

the xml we want to make changes in

tagName *

the tagname of the elements we want to change

manipFunc *

the function that gets called on each element

Source:

(async, inner) removeCallActivityReference(bpmn, callActivityId)

Remove the reference to the called process added in addCallActivityReference but remains the actual bpmn element

Parameters:
Name Type Description
bpmn String

The bpmn file as string with a call activity and the meta information regarding the called process

callActivityId String

The ID of the bpmn element for which the meta information should be removed

Source:

(async, inner) removeUnusedCallActivityReferences(bpmn)

Look up the given bpmn document for unused imports/custom namespaces which don't get referenced by a call activity inside this bpmn document.

Parameters:
Name Type Description
bpmn String

a bpmn document with maybe unused references to other processes

Source:

(async, inner) setDeploymentMethod(bpmn, method) → {string}

Sets deployment method of a process

Parameters:
Name Type Description
bpmn *

the xml we want to update

method *

the method we want to set (dynamic/static)

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setId(bpmn, id) → {string}

Sets id in definitions element to given id

Parameters:
Name Type Description
bpmn string

the xml we want to update

id string

the id we want to set the definitions element to

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setMachineInfo(xml, machineInfo)

Function that sets the machineInfo of all elements in the given xml with the given machineIds

Parameters:
Name Type Description
xml *

the xml we want to make changes in

machineInfo *

the machineAddresses and machineIps of all the elements we want to set

Source:

(async, inner) setName(bpmn, name) → {string}

Adds name attribute to definitions element and sets it to the given name

Parameters:
Name Type Description
bpmn string

the xml we want to update

name string

the name we want to set for our bpmn

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setProcessId(bpmn, id) → {string}

Sets id in process element to given id

Parameters:
Name Type Description
bpmn string

the xml we want to update

id string

the id we want to set for the process inside the bpmn

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setStandardDefinitions(bpmn, exporterVersionopt) → {string}

Sets Exporter in definitions element to PROCEED Management System Sets exporterVersion in definitions element to Version

Parameters:
Name Type Attributes Description
bpmn String

the xml we want to update

exporterVersion String <optional>

the exporter version as optional value

Source:
Returns:

the updated xml

Type
string

(async, inner) setTargetNamespace(bpmn, id) → {string}

Sets targetNamespace in definitions element to https://docs.proceed-labs.org/${id}

Parameters:
Name Type Description
bpmn *

the xml we want to update

id *

the id we want to add

Source:
Returns:
  • the updated xml
Type
string

(inner) toObject(xml, typename) → {Promise.<(object|Error)>}

Function that converts the given xml to a traversable object representation

Parameters:
Name Type Description
xml string

the bpmn xml we want to convert

typename string

name of the root element

Source:
Returns:
  • a taversable object representation of the given xml
Type
Promise.<(object|Error)>

(inner) toXML(bpmn) → {Promise.<(string|Error)>}

Function that converts the given bpmn object to xml

Parameters:
Name Type Description
bpmn object

traversable object representation

Source:
Returns:
  • a xml representation of the given object
Type
Promise.<(string|Error)>

(async, inner) validateCalledProcess(xml, processId)

Checks if a process referenced in a call activity contains only a single non-typed start event

Parameters:
Name Type Description
xml String
processId String
Source:

Methods

(async, inner) addCallActivityReference(rootBpmn, callActivityId, calledBpmn, calledProcessLocation)

Add meta information of the called bpmn process to the bpmn file where it's getting called from. This includes a custom namespace in the definitions part, an import element as first child of definitions and the calledElement attribute of the call activity bpmn element

Parameters:
Name Type Description
rootBpmn String

The bpmn file as string where the call activity is in

callActivityId String

The ID of the call activity bpmn element inside the rootBpmn

calledBpmn String

The bpmn file of the called process

calledProcessLocation String

The DefinitionId of the calledBpmn. Combination of process name and process id

Source:

(async, inner) addConstraints(bpmnXML, processConstraints, taskConstraintMapping)

Adds process and task constraints as extension elements to XML after checking for inconsistencies

Parameters:
Name Type Description
bpmnXML
processConstraints
taskConstraintMapping
Source:
Returns:

modified bpmnXML

(inner) getAllElements(travObj) → {array}

A function that given a traversable object returns all occurences

Parameters:
Name Type Description
travObj object

the object we want to search in

Source:
Returns:
  • all nodes within the object
Type
array

(async, inner) getCallActivityDefinitionIdMapping(xml)

Gets definitionIds for all imported Processes used in call Activities

Parameters:
Name Type Description
xml String

the process definition

Source:

(inner) getChildren(travObj) → {array}

Finds all kinds of childnodes in a given node

Parameters:
Name Type Description
travObj object

object of which we want to know the childnodes

Source:
Returns:
  • all childnodes of the given node
Type
array

(async, inner) getDeploymentMethod(xml) → {string}

Gets deployment method of the given process

Parameters:
Name Type Description
xml string

the bpmn diagram that contains the process

Source:
Returns:
  • the deployment method used for the given process
Type
string

(inner) getElementById(travObj, id) → {object|undefined}

A function that given a traversable object returns the nested object with the given id

Parameters:
Name Type Description
travObj object

the object we want to search in

id string

the id of the object we want to find

Source:
Returns:
  • returns the found object or undefined when no matching object was found
Type
object | undefined

(async, inner) getElementMachineMapping(xml) → {object}

Returns a mapping of the ids of the process nodes to the machines they are mapped to

Parameters:
Name Type Description
xml string
Source:
Returns:
  • the mapping from a node id to information about the machine it is mapped to
Type
object

(inner) getElementsByTagName(travObj, tagname) → {array}

A function that given a traversable object returns all occurences of a given tagName

Parameters:
Name Type Description
travObj object

the object we want to search in

tagname string

the name we are searching for

Source:
Returns:
  • all nodes with the given tagName
Type
array

(inner) getExporterName() → {string}

Exporter name is used in the bpmn definitions parts

Source:
Returns:

static exporter name

Type
string

(inner) getExporterVersion() → {string}

Exporter version is used in the bpmn definitions parts

This version should be adjusted when this module (bpmn-helper) changes or any changes in the management-system occur regarding the export

Source:
Returns:

static exporter version

Type
string

(async, inner) getId(xml) → {string}

Returns id of the given process definition

Parameters:
Name Type Description
xml String
Source:
Returns:
  • The id stored in the definitions field of the given bpmn process
Type
string

(async, inner) getImports(xml) → {Array.<Object>}

Returns an array of import elements for a given bpmn xml

Parameters:
Name Type Description
xml string
Source:
Returns:
  • Arry of of import elements inside the given xml
Type
Array.<Object>

(async, inner) getName(xml) → {string}

Returns the name of the given bpmn process definition

Parameters:
Name Type Description
xml string
Source:
Returns:
  • The name stored in the definitions field of the given bpmn process
Type
string

(async, inner) getStartEvents(xml) → {array}

Function that returns ids of all start events in a bpmn process model

Parameters:
Name Type Description
xml string

the bpmn process

Source:
Returns:
  • the ids of all startEvents
Type
array

(async, inner) getSubprocessFromXML(xml, subprocessId) → {string}

Returns a xml with Diagram Elements just from the given subprocess and their nested Processes

Structure of XMl: Defintions

  • Process -FlowElements of the Process (BPMN Part)
  • Process End
  • Diagram (How to visualize the XML in the viewer) Definitions End

This function only remove all Diagram Parts that are not part of the subprocess - the flowElements are still part of the xml

Parameters:
Name Type Description
xml string

XML of the main process

subprocessId string

id of subprocess you want to show

Source:
Returns:
  • xml with only diagram parts for the subprocess
Type
string

(async, inner) manipulateElementById(xml, id, manipFunc)

Function that changes an element in the given xml using the given manipulation function

Parameters:
Name Type Description
xml object

the bpmn xml we want to change

id string

the id of the element we want to change

manipFunc function

the function that will be used to change the element

Source:

(async, inner) manipulateElementsByTagName(xml, tagName, manipFunc)

Function that changes all elements in the given xml with the given tagname using the given function

Parameters:
Name Type Description
xml *

the xml we want to make changes in

tagName *

the tagname of the elements we want to change

manipFunc *

the function that gets called on each element

Source:

(async, inner) removeCallActivityReference(bpmn, callActivityId)

Remove the reference to the called process added in addCallActivityReference but remains the actual bpmn element

Parameters:
Name Type Description
bpmn String

The bpmn file as string with a call activity and the meta information regarding the called process

callActivityId String

The ID of the bpmn element for which the meta information should be removed

Source:

(async, inner) removeUnusedCallActivityReferences(bpmn)

Look up the given bpmn document for unused imports/custom namespaces which don't get referenced by a call activity inside this bpmn document.

Parameters:
Name Type Description
bpmn String

a bpmn document with maybe unused references to other processes

Source:

(async, inner) setDeploymentMethod(bpmn, method) → {string}

Sets deployment method of a process

Parameters:
Name Type Description
bpmn *

the xml we want to update

method *

the method we want to set (dynamic/static)

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setId(bpmn, id) → {string}

Sets id in definitions element to given id

Parameters:
Name Type Description
bpmn string

the xml we want to update

id string

the id we want to set the definitions element to

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setMachineInfo(xml, machineInfo)

Function that sets the machineInfo of all elements in the given xml with the given machineIds

Parameters:
Name Type Description
xml *

the xml we want to make changes in

machineInfo *

the machineAddresses and machineIps of all the elements we want to set

Source:

(async, inner) setName(bpmn, name) → {string}

Adds name attribute to definitions element and sets it to the given name

Parameters:
Name Type Description
bpmn string

the xml we want to update

name string

the name we want to set for our bpmn

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setProcessId(bpmn, id) → {string}

Sets id in process element to given id

Parameters:
Name Type Description
bpmn string

the xml we want to update

id string

the id we want to set for the process inside the bpmn

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setStandardDefinitions(bpmn, exporterVersionopt) → {string}

Sets Exporter in definitions element to PROCEED Management System Sets exporterVersion in definitions element to Version

Parameters:
Name Type Attributes Description
bpmn String

the xml we want to update

exporterVersion String <optional>

the exporter version as optional value

Source:
Returns:

the updated xml

Type
string

(async, inner) setTargetNamespace(bpmn, id) → {string}

Sets targetNamespace in definitions element to https://docs.proceed-labs.org/${id}

Parameters:
Name Type Description
bpmn *

the xml we want to update

id *

the id we want to add

Source:
Returns:
  • the updated xml
Type
string

(inner) toObject(xml, typename) → {Promise.<(object|Error)>}

Function that converts the given xml to a traversable object representation

Parameters:
Name Type Description
xml string

the bpmn xml we want to convert

typename string

name of the root element

Source:
Returns:
  • a taversable object representation of the given xml
Type
Promise.<(object|Error)>

(inner) toXML(bpmn) → {Promise.<(string|Error)>}

Function that converts the given bpmn object to xml

Parameters:
Name Type Description
bpmn object

traversable object representation

Source:
Returns:
  • a xml representation of the given object
Type
Promise.<(string|Error)>

(async, inner) validateCalledProcess(xml, processId)

Checks if a process referenced in a call activity contains only a single non-typed start event

Parameters:
Name Type Description
xml String
processId String
Source:

Methods

(async, inner) addCallActivityReference(rootBpmn, callActivityId, calledBpmn, calledProcessLocation)

Add meta information of the called bpmn process to the bpmn file where it's getting called from. This includes a custom namespace in the definitions part, an import element as first child of definitions and the calledElement attribute of the call activity bpmn element

Parameters:
Name Type Description
rootBpmn String

The bpmn file as string where the call activity is in

callActivityId String

The ID of the call activity bpmn element inside the rootBpmn

calledBpmn String

The bpmn file of the called process

calledProcessLocation String

The DefinitionId of the calledBpmn. Combination of process name and process id

Source:

(async, inner) addConstraints(bpmnXML, processConstraints, taskConstraintMapping)

Adds process and task constraints as extension elements to XML after checking for inconsistencies

Parameters:
Name Type Description
bpmnXML
processConstraints
taskConstraintMapping
Source:
Returns:

modified bpmnXML

(inner) getAllElements(travObj) → {array}

A function that given a traversable object returns all occurences

Parameters:
Name Type Description
travObj object

the object we want to search in

Source:
Returns:
  • all nodes within the object
Type
array

(async, inner) getCallActivityDefinitionIdMapping(xml)

Gets definitionIds for all imported Processes used in call Activities

Parameters:
Name Type Description
xml String

the process definition

Source:

(inner) getChildren(travObj) → {array}

Finds all kinds of childnodes in a given node

Parameters:
Name Type Description
travObj object

object of which we want to know the childnodes

Source:
Returns:
  • all childnodes of the given node
Type
array

(async, inner) getDeploymentMethod(xml) → {string}

Gets deployment method of the given process

Parameters:
Name Type Description
xml string

the bpmn diagram that contains the process

Source:
Returns:
  • the deployment method used for the given process
Type
string

(inner) getElementById(travObj, id) → {object|undefined}

A function that given a traversable object returns the nested object with the given id

Parameters:
Name Type Description
travObj object

the object we want to search in

id string

the id of the object we want to find

Source:
Returns:
  • returns the found object or undefined when no matching object was found
Type
object | undefined

(async, inner) getElementMachineMapping(xml) → {object}

Returns a mapping of the ids of the process nodes to the machines they are mapped to

Parameters:
Name Type Description
xml string
Source:
Returns:
  • the mapping from a node id to information about the machine it is mapped to
Type
object

(inner) getElementsByTagName(travObj, tagname) → {array}

A function that given a traversable object returns all occurences of a given tagName

Parameters:
Name Type Description
travObj object

the object we want to search in

tagname string

the name we are searching for

Source:
Returns:
  • all nodes with the given tagName
Type
array

(inner) getExporterName() → {string}

Exporter name is used in the bpmn definitions parts

Source:
Returns:

static exporter name

Type
string

(inner) getExporterVersion() → {string}

Exporter version is used in the bpmn definitions parts

This version should be adjusted when this module (bpmn-helper) changes or any changes in the management-system occur regarding the export

Source:
Returns:

static exporter version

Type
string

(async, inner) getId(xml) → {string}

Returns id of the given process definition

Parameters:
Name Type Description
xml String
Source:
Returns:
  • The id stored in the definitions field of the given bpmn process
Type
string

(async, inner) getImports(xml) → {Array.<Object>}

Returns an array of import elements for a given bpmn xml

Parameters:
Name Type Description
xml string
Source:
Returns:
  • Arry of of import elements inside the given xml
Type
Array.<Object>

(async, inner) getName(xml) → {string}

Returns the name of the given bpmn process definition

Parameters:
Name Type Description
xml string
Source:
Returns:
  • The name stored in the definitions field of the given bpmn process
Type
string

(async, inner) getStartEvents(xml) → {array}

Function that returns ids of all start events in a bpmn process model

Parameters:
Name Type Description
xml string

the bpmn process

Source:
Returns:
  • the ids of all startEvents
Type
array

(async, inner) getSubprocessFromXML(xml, subprocessId) → {string}

Returns a xml with Diagram Elements just from the given subprocess and their nested Processes

Structure of XMl: Defintions

  • Process -FlowElements of the Process (BPMN Part)
  • Process End
  • Diagram (How to visualize the XML in the viewer) Definitions End

This function only remove all Diagram Parts that are not part of the subprocess - the flowElements are still part of the xml

Parameters:
Name Type Description
xml string

XML of the main process

subprocessId string

id of subprocess you want to show

Source:
Returns:
  • xml with only diagram parts for the subprocess
Type
string

(async, inner) manipulateElementById(xml, id, manipFunc)

Function that changes an element in the given xml using the given manipulation function

Parameters:
Name Type Description
xml object

the bpmn xml we want to change

id string

the id of the element we want to change

manipFunc function

the function that will be used to change the element

Source:

(async, inner) manipulateElementsByTagName(xml, tagName, manipFunc)

Function that changes all elements in the given xml with the given tagname using the given function

Parameters:
Name Type Description
xml *

the xml we want to make changes in

tagName *

the tagname of the elements we want to change

manipFunc *

the function that gets called on each element

Source:

(async, inner) removeCallActivityReference(bpmn, callActivityId)

Remove the reference to the called process added in addCallActivityReference but remains the actual bpmn element

Parameters:
Name Type Description
bpmn String

The bpmn file as string with a call activity and the meta information regarding the called process

callActivityId String

The ID of the bpmn element for which the meta information should be removed

Source:

(async, inner) removeUnusedCallActivityReferences(bpmn)

Look up the given bpmn document for unused imports/custom namespaces which don't get referenced by a call activity inside this bpmn document.

Parameters:
Name Type Description
bpmn String

a bpmn document with maybe unused references to other processes

Source:

(async, inner) setDeploymentMethod(bpmn, method) → {string}

Sets deployment method of a process

Parameters:
Name Type Description
bpmn *

the xml we want to update

method *

the method we want to set (dynamic/static)

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setId(bpmn, id) → {string}

Sets id in definitions element to given id

Parameters:
Name Type Description
bpmn string

the xml we want to update

id string

the id we want to set the definitions element to

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setMachineInfo(xml, machineInfo)

Function that sets the machineInfo of all elements in the given xml with the given machineIds

Parameters:
Name Type Description
xml *

the xml we want to make changes in

machineInfo *

the machineAddresses and machineIps of all the elements we want to set

Source:

(async, inner) setName(bpmn, name) → {string}

Adds name attribute to definitions element and sets it to the given name

Parameters:
Name Type Description
bpmn string

the xml we want to update

name string

the name we want to set for our bpmn

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setProcessId(bpmn, id) → {string}

Sets id in process element to given id

Parameters:
Name Type Description
bpmn string

the xml we want to update

id string

the id we want to set for the process inside the bpmn

Source:
Returns:
  • the updated xml
Type
string

(async, inner) setStandardDefinitions(bpmn, exporterVersionopt) → {string}

Sets Exporter in definitions element to PROCEED Management System Sets exporterVersion in definitions element to Version

Parameters:
Name Type Attributes Description
bpmn String

the xml we want to update

exporterVersion String <optional>

the exporter version as optional value

Source:
Returns:

the updated xml

Type
string

(async, inner) setTargetNamespace(bpmn, id) → {string}

Sets targetNamespace in definitions element to https://docs.proceed-labs.org/${id}

Parameters:
Name Type Description
bpmn *

the xml we want to update

id *

the id we want to add

Source:
Returns:
  • the updated xml
Type
string

(inner) toObject(xml, typename) → {Promise.<(object|Error)>}

Function that converts the given xml to a traversable object representation

Parameters:
Name Type Description
xml string

the bpmn xml we want to convert

typename string

name of the root element

Source:
Returns:
  • a taversable object representation of the given xml
Type
Promise.<(object|Error)>

(inner) toXML(bpmn) → {Promise.<(string|Error)>}

Function that converts the given bpmn object to xml

Parameters:
Name Type Description
bpmn object

traversable object representation

Source:
Returns:
  • a xml representation of the given object
Type
Promise.<(string|Error)>

(async, inner) validateCalledProcess(xml, processId)

Checks if a process referenced in a call activity contains only a single non-typed start event

Parameters:
Name Type Description
xml String
processId String
Source: