[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-26 Thread lblaauw
Hi Ronald,

Just got back from some absence off work... anywayz...

kukeltje wrote : Just some wild guesses..
  | - different (customized?) hibernate config?
  | Nope plain config really.
  | 
  | - Older and upgraded database model? e.g. one initially for 3.1? 
just ran the setup sql script from 3.2.3...

Weirdness all around, cant find anything usefull in the jboss logs either..

Oh well,

For now I got other stuff to worry about so I will leave it with the handler 
running...

Thanks and greetz,

Leo

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4172477#4172477

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4172477
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-20 Thread kukeltje
Just some wild guesses..
- different (customized?) hibernate config?
- Older and upgraded database model? e.g. one initially for 3.1? 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4171473#4171473

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4171473
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-18 Thread mputz
anonymous wrote : The case i have is that Comment objects are attached to 
tokens in the process instance. 

I just tested GraphSession.deleteProcessInstance on a process with related 
comments, and they were deleted just fine. This was with jBPM 3.2.3.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4171063#4171063

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4171063
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-18 Thread kukeltje
Same here. Works as expected

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4171066#4171066

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4171066
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-18 Thread lblaauw
Hmm

Thats weird, we also use 3.2.3 here on a jboss server 4.2GA release and a mysql 
database 5.x 

No idea why the cascades dont work then on our installations

Regards,
Leo


mputz wrote : anonymous wrote : The case i have is that Comment objects are 
attached to tokens in the process instance. 
  | 
  | I just tested GraphSession.deleteProcessInstance on a process with related 
comments, and they were deleted just fine. This was with jBPM 3.2.3.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4171105#4171105

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4171105
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-15 Thread kukeltje
yes it will cascade

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170710#4170710

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170710
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-15 Thread lblaauw
Hey,

I just wrote a handler to get rid of all the process instance data including 
the cascades. The actual delete is kinda tricky in a sense that since all 
collections and object properties are lazily initialized it requieres you to 
load them up in a custom command object to get the actual data, then run 
through them, clear them and only then will a delete on process instance 
throught the jbpmContext work correctly with all cascades.

Greetz,
Leo


twiceknightly wrote : related to this topic I have been thinking about how to 
totally get rid of a process instance from a db.  Obviously there will be a lot 
of stuff hanging around.  If I were to perform a hibernate delete on the 
process instance would it cascade and delete everything associated with the 
process instance?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170712#4170712

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170712
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-15 Thread mputz
anonymous wrote : The actual delete is kinda tricky...

Why not simply use org.jbpm.db.GraphSession#deleteProcessInstance(long 
processInstanceId) ?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170714#4170714

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170714
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-15 Thread lblaauw
That wont work since you will have a non complete processinstance at your hands 
caused by all lazy loading on the process instance...

Regards,
Leo

mputz wrote : anonymous wrote : The actual delete is kinda tricky...
  | 
  | Why not simply use org.jbpm.db.GraphSession#deleteProcessInstance(long 
processInstanceId) ?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170718#4170718

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170718
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-15 Thread twiceknightly
lblaauw wrote : Hey,
  | 
  | I just wrote a handler to get rid of all the process instance data 
including the cascades. 

Care to share what you did?  I'm sure a fair few people would appreciate it.  
It seems an big ommission if the one out of the box doesn't clean up properly

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170733#4170733

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170733
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-15 Thread mputz
Leo, the GraphSession.deleteProcessInstance method *should* handle all 
references correctly, and should thus get rid of all data related to a process 
instance. If it does not, it would be great if you could provide more info 
about what is missed out, so that this can be fixed.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170735#4170735

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170735
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-15 Thread lblaauw
Sure,

I dont claim this to be perfect but hey it works, so here is the code for the 
handler:

  | public class VerwijderProcessInstanceHandler extends JbpmHandlerProxy{
  |  private static final long serialVersionUID = -6125309218094541298L;
  |  /** Logger available to subclasses */
  |  protected final Log logger = LogFactory.getLog(getClass());
  |  
  |  @SuppressWarnings(unchecked)
  |  @Override
  |  public void execute(ExecutionContext executionContext) throws Exception {
  |   try {
  | logger.debug(executing VerwijderProcessInstanceHandler...);
  | ProcessInstance pi = executionContext.getProcessInstance();
  | logger.debug(ProcessInstance is null?  + (pi==null));
  | ListToken allTokens = pi.findAllTokens();
  | logger.debug(allTokens of processInstance:  + allTokens.size());
  | 
  | //clear taskinstances from comments
  |CollectionTaskInstance taskInstances = 
pi.getTaskMgmtInstance().getTaskInstances();
  |   for(TaskInstance ti : taskInstances){
  | ti.getComments().clear();
  | executionContext.getJbpmContext().save(ti);
  |   }
  | 
  |   //clear tokens from comments..
  |   if(allTokens.size()  0){
  | for(Token t : allTokens){
  |   //get all comments per token...
  |   if(!t.getComments().isEmpty()){
  | logger.debug(cleared comments before deleting?  + 
t.getComments().isEmpty());
  | 
  |  for(Object o : t.getComments()){
  |   Comment c = (Comment)o;
  |   c.setTaskInstance(null); 
  |  }
  |  
  |  //clearing comments on taskinsantce manually... pfff
  |  t.getComments().clear();
  |}
  | 
  |   executionContext.getJbpmContext().save(t);
  |   logger.debug(t.getComments().size():  + t.getComments().size());
  | }
  |   }
  |   
  |   //saving without comments and taskinstances within comments...
  |   executionContext.getJbpmContext().save(pi);
  | 
  |   
executionContext.getJbpmContext().getGraphSession().deleteProcessInstance(pi, 
true, true);
  |   } catch (Exception e){
  | //Exception upon deleting processinstance..
  | e.printStackTrace();
  | logger.error(e.getMessage());
  |}
  |   }
  | }
  | 

Basically I have this handler configured in a Spring application context and 
then use the spring-jbpm integrationproxy. So I call this handler from within 
my jBPM process on the action like so:


  |   end-state name=end-bevestigRelatieVerzoek
  | event type=node-enter
  |   action name=verwijderProcessInstanceAction 
class='org.springmodules.workflow.jbpm31.JbpmHandlerProxy' config-type=bean
  | targetBeanVerwijderProcessInstanceHandler/targetBean
  |/action
  |  /event
  |   /end-state
  | 

Allthough I strongly agree with you that I expect the jBPM (engine) to cleant 
up all process data after a processinstance finishes and I consider it to be a 
bug that it doesnt ! Coming from working for years with commercial workflow 
engine products the default behaviour I have allways encountered is to purge 
all data from the BPM database upon completion. This ensures a lean and mean 
processing database necesary for speedy processing with large numbers of 
processinstances or cases. If you then need historical data you as a developer 
store that in a seperate database

But maybe some of the core jBPM folks in here could comment on this ?

Greetings and now off to my weekend,

Leo

twiceknightly wrote : lblaauw wrote : Hey,
  |   | 
  |   | I just wrote a handler to get rid of all the process instance data 
including the cascades. 
  | 
  | Care to share what you did?  I'm sure a fair few people would appreciate 
it.  It seems an big ommission if the one out of the box doesn't clean up 
properly

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170764#4170764

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170764
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-15 Thread lblaauw
hey,

Well as you can see from my handler code above that is the only way I could get 
GraphSession.deleteProcessInstance to delete the ProcessInstance and to have 
the cascades work correctly. The case i have is that Comment objects are 
attached to tokens in the process instance. Basically I had to clean out all 
references to the Comments everwhere manually as you can see from my code. 
Without this 'cleanup' code I get exceptions back from hibernate basically 
telling me there are references on Comment instances left so the delete fails.

Regards,
Leo


mputz wrote : Leo, the GraphSession.deleteProcessInstance method *should* 
handle all references correctly, and should thus get rid of all data related to 
a process instance. If it does not, it would be great if you could provide more 
info about what is missed out, so that this can be fixed.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170803#4170803

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170803
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-14 Thread coolex
Aha, ok.
So, the process instance is not deleted after it has been terminated?
Can I restart it, if I know its ID?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170519#4170519

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170519
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-14 Thread kukeltje
look at my last remarks about 'restarting' and yes you need something like the 
id. Restarting from the beginning is *not* automatically done, unless you e.g. 
move the root token to the start node, but behaviour would probably be strange 
in some cases since there are already process variables with values

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170521#4170521

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170521
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-14 Thread twiceknightly
related to this topic I have been thinking about how to totally get rid of a 
process instance from a db.  Obviously there will be a lot of stuff hanging 
around.  If I were to perform a hibernate delete on the process instance would 
it cascade and delete everything associated with the process instance?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170596#4170596

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170596
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: Terminated or deleted process instance?

2008-08-13 Thread kukeltje
anonymous wrote : So, what happens with an ended process instance?
It stops running 

anonymous wrote : Is still available 
There is something in the database yes

anonymous wrote : and able to be restarted again? 
Depends... you can make the end date of the process null, then it is 'running' 
again, but the node it is in will still be the end node... 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170404#4170404

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170404
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user