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.
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.
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?
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:
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-520
21: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-520
So I am in doubt is an instance created or not?
1 of 1 people found this helpful
Not 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.
1 of 1 people found this helpful
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);
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?
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...
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:
<tns:import name="defaultPackage.Person" />
<tns:import name="org.drools.runtime.process.WorkflowProcessInstance" />
this cast is used: "((WorkflowProcessInstance)kcontext.getProcessInstance())"
so probably I need to set up Guvnor path
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.
Thank you very much Maciej