I don&#39;t really know whether your rule will be activated or not, but you are missing the ksession.fireAllRules() call. Try to add a Logger to your session to see if the rule gets activated or not.<div><br></div><div>Best, <br>

<br><div class="gmail_quote">2010/5/19 HONG DENG <span dir="ltr">&lt;<a href="mailto:denghongster@gmail.com">denghongster@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<b><font color="#FF0000">I paste all information here :<br><br>HelloWorldSample.rf </font></b> :<br><br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; <br>&lt;process xmlns=&quot;<a href="http://drools.org/drools-5.0/process" target="_blank">http://drools.org/drools-5.0/process</a>&quot;<br>


         xmlns:xs=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&quot;<br>         xs:schemaLocation=&quot;<a href="http://drools.org/drools-5.0/process" target="_blank">http://drools.org/drools-5.0/process</a> drools-processes-5.0.xsd&quot;<br>


         type=&quot;RuleFlow&quot; name=&quot;flow&quot; id=&quot;com.sample.evaluation&quot; package-name=&quot;org.drools.bpmn2&quot; &gt;<br><br>  &lt;header&gt;<br>  &lt;/header&gt;<br><br>  &lt;nodes&gt;<br>    &lt;start id=&quot;1&quot; name=&quot;Start&quot; x=&quot;44&quot; y=&quot;139&quot; width=&quot;48&quot; height=&quot;48&quot; /&gt;<br>


    &lt;humanTask id=&quot;2&quot; name=&quot;thefirstone&quot; x=&quot;156&quot; y=&quot;140&quot; width=&quot;80&quot; height=&quot;40&quot; &gt;<br>      &lt;work name=&quot;Human Task&quot; &gt;<br>        &lt;parameter name=&quot;ActorId&quot; &gt;<br>


          &lt;type name=&quot;org.drools.process.core.datatype.impl.type.StringDataType&quot; /&gt;<br>          &lt;value&gt;&lt;/value&gt;<br>        &lt;/parameter&gt;<br>        &lt;parameter name=&quot;Comment&quot; &gt;<br>


          &lt;type name=&quot;org.drools.process.core.datatype.impl.type.StringDataType&quot; /&gt;<br>          &lt;value&gt;You need to perform a self-evaluation&lt;/value&gt;<br>        &lt;/parameter&gt;<br>        &lt;parameter name=&quot;Content&quot; &gt;<br>


          &lt;type name=&quot;org.drools.process.core.datatype.impl.type.StringDataType&quot; /&gt;<br>        &lt;/parameter&gt;<br>        &lt;parameter name=&quot;Priority&quot; &gt;<br>          &lt;type name=&quot;org.drools.process.core.datatype.impl.type.StringDataType&quot; /&gt;<br>


        &lt;/parameter&gt;<br>        &lt;parameter name=&quot;Skippable&quot; &gt;<br>          &lt;type name=&quot;org.drools.process.core.datatype.impl.type.StringDataType&quot; /&gt;<br>          &lt;value&gt;false&lt;/value&gt;<br>


        &lt;/parameter&gt;<br>        &lt;parameter name=&quot;TaskName&quot; &gt;<br>          &lt;type name=&quot;org.drools.process.core.datatype.impl.type.StringDataType&quot; /&gt;<br>          &lt;value&gt;firstHumanTask&lt;/value&gt;<br>


        &lt;/parameter&gt;<br>      &lt;/work&gt;<br>    &lt;/humanTask&gt;<br>    &lt;end id=&quot;3&quot; name=&quot;End&quot; x=&quot;290&quot; y=&quot;140&quot; width=&quot;80&quot; height=&quot;40&quot; /&gt;<br>  &lt;/nodes&gt;<br>


<br>  &lt;connections&gt;<br>    &lt;connection from=&quot;1&quot; to=&quot;2&quot; /&gt;<br>    &lt;connection from=&quot;2&quot; to=&quot;3&quot; /&gt;<br>  &lt;/connections&gt;<br><br>&lt;/process&gt;<br><br><font color="#FF0000"><b>assignment.dslr:</b></font><br>


package org.drools.examples.process.order<br><br>import org.drools.process.instance.impl.WorkItemImpl<br>import org.drools.workflow.instance.node.WorkItemNodeInstance<br><br>expander assignment.dsl<br><br>/********** Generic assignment rules **********/<br>


<br>rule &quot;Assign actor&quot; salience 30<br>        when<br>    There is a human task<br>        then <div>    Set actor id &quot;mary&quot;<br>end</div><div><br></div><div><br></div><div><div><b><font color="#FF0000">assignment.dsl:</font></b></div>


<div><b></b><font color="#FF0000"><b><div><span style="font-weight:normal"><font color="#000000"><span style="font-size:x-small">[condition][HumanTaskWorkItem]- with actor id &quot;{actorId}&quot;=parameters[&#39;ActorId&#39;] == &quot;{actorId}&quot;</span></font></span></div>


<div><span style="font-weight:normal"><font color="#000000"><span style="font-size:x-small">[condition][HumanTaskWorkItem]- without actor id=parameters[&#39;ActorId&#39;] == null</span></font></span></div>
<div><span style="font-weight:normal"><font color="#000000"><span style="font-size:x-small">[condition][HumanTaskWorkItem]- with task name &quot;{taskName}&quot;=parameters[&#39;TaskName&#39;] == &quot;{taskName}&quot;</span></font></span></div>


<div><span style="font-weight:normal"><font color="#000000"><span style="font-size:x-small">[condition][HumanTaskWorkItem]There is a human task=workItemNodeInstance: WorkItemNodeInstance( ) workItem: WorkItemImpl( name == &quot;Human Task&quot; ) from workItemNodeInstance.workItem</span></font></span></div>


<div><span style="font-weight:normal"><font color="#000000"><span style="font-size:x-small">[consequence][]Set actor id &quot;{actorId}&quot;=workItem.setParameter(&quot;ActorId&quot;, &quot;{actorId}&quot;); update(workItemNodeInstance);</span></font></span></div>


<div><span style="font-weight:normal"><font color="#000000"><span style="font-size:x-small">[condition][HumanTaskWorkItem]- with priority {priority}=parameters[&#39;Priority&#39;] == {priority}</span></font></span></div>


<div><span style="font-weight:normal"><font color="#000000"><span style="font-size:x-small">[condition][HumanTaskWorkItem]Process &quot;{processId}&quot; contains a human task=workItemNodeInstance: WorkItemNodeInstance( processInstance.processId == &quot;{processId}&quot; ) workItem: WorkItemImpl( name == &quot;Human Task&quot; ) from workItemNodeInstance.workItem</span></font></span></div>


</b></font></div><br><b><font color="#FF0000">and have following code to start a process instance:</font></b></div><div><b><font color="#FF0000"><div><font color="#000000"><span style="font-weight:normal">package com.sample;</span></font></div>


<div><font color="#000000"><span style="font-weight:normal">/**</span></font></div><div><font color="#000000"><span style="font-weight:normal"> * This is a sample file to launch a process.</span></font></div>
<div><font color="#000000"><span style="font-weight:normal"> */</span></font></div><div><font color="#000000"><span style="font-weight:normal">public class ProcessTest {</span></font></div>
<div><font color="#000000"><span style="font-weight:normal"><br></span></font></div><div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">        </span></font></span><font color="#000000"><span style="font-weight:normal">public static final void main(String[] args) {</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">try {</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">//start humantask component</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">startHumanTaskComponent();</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">// load up the knowledge base</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">KnowledgeBase kbase = readKnowledgeBase();</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, &quot;test&quot;);</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">ksession.getWorkItemManager().registerWorkItemHandler(&quot;Human Task&quot;, new WSHumanTaskHandler());</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">// start a new process instance</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">Map&lt;String, Object&gt; params = new HashMap&lt;String, Object&gt;();</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">params.put(&quot;employee&quot;, &quot;Administrator&quot;);</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">ksession.startProcess(&quot;com.sample.evaluation&quot;, params);</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">} catch (Throwable t) {</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                        </span></font></span><font color="#000000"><span style="font-weight:normal">t.printStackTrace();</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">}</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">        </span></font></span><font color="#000000"><span style="font-weight:normal">}</span></font></div>
<div><font color="#000000"><span style="font-weight:normal"><br></span></font></div><div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">        </span></font></span><font color="#000000"><span style="font-weight:normal">private static KnowledgeBase readKnowledgeBase() throws Exception {</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">KnowledgeBuilderConfiguration conf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();</span></font></div>


<div><font color="#000000"><span style="font-weight:normal">//</span></font><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  ((PackageBuilderConfiguration) conf).initSemanticModules();</span></font></div>


<div><font color="#000000"><span style="font-weight:normal">//</span></font><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  ((PackageBuilderConfiguration) conf).loadSemanticModule(&quot;BPMN2SemanticModule.conf&quot;);</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(conf);</span></font></div>


<div><font color="#000000"><span style="font-weight:normal">//</span></font><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  kbuilder.add(ResourceFactory.newClassPathResource(&quot;hellowWorld.bpmn&quot;), ResourceType.DRF);</span></font></div>

<div class="im">
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  kbuilder.add(ResourceFactory.newClassPathResource(&quot;HelloWorldSample.rf&quot;), ResourceType.DRF);</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  kbuilder.add(ResourceFactory.newClassPathResource(&quot;assignment.dsl&quot;), ResourceType.DSL);</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  kbuilder.add(ResourceFactory.newClassPathResource(&quot;assignment.dslr&quot;), ResourceType.DSLR);</span></font></div>


</div><div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  KnowledgeBuilderErrors errors = kbuilder.getErrors();</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  if (errors.size() &gt; 0) {</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">    for (KnowledgeBuilderError error: errors) {</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">      System.err.println(error);</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">    }</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">    throw new IllegalArgumentException(&quot;Could not parse knowledge.&quot;);</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  }</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">  return kbase;</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">        </span></font></span><font color="#000000"><span style="font-weight:normal">}</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">        </span></font></span></div><div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">        </span></font></span><font color="#000000"><span style="font-weight:normal">private static void startHumanTaskComponent(){</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">EntityManagerFactory emf = Persistence.createEntityManagerFactory(&quot;org.drools.task&quot;);</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">TaskService taskService = new TaskService(emf,SystemEventListenerFactory.getSystemEventListener());</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">User a = new User(&quot;john&quot;);</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">User b = new User(&quot;mary&quot;);</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">TaskServiceSession taskSession = taskService.createSession(); </span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">taskSession.addUser(new User(&quot;Administrator&quot;));</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">taskSession.addUser(a);</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">taskSession.addUser(b);</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">MinaTaskServer server = new MinaTaskServer( taskService );</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">Thread thread = new Thread( server );</span></font></div>


<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">                </span></font></span><font color="#000000"><span style="font-weight:normal">thread.start();</span></font></div>
<div><span style="white-space:pre"><font color="#000000"><span style="font-weight:normal">        </span></font></span><font color="#000000"><span style="font-weight:normal">}</span></font></div>
<div><font color="#000000"><span style="font-weight:normal"><br></span></font></div><div><font color="#000000"><span style="font-weight:normal">}</span></font></div>
</font></b></div><div><br><br>2010/5/19 Esteban Aliverti &lt;<a href="mailto:esteban.aliverti@gmail.com" target="_blank">esteban.aliverti@gmail.com</a>&gt;:<div><div></div><div class="h5"><br>&gt; A good start could be to give us more info, like your rules, your flow and<br>


&gt; how are you executing them. ;)<br>&gt; Best,<br>&gt;<br>&gt; On Wed, May 19, 2010 at 6:39 AM, HONG DENG &lt;<a href="mailto:denghongster@gmail.com" target="_blank">denghongster@gmail.com</a>&gt; wrote:<br>&gt;&gt;<br>

&gt;&gt; hi , i am a drools flow newbie.I want to  using &quot;assignment rule&quot;<br>
&gt;&gt; assign a actor to a HumanTask. I have write a dsl and dslr files and<br>&gt;&gt; following code :<br>&gt;&gt;<br>&gt;&gt;  <br>&gt;&gt; kbuilder.add(ResourceFactory.newClassPathResource(&quot;HelloWorldSample.rf&quot;),<br>


&gt;&gt; ResourceType.DRF);<br>&gt;&gt;   kbuilder.add(ResourceFactory.newClassPathResource(&quot;assignment.dsl&quot;),<br>&gt;&gt; ResourceType.DSL);<br>&gt;&gt;   kbuilder.add(ResourceFactory.newClassPathResource(&quot;assignment.dslr&quot;),<br>


&gt;&gt; ResourceType.DSLR);<br>&gt;&gt;<br>&gt;&gt; but when i start a process instance and the token arrive at a<br>&gt;&gt; humantask,the &quot;assignment rule&quot; couldn&#39;t be firing.<br>&gt;&gt; who can tell me how can i do it?<br>


&gt;&gt; _______________________________________________<br>&gt;&gt; rules-users mailing list<br>&gt;&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>


&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>&gt;<br>&gt; Esteban Aliverti<br>&gt;<br>&gt; _______________________________________________<br>&gt; rules-users mailing list<br>&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>


&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>&gt;<br>&gt;<br><br></div></div></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>
</div>