Skip to content

Commit 5f55558

Browse files
committed
added support for processType='None' (Issue #404)
1 parent 7d3bfb1 commit 5f55558

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

open-bpmn.glsp-server/src/main/java/org/openbpmn/glsp/model/BPMNGModelFactory.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public GGraph buildGGraph(final BPMNModel model) {
236236
"participant: " + participant.getName() + " BPMNProcess=" + participant.getProcessRef());
237237
BPMNProcess bpmnProcess = model.openProcess(participant.getProcessRef());
238238
// Add a Pool if the process is private
239-
if (BPMNTypes.PROCESS_TYPE_PRIVATE.equals(bpmnProcess.getProcessType())) {
239+
if (!BPMNTypes.PROCESS_TYPE_PUBLIC.equals(bpmnProcess.getProcessType())) {
240240
List<GModelElement> childList = computeGModelElements(bpmnProcess, participant, gRootNodeList);
241241

242242
PoolGNode pool = new PoolGNodeBuilder(participant) //
@@ -297,8 +297,12 @@ public GGraph buildGGraph(final BPMNModel model) {
297297
// the Associations inside a Pool, we need to add the edge to the
298298
// PoolGNode childList
299299
Participant _participant = _process.findParticipant();
300-
PoolGNode pool = poolGNodeList.get(_participant.getId());
301-
createAssociationGEdges(_process.getAssociations(), pool.getChildren(), _participant);
300+
if (_participant != null) {
301+
PoolGNode pool = poolGNodeList.get(_participant.getId());
302+
createAssociationGEdges(_process.getAssociations(), pool.getChildren(), _participant);
303+
} else {
304+
logger.warn("Unable to resove participant for process " + _process.getId());
305+
}
302306
} else {
303307
createAssociationGEdges(_process.getAssociations(), gRootNodeList, null);
304308
}

open-bpmn.metamodel/src/main/java/org/openbpmn/bpmn/elements/BPMNProcess.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,20 @@ public BPMNProcess(BPMNModel model, Element element, String processType) {
7474
super(model, element);
7575

7676
// set public if not yet specified
77-
if (processType == null || processType.isEmpty() || (!BPMNTypes.PROCESS_TYPE_PRIVATE.equals(processType)
78-
&& !BPMNTypes.PROCESS_TYPE_PUBLIC.equals(processType))) {
79-
BPMNModel.getLogger().warning("bpmn2:process does not define a valid processType - default to 'Public'");
77+
if (processType == null || processType.isEmpty() ||
78+
(!BPMNTypes.PROCESS_TYPE_PRIVATE.equals(processType)
79+
&& !BPMNTypes.PROCESS_TYPE_PUBLIC.equals(processType)
80+
&& !BPMNTypes.PROCESS_TYPE_NONE.equals(processType))) {
81+
BPMNModel.getLogger().warning(
82+
"bpmn2:process does not define a valid processType (" + processType + ") - default to 'Public'");
8083
processType = BPMNTypes.PROCESS_TYPE_PUBLIC;
8184
element.setAttribute("processType", processType);
8285
}
8386
setProcessType(processType);
8487

85-
// set executeable flag onloy for private process
86-
if (BPMNTypes.PROCESS_TYPE_PRIVATE.equals(processType)) {
88+
// set executeable flag only for non public processes
89+
if (!BPMNTypes.PROCESS_TYPE_PUBLIC.equals(processType)
90+
|| BPMNTypes.PROCESS_TYPE_NONE.equals(processType)) {
8791
if ("false".equals(this.elementNode.getAttribute("isExecutable"))) {
8892
setExecutable(false);
8993
} else {

0 commit comments

Comments
 (0)