Discussion:
[jboss-user] [jBPM] - Re: Can not fire a rule
Maciej Swiderski
2013-01-09 12:26:17 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Can not fire a rule"

To view the discussion, visit: https://community.jboss.org/message/789701#789701

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/789701#789701]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Dmitry Erkin
2013-01-10 13:24:51 UTC
Permalink
Dmitry Erkin [https://community.jboss.org/people/dmitry.erkin] created the discussion

"Re: Can not fire a rule"

To view the discussion, visit: https://community.jboss.org/message/790099#790099

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790099#790099]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-01-10 14:24:35 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Can not fire a rule"

To view the discussion, visit: https://community.jboss.org/message/790114#790114

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790114#790114]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Dmitry Erkin
2013-01-10 17:01:07 UTC
Permalink
Dmitry Erkin [https://community.jboss.org/people/dmitry.erkin] created the discussion

"Re: Can not fire a rule"

To view the discussion, visit: https://community.jboss.org/message/790156#790156

--------------------------------------------------------------
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 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


But there are not other messages in server.log while I start an instance except those:

20:54:51,442 INFO  [stdout] (http-localhost-127.0.0.1-8080-24) =============== session-guest-34

20:55:01,442 WARN  [org.drools.guvnor.server.repository.RulesRepositoryManager] (http-localhost-127.0.0.1-8080-24) Creating RulesRepository with default username.
20:55:01,462 INFO  [stdout] (http-localhost-127.0.0.1-8080-24) =============== session-guest-35

20:55:01,462 INFO  [stdout] (http-localhost-127.0.0.1-8080-24) =============== session-guest-35

20:55:11,473 WARN  [org.drools.guvnor.server.repository.RulesRepositoryManager] (http-localhost-127.0.0.1-8080-24) Creating RulesRepository with default username.
20:55:11,483 INFO  [stdout] (http-localhost-127.0.0.1-8080-24) =============== session-guest-36

20:55:11,493 INFO  [stdout] (http-localhost-127.0.0.1-8080-24) =============== session-guest-36

20:55:21,503 WARN  [org.drools.guvnor.server.repository.RulesRepositoryManager] (http-localhost-127.0.0.1-8080-24) Creating RulesRepository with default username.
20:55:21,523 INFO  [stdout] (http-localhost-127.0.0.1-8080-24) =============== session-guest-37

20:55:21,533 INFO  [stdout] (http-localhost-127.0.0.1-8080-24) =============== session-guest-37

20:55:31,536 WARN  [org.drools.guvnor.server.repository.RulesRepositoryManager] (http-localhost-127.0.0.1-8080-24) Creating RulesRepository with default username.
20:55:31,536 INFO  [stdout] (http-localhost-127.0.0.1-8080-24) =============== session-guest-38

20:55:31,546 INFO  [stdout] (http-localhost-127.0.0.1-8080-24) =============== session-guest-38

20:55:41,546 WARN  [org.drools.guvnor.server.repository.RulesRepositoryManager] (http-localhost-127.0.0.1-8080-22) Creating RulesRepository with default username.
20:55:41,566 INFO  [stdout] (http-localhost-127.0.0.1-8080-22) =============== session-guest-39

20:55:41,566 INFO  [stdout] (http-localhost-127.0.0.1-8080-22) =============== session-guest-39

20:55:51,583 WARN  [org.drools.guvnor.server.repository.RulesRepositoryManager] (http-localhost-127.0.0.1-8080-9) Creating RulesRepository with default username.
20:55:51,593 INFO  [stdout] (http-localhost-127.0.0.1-8080-9) =============== session-guest-40

20:55:51,603 INFO  [stdout] (http-localhost-127.0.0.1-8080-9) =============== session-guest-40

20:56:01,631 WARN  [org.drools.guvnor.server.repository.RulesRepositoryManager] (http-localhost-127.0.0.1-8080-9) Creating RulesRepository with default username.


So I am in doubt is an instance created or not?


Regards,
Dmitry Erkin
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790156#790156]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
doboss
2013-01-10 19:03:02 UTC
Permalink
doboss [https://community.jboss.org/people/doboss] created the discussion

"Re: Can not fire a rule"

To view the discussion, visit: https://community.jboss.org/message/790186#790186

--------------------------------------------------------------
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.

HTH.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790186#790186]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-01-11 12:01:05 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Can not fire a rule"

To view the discussion, visit: https://community.jboss.org/message/790400#790400

--------------------------------------------------------------
+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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790400#790400]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Dmitry Erkin
2013-01-11 19:47:12 UTC
Permalink
Dmitry Erkin [https://community.jboss.org/people/dmitry.erkin] created the discussion

"Re: Can not fire a rule"

To view the discussion, visit: https://community.jboss.org/message/790505#790505

--------------------------------------------------------------
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 jar where WorkflowProcessInstance is located on Guvnor path?

Regards,
Dmitry Erkin
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790505#790505]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
doboss
2013-01-11 19:51:14 UTC
Permalink
doboss [https://community.jboss.org/people/doboss] created the discussion

"Re: Can not fire a rule"

To view the discussion, visit: https://community.jboss.org/message/790508#790508

--------------------------------------------------------------
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...
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790508#790508]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Dmitry Erkin
2013-01-11 20:11:59 UTC
Permalink
Dmitry Erkin [https://community.jboss.org/people/dmitry.erkin] created the discussion

"Re: Can not fire a rule"

To view the discussion, visit: https://community.jboss.org/message/790509#790509

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790509#790509]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-01-12 09:32:26 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Can not fire a rule"

To view the discussion, visit: https://community.jboss.org/message/790585#790585

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790585#790585]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Dmitry Erkin
2013-01-12 13:09:41 UTC
Permalink
Dmitry Erkin [https://community.jboss.org/people/dmitry.erkin] created the discussion

"Re: Can not fire a rule"

To view the discussion, visit: https://community.jboss.org/message/790616#790616

--------------------------------------------------------------
Thank you very much Maciej
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/790616#790616]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...