<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Calibri">Hi Kris,<br>
<br>
I hope you can help me.<br>
<br>
Here you have the whole code:<br>
<br>
public class RuleFlowTest {<br>
<br>
&nbsp;&nbsp;&nbsp; public static final void main(String[] args) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // load up the knowledge base<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; KnowledgeBase kbase = readKnowledgeBase();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "test");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // start a new process instance<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ksession.startProcess("com.sample.ruleflow");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("Waiting...");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Person person = new Person();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; person.setName("Kevin");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; person.setSurname("Alonso");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ksession.insert(person);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; logger.close();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (Throwable t) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t.printStackTrace();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; private static KnowledgeBase readKnowledgeBase() throws Exception {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
kbuilder.add(ResourceFactory.newClassPathResource("ruleflow.rf"),
ResourceType.DRF);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; KnowledgeBuilderErrors errors = kbuilder.getErrors();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (errors.size() &gt; 0) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (KnowledgeBuilderError error: errors) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.err.println(error);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; throw new IllegalArgumentException("Could not parse
knowledge.");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return kbase;<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
}<br>
<br>
Person Class:<br>
<br>
public class Person {<br>
&nbsp;&nbsp;&nbsp; String name;<br>
&nbsp;&nbsp;&nbsp; String surname;<br>
&nbsp;&nbsp;&nbsp; public String getName() {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return name;<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; public void setName(String name) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this.name = name;<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; public String getSurname() {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return surname;<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; public void setSurname(String surname) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this.surname = surname;<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
}<br>
<br>
<br>
And rf file.<br>
<br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt; <br>
&lt;process xmlns=<a class="moz-txt-link-rfc2396E" href="http://drools.org/drools-5.0/process">"http://drools.org/drools-5.0/process"</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns:xs=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xs:schemaLocation=<a class="moz-txt-link-rfc2396E" href="http://drools.org/drools-5.0/processdrools-processes-5.0.xsd">"http://drools.org/drools-5.0/process
drools-processes-5.0.xsd"</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type="RuleFlow" name="ruleflow" id="com.sample.ruleflow"
package-name="com.sample" &gt;<br>
<br>
&nbsp; &lt;header&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;imports&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;import name="com.sample.Person" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/imports&gt;<br>
&nbsp; &lt;/header&gt;<br>
<br>
&nbsp; &lt;nodes&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;start id="1" name="Start" x="16" y="16" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;end id="3" name="End" x="480" y="277" width="80" height="40"
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;milestone id="4" name="Event Wait" x="130" y="17" width="80"
height="40" &gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;constraint type="rule" dialect="mvel"
&gt;Person()&lt;/constraint&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/milestone&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;end id="5" name="End" x="312" y="275" width="80" height="40"
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;split id="6" name="Split" x="354" y="18" width="80" height="40"
type="2" &gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;constraints&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;constraint toNodeId="8" toType="DROOLS_DEFAULT" name="Not
Person" priority="1" type="rule" dialect="mvel" &gt;not
Person()&lt;/constraint&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;constraint toNodeId="7" toType="DROOLS_DEFAULT"
name="Person" priority="1" type="rule" dialect="mvel"
&gt;Person()&lt;/constraint&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/constraints&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/split&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;actionNode id="7" name="Action" x="482" y="185" width="80"
height="40" &gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action type="expression" dialect="java"
&gt;System.out.println("Person");&lt;/action&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/actionNode&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;actionNode id="8" name="Action" x="310" y="185" width="80"
height="40" &gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action type="expression" dialect="mvel"
&gt;System.out.println("No Person");&lt;/action&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/actionNode&gt;<br>
&nbsp; &lt;/nodes&gt;<br>
<br>
&nbsp; &lt;connections&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;connection from="7" to="3" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;connection from="1" to="4" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;connection from="8" to="5" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;connection from="4" to="6" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;connection from="6" to="7" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;connection from="6" to="8" /&gt;<br>
&nbsp; &lt;/connections&gt;<br>
<br>
&lt;/process&gt;<br>
<br>
<br>
<br>
<br>
Kevin.<br>
</font><br>
Kris Verlaenen escribi&oacute;:
<blockquote cite="mid:1253713590.4aba26b6cdd0f@webmail1.kuleuven.be"
 type="cite">
  <pre wrap="">Kevin,

Could you also post your process, so I can take a look and if necessary
try it out locally to see what is going on?

Kris

Quoting Kevin Alonso <a class="moz-txt-link-rfc2396E" href="mailto:kalonso@vicomtech.org">&lt;kalonso@vicomtech.org&gt;</a>:

  </pre>
  <blockquote type="cite">
    <pre wrap="">Hello,
I&acute;m working with a simple flow that has a  Event Wait node. This node

has the following condition:
- Person()

Being Person a class that is not inserted into the session yet.

When the flow arrives to the event wait node its execution stops and
the 
test main class execution continues. Here I insert a Person object to

the session, so now, the flow can continue. After wait node I have a

Split node, which has the followings constraints:

- Person()

- not Person()

The flow always take the not Person() way. But now a Person instance
is 
into the session.

Why is happening this?

Could anyone help me?

Thank you,
Kevin
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>

    </pre>
  </blockquote>
  <pre wrap=""><!---->



Disclaimer: <a class="moz-txt-link-freetext" href="http://www.kuleuven.be/cwis/email_disclaimer.htm">http://www.kuleuven.be/cwis/email_disclaimer.htm</a>

  </pre>
</blockquote>
</body>
</html>