Discussion:
[jboss-user] [jBPM] - Restore JBPM session
new bee
2012-07-26 09:54:52 UTC
Permalink
new bee [https://community.jboss.org/people/newbird] created the discussion

"Restore JBPM session"

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

--------------------------------------------------------------
Hi,
I am new to JBPM and struggling to understand the flow.............

I red that we can store jbpm session,process instance,task instance and variables...etc...............

After some point, assume application crashes and want to restore all running sessions how would i do?

Do i need to get each process id/session id from the session and again start it?
If i do in the above way, from which point it will start the session like it already proesses two nodes....How it will know to start from node3? Do i need to configure that also. If how would i?

Also red in discussions that after restoring the session, we need to again register action handlers? Is it true?




What is the use task server ,task service and task client? How they are different from workitem handler?

Please reply............................................. :-/
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
ravichandrankg
2012-08-09 21:45:24 UTC
Permalink
ravichandrankg [https://community.jboss.org/people/ravichandrankg] created the discussion

"Re: Restore JBPM session"

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

--------------------------------------------------------------
I am also very much interested the answers for new bee's questions. Please reply for the clear understanding of JBPM5.
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Thomas Setiabudi
2012-08-10 02:55:50 UTC
Permalink
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion

"Re: Restore JBPM session"

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

--------------------------------------------------------------
Hi,

What database do you use for the JBPM?

If you changed the default H2 Database to some other DB like MySQL or SQL Server, all the process instances data will be stored in the DB. so in the event of application crash, when you restart the application, the process instances data is still there in the Database.


Regards,
Thomas Setiabudi
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
new bee
2012-08-10 04:21:02 UTC
Permalink
new bee [https://community.jboss.org/people/newbird] created the discussion

"Re: Restore JBPM session"

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

--------------------------------------------------------------
I am aware that it will store process instance info in database........
But my question is, how it will restart incomplete processes? Where do we need to give configuration?
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Thomas Setiabudi
2012-08-10 05:19:15 UTC
Permalink
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion

"Re: Restore JBPM session"

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

--------------------------------------------------------------
I think the process should continue from before application crash point.

Lets take the com.sample.evaluation included in the jbpm5.3 full installer.

First step, we initiate the process instance lets say we pass in krisv as the employee name
Second step, krisv look at his task list and then complete his task
Third step, john look at his task list and then complete his task
Fourth step, Mary look at her task list, but when she tries to complete her task, application crash.

so we stop everything and restart

After restart, Mary should be able to see the task in the task list and complete it.

Isn't that the default behavior right now? Or do I misunderstand your question?

Regards,
Thomas Setiabudi
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
new bee
2012-08-10 17:00:11 UTC
Permalink
new bee [https://community.jboss.org/people/newbird] created the discussion

"Re: Restore JBPM session"

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

--------------------------------------------------------------
Hi Thomas,
I am very thankful for your time.
You are giving the ideal behavior of workflow....
My question is, how it will know the restart point(The node where to start process again)........If it stores in database,what is the schema structure?


What if i don't want to restart incomplete processes...What shall i do?

As i told u, i am new one trying to understand work flow......Please help me in this aspect....
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Thomas Setiabudi
2012-08-13 01:12:18 UTC
Permalink
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion

"Re: Restore JBPM session"

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

--------------------------------------------------------------
Hi new bee,

Have you tried to change the default H2 Database to some other Database like MySQL or SQL Server?
If you want to know the Database Schema structure, it is a good idea to do that since you will be able to see all the tables.

If you do not want to restart incomplete process, you can terminate the process and then start a new instance of the process.


Regards,
Thomas Setiabudi
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
suprit chaudhary
2012-08-13 09:27:56 UTC
Permalink
suprit chaudhary [https://community.jboss.org/people/supritchaudhary] created the discussion

"Re: Restore JBPM session"

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

--------------------------------------------------------------
Hi new bee,

JBPM do not provide automatic restore of process and session on server restart :-(
You have write your own management code for this service.
You will need to read process id of pending complete workItem and restart the process yourself.
Never process can only be started once. If process was in progress when server restarted then you can not start process again.
Yo can find out the last workItem and complete it by this code
*ksession.getWorkItemManager().completeWorkItem(workItemId, null);*
Once the workItem is complete the flow will process to next workItem.

Study this to restore session:

/eclipse-javadoc:☂=MorphoCSBPMWS/D:\/JBMPWorkspace\/MorphoCSBPMWS\/WebRoot\/WEB-INF\/lib\/knowledge-api-5.4.0.Final.jar<org.drools.persistence.jpa(JPAKnowledgeService.class☃JPAKnowledgeService~loadStatefulKnowledgeSession~I~Lorg.drools.KnowledgeBase;~Lorg.drools.runtime.KnowledgeSessionConfiguration;~Lorg.drools.runtime.Environment;☂StatefulKnowledgeSession StatefulKnowledgeSession org.drools.persistence.jpa. /eclipse-javadoc:☂=MorphoCSBPMWS/D:\/JBMPWorkspace\/MorphoCSBPMWS\/WebRoot\/WEB-INF\/lib\/knowledge-api-5.4.0.Final.jar<org.drools.persistence.jpa(JPAKnowledgeService.class☃JPAKnowledgeService JPAKnowledgeService.loadStatefulKnowledgeSession(int id, /eclipse-javadoc:☂=MorphoCSBPMWS/D:\/JBMPWorkspace\/MorphoCSBPMWS\/WebRoot\/WEB-INF\/lib\/knowledge-api-5.4.0.Final.jar<org.drools.persistence.jpa(JPAKnowledgeService.class☃JPAKnowledgeService~loadStatefulKnowledgeSession~I~Lorg.drools.KnowledgeBase;~Lorg.drools.runtime.KnowledgeSessionConfiguration;~Lorg.drools.runtime.Environment;☂KnowledgeBase KnowledgeBase kbase, /eclipse-javadoc:☂=MorphoCSBPMWS/D:\/JBMPWorkspace\/MorphoCSBPMWS\/WebRoot\/WEB-INF\/lib\/knowledge-api-5.4.0.Final.jar<org.drools.persistence.jpa(JPAKnowledgeService.class☃JPAKnowledgeService~loadStatefulKnowledgeSession~I~Lorg.drools.KnowledgeBase;~Lorg.drools.runtime.KnowledgeSessionConfiguration;~Lorg.drools.runtime.Environment;☂KnowledgeSessionConfiguration KnowledgeSessionConfiguration configuration, /eclipse-javadoc:☂=MorphoCSBPMWS/D:\/JBMPWorkspace\/MorphoCSBPMWS\/WebRoot\/WEB-INF\/lib\/knowledge-api-5.4.0.Final.jar<org.drools.persistence.jpa(JPAKnowledgeService.class☃JPAKnowledgeService~loadStatefulKnowledgeSession~I~Lorg.drools.KnowledgeBase;~Lorg.drools.runtime.KnowledgeSessionConfiguration;~Lorg.drools.runtime.Environment;☂Environment Environment environment)
--------------------------------------------------------------

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

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

"Re: Restore JBPM session"

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

--------------------------------------------------------------
What are best practices for storing SessionID?

I am using Spring and my KnowledgeSession is defined as follows:

|   | <jbpm:ksession id="ksession" type="stateful" kbase="kbase" > |
| |
| <jbpm:configuration> |
|
|       | <jbpm:jpa-persistence> |
|
|     |     <jbpm:transaction-manager ref="txManager"/> |
|
|         | <jbpm:entity-manager-factory ref="myEmf"/> |
|
|
|     </jbpm:jpa-persistence> |
|    | </jbpm:configuration> |
| | </jbpm:ksession> |


When I restart server, new SessionID is generated and I am able to retreive User tasks with this new SessionID.

Is this appropriate way to restore session, or some other mechanism (custom Session Managment) must be employed?
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Seyed Mohammad Hosein Jamali
2012-09-27 08:45:35 UTC
Permalink
Seyed Mohammad Hosein Jamali [https://community.jboss.org/people/hosein] created the discussion

"Re: Restore JBPM session"

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

--------------------------------------------------------------
Hi new bee
I had similar problem so that after an application server crash I couldn't resume my processes unless I start a new process ! for start a new process I need to initialize a new StatefulKnowledgeSession. so after such initialization I can resume my old processes.

Hope this helps
S.M.H.Jamali
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Rodolfo Mendiola
2013-01-28 15:57:30 UTC
Permalink
Rodolfo Mendiola [https://community.jboss.org/people/rodmendiola] created the discussion

"Re: Restore JBPM session"

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

--------------------------------------------------------------
we have a singleton service holding a single session for workflows, everytime the server stopps a new session is created, I am not sure if this is the best approach, but it is working well for us, the only issue is that the DB gets populated with sessions that are not used anymore.

We have human tasks in the processes and as they are also persisted, after a server stop (or node "change" in a cluster) jbpm is able resume the workflow after completing the task.
The problem of resuming the process has been submitted as jira here:
https://issues.jboss.org/browse/JBPM-3673 https://issues.jboss.org/browse/JBPM-3673
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Laura delli Paoli
2013-06-07 17:00:34 UTC
Permalink
Laura delli Paoli [https://community.jboss.org/people/lauradp] created the discussion

"Re: Restore JBPM session"

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

--------------------------------------------------------------
sorry, can you descibe in a simpler way the workaround described?

thaks
Laura
--------------------------------------------------------------

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

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