Discussion:
[jboss-user] [jBPM] - how to delete a process instance
Oleg Bondarenko
2013-08-01 12:54:06 UTC
Permalink
Oleg Bondarenko [https://community.jboss.org/people/obon] created the discussion

"how to delete a process instance"

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

--------------------------------------------------------------
I googled but somehow failed to find a satisfactory answer to that...

Say, I register a ProcessEventListener on my ksession and in afterProcessCompleted I want to delete the process instance, so that it disappears completely from the JBPM DB. What is the way to do it?

TIA
Oleg
--------------------------------------------------------------

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

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

"Re: how to delete a process instance"

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

--------------------------------------------------------------
Maybe you can use stateless ksession?
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Oleg Bondarenko
2013-08-01 15:48:25 UTC
Permalink
Oleg Bondarenko [https://community.jboss.org/people/obon] created the discussion

"Re: how to delete a process instance"

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

--------------------------------------------------------------
Sorry Sergey, but I don't understand, what you mean, can you please elaborate?

Is there some APIs on stateless ksession that would allow to delete a process instance?
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Sergey Kornilov
2013-08-01 16:25:17 UTC
Permalink
Sergey Kornilov [https://community.jboss.org/people/kornilovs] created the discussion

"Re: how to delete a process instance"

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

--------------------------------------------------------------
ksession = kbase.newStatelessKnowledgeSession();

i think it type of session don't save data to db
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Oleg Bondarenko
2013-08-01 16:35:21 UTC
Permalink
Oleg Bondarenko [https://community.jboss.org/people/obon] created the discussion

"Re: how to delete a process instance"

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

--------------------------------------------------------------
ok, I see.

No, it's not an option, we want process instance to be persited to DB.

But we want to delete old process instances...

I just found out, that the completed (or explicitely aborted) process instances do in fact get deleted, that's good!

But still there is a lot of abandoned active instances that just did not run till completion, and they are staying in the DB. What would be the the way to clean them??
--------------------------------------------------------------

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

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

"Re: how to delete a process instance"

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

--------------------------------------------------------------
Hi Oleg,

Why are there abandoned instances?  These should have been completed and the JBPM can remove it. 

You could model your process in such a way that these process get completed (have end nodes) in such cases where currently they are abandoned. 
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Oleg Bondarenko
2013-08-02 08:42:22 UTC
Permalink
Oleg Bondarenko [https://community.jboss.org/people/obon] created the discussion

"Re: how to delete a process instance"

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

--------------------------------------------------------------
Hi Ashish,

My process does have end nodes, and in normal cases the instance ends and gets removed. But sometimes some instance, for whatever reasons, just stays in some human task node forever (unfortunately you cannot force those stupid humans to do their work, you know ;) ). That instance remains then forever in the DB.
--------------------------------------------------------------

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

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