*
* @return the parent sub-process builder
* @throws BpmnModelException if no parent sub-process can be found
*/
public SubProcessBuilder subProcessDone() {
BpmnModelElementInstance lastSubProcess = element.getScope();
if (lastSubProcess != null && lastSubProcess instanceof SubProcess) {
return ((SubProcess) lastSubProcess).builder();
}
else {
throw new BpmnModelException("Unable to find a parent subProcess.");