cancel
Showing results for 
Search instead for 
Did you mean: 

How kill a active process instance?

rodolfobarbeiro
Champ in-the-making
Champ in-the-making
I am using a userTask as "waitTask" so I can retrieve the variables at runtime.

But I observed that the process instances are active in the database.

How do I terminate the process instance so I retrieve the variables?

All BPMN files have the following script:


    …
  
    <userTask name="WaitState" id="waitState"/>

    <sequenceFlow sourceRef="waitState" targetRef="theEnd"/>
      
    <endEvent id="theEnd" />
   
</process>


Sorry for my English!
7 REPLIES 7

trademak
Star Contributor
Star Contributor
Hi,

What do you mean with "active" in the database.
The process instance state is just stored there and when the instance leaves the wait state it's retrieved again from the database.
So there's nothing "active" going on at the point.

Best regards,

rodolfobarbeiro
Champ in-the-making
Champ in-the-making
I refer to instances "active" in the database.

See the image below:

[img]http://i54.tinypic.com/1yqo94.png[/img]

trademak
Star Contributor
Star Contributor
I know, but these are just instances that are stored in the database.
So there's nothing running on the Activiti Engine.
The process instance will be active again when the wait state is triggered.

Best regards,

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Tijs is right and besides, why do you want to terminate it to retrieve the variables?

rodolfobarbeiro
Champ in-the-making
Champ in-the-making
Hello Ronald!

No, I do not want to retrieve the variables. Because at this point I've regained the variables.

I use the task "waitTask" just to retrieve the variables. After retrieving it, I want to finish the process.

I want the process instance go to the history.


How do I do this?

trademak
Star Contributor
Star Contributor
Hi,

You can use the signal method on the RuntimeService to trigger the process to complete the wait task and then (if there are no other wait tasks in your process) finish the process instance.
The process instance will then only be available in the history tables.

Best regards,

rodolfobarbeiro
Champ in-the-making
Champ in-the-making
Trademark!

Thank you for your help!

That's what I needed to know…


Best regards!

Rodolfo Barbeiro