5 Replies Latest reply on Jul 3, 2012 5:49 AM by swiderski.maciej

    Connection name attribute, conditional flow without gateways

    konias

      Hi there,

       

      I have a question why SequenceFlow defines name and others variables in bpmn file, but these variables are not accessible when traversing process graph by object Connection. Should i create some feature request, or that was a design decision ?

      Because with connection to (at least i hope so) conditional flow without gateways, which I've seen in master (jbpm.enable.multi.con - system property) it would be great to be able to access name of transitions.

       

      Cheers KP

        • 1. Re: Connection name attribute, conditional flow without gateways
          swiderski.maciej

          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

            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

              Alright, 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

              1 of 1 people found this helpful
              • 4. Re: Connection name attribute, conditional flow without gateways
                konias

                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

                  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