ArrayList<TSubProcess> localSubProcessesJaxb = new ArrayList<TSubProcess>(subProcessesJaxb);
// check if the current end event node is a embedded in a sub process
if (localSubProcessesJaxb.size() > 0) {
// we only check the last sub process, because this can only be the sub process we are looking for
TSubProcess subProcessJaxb = localSubProcessesJaxb.get(localSubProcessesJaxb.size()-1);
for (JAXBElement<? extends TFlowElement> flowElementJaxb : subProcessJaxb.getFlowElement()) {
// if the given end event node has been found in this sub process this is an embedded end event
if (flowElementJaxb.getValue().getId().equals(flowNodeJaxb.getId())) {
// remove the current sub process from the list of sub processes to be able to get its actor reference
localSubProcessesJaxb.remove(subProcessJaxb);
return IdService.getUniqueFlowNodeId(clientId, processJaxb, localSubProcessesJaxb, subProcessJaxb);