<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Error while creating process by using Fluent API.
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/snowstormuser">snowstorm tech</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/783821#783821">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="margin-bottom: .0001pt;"><span style="font-size: 10pt; font-family: Arial, sans-serif;">By using Fluent API I want to create a Business Process as Shown below:-</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/2-783821-20012/process.png"><span> https://community.jboss.org/servlet/JiveServlet/downloadImage/2-783821-20012/450-134/process.png </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Now I'm using the following code given below to create such a kind of process:-</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java"><font color="navy"><b>public</b></font> <font color="navy"><b>class</b></font> ProcessFactoryTest <font color="navy">{</font>
&#160; 
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;<font color="navy"><b>public</b></font> <font color="navy"><b>void</b></font> testProcessFactory() <font color="navy">{</font>
&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;RuleFlowProcessFactory factory = RuleFlowProcessFactory.createProcess(<font color="red">"org.jbpm.process"</font>);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;factory
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.name(<font color="red">"My process"</font>).packageName(<font color="red">"org.jbpm"</font>).imports(<font color="red">"com.test.SendHTMLEmail"</font>,<font color="red">"com.test.Name"</font>).variable(<font color="red">"listName"</font>, <font color="navy"><b>new</b></font> ListDataType())
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.startNode(1).name(<font color="red">"Start"</font>).done().joinNode(2).type(org.jbpm.workflow.core.node.Join.TYPE_XOR).done().connection( 1,2).humanTaskNode(3).actorId(<font color="red">"shahid"</font>).done().connection(2, 3)
&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.splitNode(4).type(Split.TYPE_XOR).constraint(2, <font color="red">"Join node"</font>, <font color="red">"code"</font>, <font color="red">"java"</font>, <font color="red">"return (false;"</font>).constraint(5, <font color="red">"Usertask Node"</font>, <font color="red">"code"</font>, <font color="red">"java"</font>, <font color="red">"return (true;"</font>).done().connection(3, 4).endNode(5).name(<font color="red">"End"</font>).done()
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.connection(4, 5);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;RuleFlowProcess process = factory.validate().getProcess();
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;<font color="navy">}</font>
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;<font color="navy"><b>public</b></font> <font color="navy"><b>static</b></font> <font color="navy"><b>void</b></font> main(String args[])
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;<font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="navy"><b>new</b></font> ProcessFactoryTest().testProcessFactory();
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;<font color="navy">}</font>
<font color="navy">}</font>
&#160;
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="margin-bottom: .0001pt;"><span style="font-size: 10pt; font-family: Arial, sans-serif;">While executing the above specified code I'm having the following error (When I use fluent API) :-</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java"><font color="red">"Process 'My process' [org.jbpm.process]: Join node 'null' [2] does not have more than one incoming connection: 1.</font>
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;Process <font color="navy">'My process'</font> [org.jbpm.process]: Split node <font color="navy">'null'</font> [4] does not have more than one outgoing connection: 1.
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;Exception in thread <font color="red">"main"</font> java.lang.RuntimeException: Process could not be validated !
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.jbpm.ruleflow.core.RuleFlowProcessFactory.validate(RuleFlowProcessFactory.java:125)
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at com.sample.ProcessFactoryTest.testProcessFactory(ProcessFactoryTest.java:43)
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at com.sample.ProcessFactoryTest.main(ProcessFactoryTest.java:59)<font color="red">"</font>
&#160;
</code></pre></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/783821#783821">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>