[JBoss jBPM] - how to find ProcessInstance current state or node
by tprime
Hi,
I have a simple process definition:
| <process-definition xmlns="urn:jbpm.org:jpdl-3.1"
| name="Process1">
| <start-state name="start-process">
| <transition name="to wait state"
| to="wait-state"/>
| </start-state>
| <state name="wait-state">
| <transition name="to run state" to="run-node"/>
| </state>
| <node name="run-node">
| <action class="abc.SomeAction"
| config-type="bean">
| </action>
| <transition name="end-process" to="end-process"/>
| </node>
| <end-state name="end-process"/>
| </process-definition>
|
I have created a number of ProcessInstance for the above definition. Now i need to find out which ProcessInstance are in "wait-state" state and which are in "run-node" node?
I have being popping around in the documentation for a couple of days now, i have the process instance ids. is it possible to get this information by querying the jBPM data model or through API ?
Thanks,
pike
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115483#4115483
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115483
18 years, 3 months
[JBoss jBPM] - Re: reconfigure hobernate.connection.password for jbpm conne
by Johan.Parent
Hi,
I don't know if that's the best way to do this but here is how I did it (just last week in fact).
NOTE: I did this for jbpm3.1 but things may not have changed that much for 3.2.
You need to do 2 things:
1) make your own DbPersistenceServiceFactory
2) patch your jbpm.cfg.xml
Some snippets below (adjust to your package names etc):
In 1 you do the runtime (re)configuration of your credentials. Below I use my own code to get the credentials from somewhere else.
| public class MyDbPersistenceServiceFactory extends org.jbpm.persistence.db.DbPersistenceServiceFactory {
| private static final long serialVersionUID = 1L;
|
| @Override
| public synchronized Configuration getConfiguration() {
| Configuration config = super.getConfiguration();
|
| //
| config.setProperty("hibernate.connection.username", Credentials.getUsername());
| config.setProperty("hibernate.connection.password", Credentials.getPassword());
|
| return config;
| }
|
|
| }
And now 2 tell jbpm to use your factory by making your jbpm.cfg.xml look like this (more or less):
<jbpm-configuration>
|
| <jbpm-context>
| <!--<service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />-->
|
| <service name="persistence">
| <factory>
| <bean class="MyDbPersistenceServiceFactory"/>
| </factory>
| ....
|
Hope this helps,
Johan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115478#4115478
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115478
18 years, 3 months