himly
1
I am developing go back function.
For done this function I need to do three step
- get the squance flow id of before a specifed user task .
- Use that squance flow id start an activity instance.
- cancel the old user task activity instance
But in the first step i am facing some promble .
I am in the need of someone help me figure out how to get the sequence flow id
Thanks you all.
By the way my english is terrible forgive me please.
himly
2
Maybe it is will be more clearly if change the question to “how to get the sequence flow between two activity ?”.
himly
3
I finded the solution by myself.
Here is the code.
String givenActivityId = "activityId";
BpmnModelInstance instance = repositoryService.getBpmnModelInstance("definitionId");
Collection<SequenceFlow> sequenceFlows = instance.getModelElementsByType(SequenceFlow.class);
for (SequenceFlow flow : sequenceFlows) {
if (flow.getTarget().getId().equals(givenActivityId)) {
LOG.info("Founded the sequenceFlow.");
return flow;
}
}
LOG.error("No such sequenceFlow");
1 Like