public SubProcessBuilder subProcess(String id) {
return createTarget(SubProcess.class, id).builder();
}
public Gateway findLastGateway() {
FlowNode lastGateway = element;
while (true) {
try {
lastGateway = lastGateway.getPreviousNodes().singleResult();
if (lastGateway instanceof Gateway) {
return (Gateway) lastGateway;
}
}
catch(BpmnModelException e) {
throw new BpmnModelException("Unable to determine an unique previous gateway of " + lastGateway.getId(), e);
}
}
}