-
1. Help with examples
salaboy21 Mar 9, 2011 6:44 AM (in response to jmfaerman)1 of 1 people found this helpfulHi Julio,
Great Initiative. Do you think that worth it to copy your examples inside the community training? Would be really nice to have all the community examples together in the same repo. do you think that we can join efforts to make the best community training available?
Greetings
PS: can you share the logs, to see what's happening .. the source code looks fine at first sight...
-
2. Help with examples
jmfaerman Mar 9, 2011 9:06 AM (in response to salaboy21)Sure, that would be great!
Should i fork your Drools_jBPM5-Training-Examples or you add me as a colaborator (github user: jfaerman) ?
I can see in the logs that the WorkflowProcessInstance gets asserted, but the rules don't match...
-
3. Help with examples
salaboy21 Mar 9, 2011 9:10 AM (in response to jmfaerman)Great. I'm just adding you to github.. We use a couple of conventions there for the examples. But we can make the necessary changes to make them uniform.
Can you copy the logger output here to see whats happening?
Greetings.
I will create new issues so we can coordinate how to include the examples inside that repo.
-
4. Help with examples
jmfaerman Mar 9, 2011 9:29 AM (in response to salaboy21)Here it is the logger out:
BEFORE RULEFLOW VARIABLE CHANGED hourOfDay=8h process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
AFTER RULEFLOW VARIABLE CHANGED hourOfDay=8h process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
BEFORE RULEFLOW STARTED process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
BEFORE RULEFLOW NODE TRIGGERED node:StartProcess[id=1] process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
null process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
BEFORE RULEFLOW NODE TRIGGERED node:Hello[id=2] process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
### Starting Greetings process ###
null process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
BEFORE RULEFLOW NODE TRIGGERED node:Define Period[id=3] process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
AFTER RULEFLOW NODE TRIGGERED node:Define Period[id=3] process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
null process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
AFTER RULEFLOW NODE TRIGGERED node:Hello[id=2] process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
null process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
AFTER RULEFLOW NODE TRIGGERED node:StartProcess[id=1] process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
AFTER RULEFLOW STARTED process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
null process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
BEFORE RULEFLOW NODE TRIGGERED node:Bye[id=4] process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
### Finishing Greetings process ###
null process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
BEFORE RULEFLOW NODE TRIGGERED node:EndProcess[id=5] process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
null process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
BEFORE RULEFLOW COMPLETED process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
AFTER RULEFLOW COMPLETED process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
null process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
AFTER RULEFLOW NODE TRIGGERED node:EndProcess[id=5] process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
null process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
AFTER RULEFLOW NODE TRIGGERED node:Bye[id=4] process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
null process:Greetings[id=com.googlecode.cursos.jbpm.greetings]
OBJECT ASSERTED value:WorkflowProcessInstance1 [processId=com.googlecode.cursos.jbpm.greetings,state=2] factId: 1
-
5. Help with examples
salaboy21 Mar 9, 2011 9:41 AM (in response to jmfaerman)looks like your process is finishing before you insert the process instance to the working memory. That's why you don't have any activation and zero rules fired.
You can try adding in your first script node the insertion of the processInstance to the knowledge session. In that way you will probably get an activation and a firing.
Take a look at the documentation that mention that if there are no rules activated inside the rule task the execution will continue.
Greetings.
-
6. Re: Help with examples
jmfaerman Mar 9, 2011 10:07 AM (in response to salaboy21)Yes, that did it
{code:xml}
<scriptTask id="_2" name="Hello" >
<script>
System.out.println("### Starting Greetings process ###");
org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();
kcontext.getKnowledgeRuntime().insert(process);
System.out.println("### Inserted process instance ###");
</script>
</scriptTask>
{code}
But it is stil a bit of a hack... it would be nice to be able to "prepare" the process before starting it or even having the process instance inserted automatically.
Thanks a lot Mauricio
-
7. Re: Help with examples
salaboy21 Mar 9, 2011 10:06 AM (in response to jmfaerman)Yes, that's true. We usually do that kind of things in the back. In old Drools Flow we use the input/output actions for that kind of things. but In the BPMN2 spec we don't have that concepts.
Having a script task it's a hack, thats true, we never recommend to add technical tasks to your business processes.
at least the hack works?
Greetings.
-
8. Re: Help with examples
jmfaerman Mar 9, 2011 10:09 AM (in response to salaboy21)Yes, it works, moving forward!