0 Replies Latest reply on Dec 19, 2012 12:28 AM by snowstormuser

    Error while creating process by using Fluent API.

    snowstormuser

      Hi!

       

       

      By using Fluent API I want to create a Business Process as Shown below :-

      Here I am first using the join node and after task1, its a split node.

      This process can be created using eclipse modeler and succesfully executed.

      The same process creation failes using fluent API as connection between split node to join node is not created.

      process.png

       

      Now I'm using the following code given below to create such a kind of process:-

       

      public class ProcessFactoryTest {
      
                public void testProcessFactory() {
      
                          RuleFlowProcessFactory factory = RuleFlowProcessFactory.createProcess("org.jbpm.process");
                          factory
      
                                    .name("My process").packageName("org.jbpm")
      
                                    .startNode(1).name("Start").done().joinNode(2).type(org.jbpm.workflow.core.node.Join.TYPE_XOR).done().connection( 1,2).humanTaskNode(3).actorId("shahid").done().connection(2, 3)
      
                                    .splitNode(4).type(Split.TYPE_XOR).constraint(2, "Route 2", "code", "java", "return (false;").constraint(5, "Route 1", "code", "java", "return (true;").done().connection(3, 4).endNode(5).name("End").done()
      
                                    .connection(4, 5);
      
                          RuleFlowProcess process = factory.validate().getProcess();
      
      
                }
                public static void main(String args[])
                {
                          new ProcessFactoryTest().testProcessFactory();
                }
      }
      
      

       

      While executing the above specified code I'm having the following error (When I use fluent API) :-

       

      "Process 'My process' [org.jbpm.process]: Join node 'null' [2] does not have more than one incoming connection: 1.
                Process 'My process' [org.jbpm.process]: Split node 'null' [4] does not have more than one outgoing connection: 1.
                Exception in thread "main" java.lang.RuntimeException: Process could not be validated !
                at org.jbpm.ruleflow.core.RuleFlowProcessFactory.validate(RuleFlowProcessFactory.java:125)
                at com.sample.ProcessFactoryTest.testProcessFactory(ProcessFactoryTest.java:43)
                at com.sample.ProcessFactoryTest.main(ProcessFactoryTest.java:59)"