JBoss Community

Error while creating process by using Fluent API.

created by snowstorm tech in jBPM - View the full discussion

Hi!

 

 

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

 

 

 

https://community.jboss.org/servlet/JiveServlet/downloadImage/2-783821-20012/450-134/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").imports("com.test.SendHTMLEmail","com.test.Name").variable("listName", new ListDataType())
                              
                              .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, "Join node", "code", "java", "return (false;").constraint(5, "Usertask Node", "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)"
 

Reply to this message by going to Community

Start a new discussion in jBPM at Community