-
1. Re: Can not fire a rule
swiderski.maciej Jan 9, 2013 7:26 AM (in response to dmitry.erkin)depends how you deploy your processes and rules. If you simply use jbpm.console.directory then only processes are read from that location and rules are not. You could use Guvnor for that and import both process and rule there. That will make both rules and processes available for the runtime inside console.
HTH
-
2. Re: Can not fire a rule
dmitry.erkin Jan 10, 2013 8:24 AM (in response to swiderski.maciej)Hello, Maciej
Thanks for your answer! My sample process is stored in Guvnor in the same package as the sample rule. And I invoke that process from JBPM-console. So according to what you have said the rule has to be available for the runtime.
Regards,
Dmitry Erkin
-
3. Re: Can not fire a rule
swiderski.maciej Jan 10, 2013 9:24 AM (in response to dmitry.erkin)Have you tried to build the package in guvnor? Another check point, did you place the model (that includes Person class) on console's classpath?
Would be good to verify if all nodes are executed properly via log history. When you run this instance does it complete?
Cheers
-
4. Re: Can not fire a rule
dmitry.erkin Jan 10, 2013 12:50 PM (in response to swiderski.maciej)Hello, Maciej !
That is the point!
I cannot see an instance of Sample process as completed in JBPM-console although it allows me to start a new one and does not show any errors.
It says "All: 0 instances of Sample process".
Person class is on the path, I suppose: d:\jbpm\dependencies\Person.jar
I did that after I put Person.jar in d:\jbpm\dependencies:
ant clean.demo
ant install.demo.noeclipse
And I checked Person class by simple test scenario then.
the defaultPackade is built.
But there are not other messages in server.log while I am starting an instance except those:
21:42:29,359 WARN [org.drools.guvnor.server.repository.RulesRepositoryManager] (http-localhost-127.0.0.1-8080-30) Creating RulesRepository with default username.
21:42:29,369 INFO [stdout] (http-localhost-127.0.0.1-8080-30) =============== session-guest-52021:42:29,369 INFO [org.drools.guvnor.server.security.DemoAuthenticator] (http-localhost-127.0.0.1-8080-30) Demo login for user (admin) succeeded.
21:42:29,379 INFO [org.drools.guvnor.server.files.AuthorizationHeaderChecker] (http-localhost-127.0.0.1-8080-30) admin authenticated for rest api
21:42:29,379 INFO [org.drools.guvnor.server.files.PackageDeploymentServlet] (http-localhost-127.0.0.1-8080-30) PackageName: defaultPackage
21:42:29,379 INFO [org.drools.guvnor.server.files.PackageDeploymentServlet] (http-localhost-127.0.0.1-8080-30) PackageVersion: LATEST
21:42:29,389 INFO [org.drools.guvnor.server.files.PackageDeploymentServlet] (http-localhost-127.0.0.1-8080-30) PackageIsLatest: true
21:42:29,389 INFO [org.drools.guvnor.server.files.PackageDeploymentServlet] (http-localhost-127.0.0.1-8080-30) PackageIsSource: false
21:42:29,389 INFO [stdout] (http-localhost-127.0.0.1-8080-30) =============== session-guest-520So I am in doubt is an instance created or not?
Regards,
Dmitry Erkin
-
5. Re: Can not fire a rule
doboss Jan 10, 2013 2:02 PM (in response to dmitry.erkin)1 of 1 people found this helpfulNot sure if this helps, but I would debug it by putting some script tasks in your process which just print something like "Got here" so you at least know the process is being run. If the process is being run, but you are not seeing the "Person " part, then you know it's something with the rule or the way you are calling the rule.
HTH.
-
6. Re: Can not fire a rule
swiderski.maciej Jan 11, 2013 7:00 AM (in response to doboss)1 of 1 people found this helpful+1 doboss
alternatively you can take a look at data base tables (nodeinstanelog)
I think that the instance is created and since it has no wait state it finishes in the same thread it was started so console won't show it as active.
Just looked at the process again, I think what happens is that the process you insert is null. And this is bacause you set p (which is a process variable) in the script but that is only assigning the value but does not set it as process variable. if you replace the first script with following lines I think the rule will be fired:
p = new Person("john", 19);
kcontext.getProcessInstance().setVariable("p", p);
HTH
-
7. Re: Can not fire a rule
dmitry.erkin Jan 11, 2013 2:47 PM (in response to swiderski.maciej)Hello!
+1 Maciej
+1 doboss
Your answers are very helpful!
One question left is that kcontext.getProcessInstance() returns a reference to Interface ProcessInstance not to Interface WorkflowProcessInstance.
Is it safe to cast ProcessInstance to WorkflowProcessInstance? How to set a jar where WorkflowProcessInstance is located on Guvnor path?
Regards,
Dmitry Erkin
-
8. Re: Can not fire a rule
doboss Jan 11, 2013 2:51 PM (in response to dmitry.erkin)I don't know about the casting, but I don't think the jar needs to be in the Guvnor path, as the Guvnor is just a repository. I think you want to make sure the jar is in the path of the application running the process...
-
9. Re: Can not fire a rule
dmitry.erkin Jan 11, 2013 3:11 PM (in response to doboss)It says: "Process Compilation error WorkflowProcessInstance cannot be resolved to a type" when I try to build a package in Guvnor.
the import is set up:
<extensionElements>
<tns:import name="defaultPackage.Person" />
<tns:import name="org.drools.runtime.process.WorkflowProcessInstance" />
</extensionElements>
this cast is used: "((WorkflowProcessInstance)kcontext.getProcessInstance())"
so probably I need to set up Guvnor path
-
10. Re: Can not fire a rule
swiderski.maciej Jan 12, 2013 4:32 AM (in response to dmitry.erkin)I am not sure you need casting there, but if Guvnor complains when building the package you could try to declare FQN in the case rather than use import.
HTH
-
11. Re: Can not fire a rule
dmitry.erkin Jan 12, 2013 8:09 AM (in response to swiderski.maciej)Thank you very much Maciej