bpmn-xml-parser
Advanced tools
Comparing version
{ | ||
"name": "bpmn-xml-parser", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "Tool to easily parse message flows of process models in bpmn", | ||
@@ -5,0 +5,0 @@ "main": "xmlParser.js", |
@@ -25,2 +25,8 @@ # BPMN XML Parser focused on message flows. | ||
### **Retrieve id and name of participants/collaborators as object:** | ||
String[{label: name, value: id}]: xmlParser.getParticipantObjects() | ||
Enables unaltered use in select lists like react-select. | ||
### **Retrieve all names of participants/collaborators:** | ||
@@ -27,0 +33,0 @@ |
@@ -51,2 +51,23 @@ import ReadJson from "./readJson"; | ||
//participantObj: { label: participantName, value: participantId } | ||
getParticipantObjects() { | ||
let participantObjects = []; | ||
let participantIds = []; | ||
for (let participant of this.participantObjs) { | ||
if ( | ||
!this._isDefined(participant.attributes) || | ||
!this._isDefined(participant.attributes.name) || | ||
!this._isDefined(participant.attributes.id) | ||
) { | ||
continue; | ||
} | ||
let { name, id } = participant.attributes; | ||
if (!participantIds.includes(id) && id !== "") { | ||
participantIds.push(id); | ||
participantObjects.push({ label: name, value: id }); | ||
} | ||
} | ||
return participantObjects; | ||
} | ||
setRelevantProcesses(processNames) { | ||
@@ -53,0 +74,0 @@ if (processNames.length >= 1) { |
211942
0.43%493
4.23%82
7.89%