hi, all. now i have a requirement to make a process force end. my code show belove.
EndEvent end = bpmnModelInstance.newInstance(EndEvent.class);
end.setName(“强制结束”);
end.setId(“forceEnd”);
List newSequenceFlowList = new ArrayList();
SequenceFlow newSequenceFlow = bpmnModelInstance.newInstance(SequenceFlow.class);
newSequenceFlow.setId(“newFlow”);
newSequenceFlow.setSource(currentNode);
newSequenceFlow.setTarget(end);
newSequenceFlowList.add(newSequenceFlow);
it does not work, and give error message . can anyone give me a help. thanks!!!
org.camunda.bpm.model.xml.modelreferenceexception: cannot create reference to model element org.camunda.bpm.model.bpmn.impl.instance.endeventimpl@23f5c1df: element is not part of model. please connect element to the model first.