[jboss-user] [jBPM] - Error while creating process by using Fluent API.
snowstorm tech
do-not-reply at jboss.com
Tue Dec 18 01:44:31 EST 2012
snowstorm tech [https://community.jboss.org/people/snowstormuser] created the discussion
"Error while creating process by using Fluent API."
To view the discussion, visit: https://community.jboss.org/message/783821#783821
--------------------------------------------------------------
Hi!
By using Fluent API I want to create a Business Process as Shown below:-
https://community.jboss.org/servlet/JiveServlet/showImage/2-783821-20012/process.png 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
[https://community.jboss.org/message/783821#783821]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121218/ff148a1d/attachment-0001.html
More information about the jboss-user
mailing list