-
1. Re: Connection name attribute, conditional flow without gateways
swiderski.maciej Jul 2, 2012 9:09 AM (in response to konias)how would you like to access it and what would be the use case to get the name of the sequence flows?
-
2. Re: Connection name attribute, conditional flow without gateways
konias Jul 2, 2012 9:25 AM (in response to swiderski.maciej)We are thinking about migration from jBPM3 which have access to these variables and allows multiple transitions on node.
We were using name of these transitions as resource bundle key and generating form buttons etc. Processes are plugable to platform so we'have been using methods like take transition by name and so on.
Also it's usefull for reporting when we track execution path and we want to know transition names.So I would like to know if it will be possible in future releases to specify multiple transitions from node, now it's possible as i said with jbpm.enable.multi.con prop.
Let say i want to get all EndEvent and also their incomming transition (connection) names.
WorkflowProcess process = (WorkflowProcess) ksession.getKnowledgeBase().getProcess(processId);
Node[] nodes = process.getNodes();
Set<NodeDescription> endNodes = new HashSet<NodeDescription>();
for (Node node : nodes) {
if (node instanceof EndNode) {
// Only nodes which terminate all process
if (((EndNode) node).isTerminate()) {
NodeDescriptionImpl description = new NodeDescriptionImpl();
description.setName(node.getName());
Connection connection = node.getIncomingConnections(org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE).get(0);
// now i want to get connection name
TransitionDescription t = new TransitionDescription();
t.setName( connection.getName() );
}
}
}
-
3. Re: Connection name attribute, conditional flow without gateways
swiderski.maciej Jul 2, 2012 9:42 AM (in response to konias)1 of 1 people found this helpfulAlright, now I see what you're up to. Currently you can get name of the connection but only those that have conditions on them. If I recall correctly you need to get the Constraint from the node for given connection and then get the name of Constraint which should be mapped to the name of sequence flow.
node.getConstraint( connection ).getName()
Let me know if that works and to have support for all sequence flows please file a jira for this so we could implement that for next release.
HTH
-
4. Re: Connection name attribute, conditional flow without gateways
konias Jul 2, 2012 5:32 PM (in response to swiderski.maciej)Thanks, that works fine, but only for transition after XOR, OR gateways, i ll fill jira later.
What about second question ? It's recommend and in future releases supported to use multiple conditional flow on node ?
-
5. Re: Connection name attribute, conditional flow without gateways
swiderski.maciej Jul 3, 2012 5:49 AM (in response to konias)With master version that has support for multiple outgoing sequence flows it should provide you with the name for all sequence flows that have conditions on it.
Regarding the other question - it is recommended to use gateways when decision is needed it makes it clear about type of the split as for uncontrolled flow (which is with multiple outgoing sequence flows) it is defined by spec and for some that could not be clear. But since BPMN2 spec defines that jBPM5 supports it (or if not yet will support it).
HTH