-
1. Re: RuleTask as the 1st in the process
bpmn2user Mar 7, 2011 4:18 PM (in response to jmfaerman)I am trying to understand your usage.
Here is an example http://community.jboss.org/people/bpmn2user/blog/2011/03/07/jbpm5--ruletask-example. It works even if the first one is
-
2. Re: RuleTask as the 1st in the process
jmfaerman Mar 7, 2011 7:50 PM (in response to bpmn2user)I see... it must be something else then... placed another post for it ( http://community.jboss.org/thread/163643?tstart=0 )
In this process you mentioned, why is the fact passed as both a parameter AND inserted in the session:
...
params.put("hpm", hpm);
ksession.insert(hpm);
...
Shouldn't it be one or the other?
-
3. Re: RuleTask as the 1st in the process
bpmn2user Mar 7, 2011 8:07 PM (in response to jmfaerman)Good point!
I also noticed that if you do only one (i.e, fact is passed as a paramter or inserted in session), it would throw an exception.
Perhaps, Kris or Salaboy can clarify if there is another way to do this.
-
4. RuleTask as the 1st in the process
jmfaerman Mar 7, 2011 10:02 PM (in response to bpmn2user)I also noticed that the ruletask example doesn't reference the process instance.... the .drl reads:
...
when
m:HelloProcessModel(userlocation in ("NewYorkUser"), count < 4)
Shouldn't it be something like:
...
when
p:WorkflowProcessInstance()
m:HelloProcessModel(userlocation in ("NewYorkUser"), count < 4) from p.getVariable("hpm")
?
-
5. RuleTask as the 1st in the process
bpmn2user Mar 7, 2011 10:43 PM (in response to jmfaerman)There are several ways to write the rules. This example shows one approach applying the rules on the HelloProcessModel.
These rules can easily be represented in a decision table:
-
6. RuleTask as the 1st in the process
jmfaerman Mar 8, 2011 9:10 AM (in response to bpmn2user)the problem is that my rule doesn't fire when i use
$process: WorkflowProcessInstance()
even thou it is inserted. is there a way to debug the matching/working memory?
-
7. RuleTask as the 1st in the process
bpmn2user Mar 8, 2011 7:16 PM (in response to jmfaerman)Did you look at the Drools debug and audit log functions?
BTW, thanks for pointing out the following. Yes! We do not need both. I modified the blog and it only uses params.put("hpm",hpm).
Later in the Hello script node it inserts the hpm into kcontext (kcontext.getKnowledgeRuntime().insert(hpm);)
--------------------------------------------------
In this process you mentioned, why is the fact passed as both a parameter AND inserted in the session:
...
params.put("hpm", hpm);
ksession.insert(hpm);
...
Shouldn't it be one or the other?
-------------------------------------------------------