Grab Activity Hangs in BPM - aqualogic.bpm.modeling(Archived)

In the Process Community, when a user clicks on the grab activity, the grab hangs at the grab instance on the first click. Is there a way to get the instance to move along so that it passes the grab to the next activity?

can you expand on the term "hangs", I tried to understand the issue but I cannot.

Basically the grab instance does not pass to an activity when it is grabbed. 

The grab action moves the instance from where it was to the grab activity. After that you need to route it again to the place you want to.
It's a 2 step process to move the instance from one activity to another. 

Well, I guess the question we are have is, how to pass it along to the next activty.
Our design currently has the grab in a role swimlane. There is nothing we want to do in the grab activty. SO how can I send the instance on its merry way to the next activity. 

at design time, you can define transitions out of the grab activity, these means that from that "grab", you can send the instance to those specific places.
so, with an instance in the grab activity, you can just "route" the instance to the activity you want.
Or, you can just send it back with the back action.
MAriano Benitez
BEA is the 'B' in BPM :) 

Okay, but what I want to know is:
I have essentially a empty grab activty. Its empty because if the tha activty is grabbed, I want to send it back to the previous step from where it was grabbed from. All th functionality is in the previous step, so I don't need or want anything in the grab itself.
That being said, when someone grabs the instance, it is moved to the grab activty. There is only one place I want it to go when it is grabbed(the previous activity). So it is rather annoying to have to grab the activty and then route it to the only place it can go.
So is there anyway to put some code in the grab activty itself that will force it to automatically move the instance to the specific activity? 

Grab activities are interactive in nature, so there is no "automatic" action performed when the instance is grabbed.
You can either create a task with no presentation that just have the following code:
that will send the instance where it was.
Or you can manually "send" the instance back to the previous activity.
Either way, it is user triggered.

I just read through this thread, and I have a follow-up response.
If I have a "defined" Grab - one transition leading TO it, and one transition going AWAY FROM it, then I attach a screenflow to the grab so that the user who grabbed the item can do something, I would like the process to automatically continue along to the next Activity that the outgoing transition leads to.
The documentation reads like that should be the default behavior:
Defined Grab: Once marked complete, instances are sent to the next activity in the process via one of the outgoing transition lines.
But when I test, it performs more like you describe in this discussion thread (Actually 3 step process). It does not go to the next activity in the process via the outgoing transition line. Instead, after I complete the screenflow, for the grab, then I have to "Send" it by checking it off and clicking the send button. So the 3 steps are:
1) Click Grab Icon (to grab the instance)
2) CLick Execute button (to run the screenflow related to the Grab)
3) CLick the Send button
I found that to "mark it complete" so that it will automatically go to the next activity you can set action = RELEASE in the outgoing parameters for the screenflow.
SO now it it 2 steps:
1) Click Grab Icon (to grab the instance)
2) CLick Execute button (to run the screenflow related to the Grab)
Thus, by adding "Action=RELEASE", I am able to alleviate the user from having to click the SEND button.


sub process

I would like to know if there is a way to call a subprocess or a different process from global interactive activity. The requirement is. once the subprocess is called, the user should not be able to execute the parent instance. Only when the instance returns from the sub process, the user should be able to proceed. Please suggest.
Thanks in advance 
Hi Ritu,
Normally, when you invoke a Global Interactive activity it is done as an action taken outside of a process. I'm assuming here that your Global Interactive activity's "Has instance access" Runtime Property is not enabled (checked). If this assumption is incorrect and you want your Global Interactive activity to have instance access, read no further.
You can see the logic needed to create a work item instance in a process if you go to create new process instance
There are a couple byzantine scenarios below and a simple scenario.
1) If you created an instance in the "child" process from the Global Interactive and it represented customer name "ABC", what I think you want to do is to prevent new instances from being created in the "parent" process with the customer name "ABC". There's nothing out of the box to prevent this from occurring, but you could:
a) store the list of customer names that are currently active in the child process in a database table (insert a new row into the table each time your Global Interactive runs)
b) before creating a new instance in the parent add logic that verifies that the customer's name is not stored on the database. If it is on the database, then the instance is not created.
c) as work item instances finish the child process, the row with the customer's name ("ABC" in this example would be deleted and a new instance would be created in the parent process.
2) None of my business, but I think a better scenario would be to allow the Global Interactive to create a new work item instance in the child process and the parent process. This would eliminate the need for the outside database table mentioned above. Although the parent process's instance would be created, you'd just have it go into a Message Wait activity to wait there until it is notified by the child process via a correlation. As the child process is getting ready to complete, it would flow into an Automatic activity that would send a notification (via the correlation). This would cause the parent process's instance to become active and leave the Message Wait activity at the same time that the child's instance reaches the End activity.
3) Perhaps an Ockham's razor thing - know I'm missing something about what it is that you're trying to do, but it seems like the simplest thing would be to create an instance in the parent process -> have it flow into a subflow activity and have it wait for the child to finish before the parent continues on its way.
Hope this helps,
Hi Dan,
Thanx for ur suggestions.
My global interactivity does have instance access.My requirement is such that when i call a global interactivty on an instance(of process 1), it should pass this instance to another process(say process 2) so that the user of process 1 cant perform any actions on that particular instance.Can you suggest other alternatives in case the former is not feasible...
Since the Global Interactive has instance access there'd be a lot of moving parts. I apologize in advance - I have completely obsessed over this.
I put a project out on that you could download and import to Oracle BPM 10g to see what you think.
I obsessed over this a little too much (ok - way too much), but it was an interesting challenge. If you're not comfortable with this, it's completely my fault that I've made it seem too difficult. Not that hard, but it takes a knowledge of Message Wait activities, creating Correlations, sending notifications and creating instances in another process using logic (ok - maybe you should try to talk the customer out of going this route and lean them towards a simple SubFlow activity).
Here's what I did to get this to work if you're curious. If your Global Interactive activity has instance access, you could have checkbox in the UI that is presented when you invoke the Global Interactive. The checkbox would be tied to a Boolean attribute in the instance's BPM Object. I'm calling this attribute "spawnSubprocessAndLockParent" in this scenario. This will act as a flag to tell the Global Interactive to spawn a subprocess and to lock the parent instance if checked.
Here are the steps I did:
In the parent process:
1) created a correlation as the first activity in the process and terminated the correlation in the last activity in the process
2) added the Boolean "spawnSubprocessAndLockParent" attribute to my instance's BPM Object
3) created a presentation with this attribute
4) added this presentation to the Global Interactive's screenflow
5) inside the same screenflow, if the user checks the checkbox it goes to a new Automatic task in the screenflow that uses logic to create an instance in the child process.
6) changed the screenflow for the parent process's activity to detect if the "spawnSubprocessAndLockParent" Boolean variable is true when it enters the Screenflow. If it is false, end users can edit the normal UI presentations and submit in the normal way it does now. If it is true, however, end users can only bring up read only UI presentations and have them exit the Screenflow via an Automatic task that has the logic "action = CANCEL".
7) in the parent process, added a Message Wait activity that has no transitions coming into it or going out of it. Its "Runtime" property setting for "Waits for" need to be set to set to "External" and the "Allows interruptions" property needs to be checked.
8) in the parent process, added an Automatic activity with just this one line of logic: "action = SKIP"
9) added an unconditional transition from the Message Wait activity to the Automatic activity added in step 8
In the spawned child subprocess:
10) in the subprocess spawned in step 5, just before it reaches the End activity add an automatic activity that sends a notification to the parent process's Message Wait activity.
Hope this helps - again sorry for obsessing,
Thanx Dan....
It has been of great help!!!!! :)
The process is working fine. I want to pass some instance variables from the child process while notifying the instance in parent process. Please let me know how to map the arguments in this case. I am trying to map the arguments on the message wait activity but the changes are not reflecting. Please suggest.
Thanks in advance!!
A new version of the process is now on
1. To pass more information back to the parent process, in the child process's Automatic activity that sends the notification I added the additional "orderAmountArg" argument.
params as Any[Any]
params["customerNameArg"] = order.customerName
params["orderAmountArg"] = order.amount
send(Notification, processId : "/ParentProcess", activityName : "MessageWait", arguments : params, argumentSetName : "In")2. Right mouse click the parent's Message Wait activity -> click "Argument Mapping". Note that the "orderAmountArg" passed back from the child process is being mapped back into the "order.amount"
One final note and caution. In this example, I'm using the customer's name as the correlation id. Treat this like you would a primary key in a database table. Don't allow the child process to modify this or the notification you send will not work since the parent process is expecting to be notified using the original customer's name in this example.
Hope this helps,
Hi Daniel
Can you suggest any way to put an instance lying in an empty interactive activity on hold without using conditional transition.
Not sure if it is what you are looking for but in OBPM 10g you have an activity called Timer that sleeps the instance for the time you want.

Question about cancelling instances

Do you know if there is a way that when you cancel an instance in the Enterprise workspace it calls a method? Whath i need to do is update the database I´m using when you cancel certain instance, is this possible??
Not completely sure what you mean by "cancel an Instance". If you mean abort from the Workspace, the instance is sent to the End activity of the process without being able to hit a method along the way. If this is what you're trying to do, create a Global Interactive activity and mark it with "instance access" (don't make it abortable). If you go this route the method in the Global can do the database update before you abort the instance via logic (action = ABORT).
Hope this helps,
Another approach to Dan's could be to enter the code in the end activity, but I have checked that this code only executes if you do not cancel the instance, I do not know if it how it should behave or it is a bug because when you cancel the instance it goes at the end activity and I think the code should be executed as if it goes through the happy path.
To enter code in the end activity right button-->assign arguments and the third option that is advanced opens you an editor to insert code. In this code you can put something like
if(action=action.ABORTED) then
do the insert
Edited by: user10653789 on 16-ene-2009 8:49 
U could send a notification to the process where the instance is at the moment you want to cancel it. From the Message Wait activity have a unconditional transition to an uncoditional activity in which you update the database and then do a action=Action.ABORT.
Make sure to have the property of the Message Wait activity as External. 
You can have a Notification Wait activity in your process with the "Allows Interrupt" property flagged (and "Wait For" must be "External"), and than you can expose this Notification Wait activity as Web Service so that you can send a soap request to interrupt your process and it will executes the automatic activty connected to the Interrupt Notification Wait.
Anyway the DanAtwood suggestion is a good solution if you want to use the BPM Workspace. 
Hello Dan,
your suggestion about using the Global interactive activity has been useful also for me. But I have a question: in my development environment I have some old processes waiting for an external notification. They are very old, due to some "experiment" I did 2 months ago and I don't have the Java client (using PAPI) used to send the notifications anymore.
So I would like to cancel / kill / abort these process instances. I tried to delete every record (on the BPM Engine Data Base) that has the instance id of one of these processes, but on the BPM Workspace the row about this instance is still alive.
Do you know how to kill a process instance using some queries on the Engine Data Base?
Thanks in advance for your suggestions. 
Were you ever able to do this (e.g. cancel/delete instances via database)? Or via some safer method?
One way to get rid of older instances is to undeploy the project. (which often is out of the question) So a work around would be to deploy a fresh copy of the project, and increase the project version number. That will make your project 2.0 (or whatever the next one would be).
After a period of time (based on how long your regular instances last) you can undeploy the previous version, and all the instances associated with that version will be removed.
Hope that works. (Its usually much safer than interrogating the engine or directory databases) 
I don't think we can undeploy the processes because there are still active instances within them. And we have, as yet, been unable to inactivate the instances. These are for 2-3 year old versions of the process and the instances have been "hung up" within the process for a variety of reasons. 
You should be able to undeploy old versions of the project, while keeping the most recent still active.
This will remove the instances that are still hung up in the old revisions.
From the process admin, select projects, then click the 'completely deployed' link for the project. Then select 'undeploy' down at the bottom, and it will allow you to select older versions of the project, and undeploy them. It will warn you that there are still instances in them, but those are the ones you are trying to remove.
Just be sure that version of the project is old enough not to have 'real' live instances in them.
I would suggest my second option, to re-deploy a version of the project, incrementing the version (creating a 2.0) then after you are certain all old 'active' instances are processed, undeploy the old version, and this will remove all the old 'hung up' instances. 
Hi Dan ,
This is not working for using BEA 6.0.2 Vs.
My Requirement is to if i abort any instace the status need to be updated in the database.
I created a Global Interactivty and in the properties marked the "Has instace access" property.And the implementation type is method , In the method checking " if ProcessInstance.action == ABORT then " condition.
And in my workspace i made all the interactivity abortable .So that i can abort the instace.
If i run and abort the instace the Global Interactive method is not getting called and the condition is not checked.
Can u please suggest me the solution.
Thanks in advance
Hi Raj,
This thread has a bunch of different ways that you could go about aborting instances - all would work. There's even a PAPI call you can make to abort them.
Sure you did all this, but if you go the route I mentioned above, double check your process and make sure to:
(1) Do not make your Interactive activities in the process the abortable property (do not check the checkbox "Abortable" for the activity). Doing this will negate what it is that I think you're trying to do since I think you'd prefer to abort the work item instance but update a database before it is aborted.
(2) Create a Global Interactive activity in the process (I'm calling it "Delete this Pup" for this example) and give it the property "Has instance access". My guess is that you don't want everyone to be able to abort instances so be sure to put this Global Interactive in a role that has only the people assigned to it that you want to give this capability to. The Global Interactive and the Interactive activities do not have to be in the same role.
(3) Inside the Global interactive's method, you'd first have the logic where you update the database. Following this you'd have the logic that would abort the instance ("action = ABORT").
(4) At runtime using the Workspace, create several new work item instances.
(5) In the Workspace you should see the "Select action" dropdown - click this now
(6) You should now see "Delete this Pup" as a choice in the dropdown. Once you click this it will invoke the logic inside the Global Interactive for this specific work item instance (updating the database and aborting the work item instance).
Hope this helps,
Hi Dan,
Thanks for your quick reply.
Actually our requirement is if the user aborts the instance from his workspace(by going to the opreations section), we need to update the database for that particular instance.
Please let us know the best way of doing this.
I am not very sure how much this will work but probably you can try
1. Put the interactive activity inside a group
2. raise a business exception as and when user abort the process in workspace
3. Add a Compensate event in the exception flow.
4. Use the DB activities inside the Compensate event.
--Kind Regards
Edited by: user5433257 on 24.03.2009 00:43 
if the user aborts the instance from his workspace(by going to the opreations section), we need to update the database for that particular instance.
Solution :
The ProcessInstance will always hold the status of the process .So in the end activity add the following code to update in the database.
if ProcessInstance.status == ProcessInstanceState.ABORTED then
// write Update or insert stmt here

Reopen Instance

I have an ugly requirment:
One of my Process having 5 level approval process.. 5 interactive activity.. Depending on conditions..Instance can end from any one of the Activity directly. Lets say. somebody done some mistake and submitted it and process ends. What would be the best design/practice to reopen the instance and move it to same stage, so that same user can rework on it . I have all the information about input in my database.
any suggestion ?
Edited by: user10399279 on Mar 31, 2009 1:26 AM
Edited by: user10399279 on Apr 6, 2009 3:11 AM 
Once an instance reaches the end there is not a way (that I know of) to reopen that exact instance. However, you have set yourself up to "recreate" a copy of that instance by saving the data in a database. Essentially, you would create a new process or at least a new activity in the same process. The global (create) would allow you to search for instances saved in your data base that are currently closed and allow you to "reopen" it and put it at a certain point in the process. 
Another way might be to handle the exception and move the instance back to its original activity
There are 3 solutions that I can think of depending on the situation.
You can make an interactive task Repeatable, so the user can edit their input many times, and when they are ready, they can send it forward.
You can also make use of the Grab activity and allow a user to be able to grab the instance from an activity and put it where they want to make edits.
Last situation that I could think of is throwing an exception and handling it accordingly. 
Know I'm probably missing something, but I think Monnie put his finger on the issue. As you've discovered, once a work item instance reaches the End activity there's no way to put it back in the process.
As usual, I think I'm probably guilty of over thinking this. Know you've probably already thought of this, but you might want to consider putting an Automatic and a Notification Wait activity (now called Message Wait in 10g) as the last two activities in the process before the End activity. Instead of the 5 interactive activities flow into the End activity, you could instead have them flow into the Automatic activity which in turn flows to the Notification Wait activity. The Notification Wait would have an unconditional transition to the End and perhaps a Due transition to the End (if you didn't want to let instances sit there forever).
If you wanted to move the instances from the Notification Wait back into the activity that sent it there, you'd probably want to set an instance variable in the Automatic activity with the activity id name of the originating activity (e.g. name the instance variable "originatingActivity" and set it to in an Automatic activity immediately preceding the Notification Wait to ""). As a couple people have mentioned on this thread, since the work item instance has not yet reached the End activity, you could then Grab the instance out of the Notification wait activity and send it back to where it came from using the value you captured from the "originatingActivity" instance variable.
Finally, I have absolutely come to love (good thing my wife doesn't know about this) the way you can automatically Grab and send an instance somewhere else in the process using PAPI to run a Grab automatically. :-)
You could use PAPI to move the instance from the Notification Wait automatcially to the Grab and then automatically moving it to the originating Interactive activity.
Hope this helps,
Thanks Dan /Ad/Ssat/Mon..
Notification wait does't fill my purpose , since i have a target system,which is waiting for the process to end. so that it can pick the request after approval. And also life cycle of the process is very short..App 1 day.
what i am planning to do is : Create a new instance ,since i have all info about the last instance. Pass some additional info as aruments about the target activity name and after initialisation , use a conditional transition to connect the activity.
Is that a good idea ?
Any body used the Correlation ID ?
Edited by: user10399279 on Apr 6, 2009 3:12 AM 
Hi Vin,
If your work item instance has to reach the End activity, there is no way to move it back into the process unless you create a new work item instance with the same variables set as you're describing.
There are typically three objections customers usually have with recreating instances:
1. When you recreate the instance you will lose the audit trail event information that the original instance in the End activity had. I don't know of a work around for this issue.
2. As you mentioned, you will probably want the work item instance to start in a specific activity inside the process (instead of starting in the activity that follows the Begin activity). Normally this would mean that you would need to have the Begin activity have conditional transitions to about every activity in the process. I uploaded an example project that shows how to send the new instance to a specific acitivty inside the process without cluttering the process up with the unnecessary conditional transitions. Download this Oracle BPM 10g project from This process automatically distributes instances into the appropriate activities in the target Oracle BPM process without having to draw transitions from the Begin into each of the individual downstream activities. As new instances are created in the process, if they have anything in the "targetActivity" instance variable they are temporarily sent to the "Queue Waiting for Distribution" activity (otherwise the instance proceeds normally to "Activity A" in the process). The work item instances you're "recreating" would temporarily wind up in this activity's queue. In the process there is a Global Interactive activity that automatically removes all the instances from the queue activity and places them directly into their respective target activities (Activity A, B, C...) based on the value stored in the "targetActivity" variable. The logic in this Global Interactive activity could have been placed in a Global Automatic that could be set to run periodically. If you're curious how this works, look at the logic in this Global Interactive activity (called "Auto handle Distribution of Instances"). Note that it automatically forces all the instances in the queue into a Grab activity and then the logic automatically routes the instances from the Grab into the appropriate activities in the process.
3. You also need to be careful if your new Oracle BPM target process has either the Split or the Multiple (previously Split-N) activities. You will not be able to send a work item instance directly into activities between a Split and its respective Join.
Hope this helps,

Grab - Data Revision

I just want a opinion about the best way to do this.
I'm trying ta make a "revision" activity. The idea is to grab the instance, show (and may change) all variables values on a screenflow, and then put the instance back to the flow.
By now I'm doing this using two grab activities.
The first one is a "From All" Grab linked with the screenflow, followed by an Automatic (save changes), and an "Reallocate" Interactive Activity with User Select Transiction option checked linked with the first one activity on the flow...
The other one is a "From All/To All" grab activity.
The problem is when the instance arrives on "reallocate" I need to send it to the second grab activity, otherwise it will to flow first activity (following the link)
What I want is to choose witch activity in flow to send the instance.
Is there any other way to do that?

Interrupt flow and push it to a subflow

If I have a process which may be sitiing on one of the multiple intercative that I have in the process. I also have a sub-flow in the process. so here is what i intend to do. No matter where I am in the process I want to send interrupt to move the flow to the sub-flow.. Is it possible to just have a Interrupt connect to an "Connector" which is actually connected to a sub-flow. will this ensure that no matter where I am I process will be pushed to the sub-flow that the connector represents.
Any suggestions ? 
Where do you want the work item instance to go after it is pushed to the subflow activity?
If you'd like it to go back to the original Interactive activity that it was sitting in before it was interrupted, you could do this:
1. add a Message Wait and do not connect it any activity in the process yet
2. change it's property to "Eternal" and "Allows Interruptions"
3. add your subflow activity and do not connect it any activity in the process yet
4. add an unconditional transition from the Message Wait to the subflow activity
5. add an Automatic activity
6. add an unconditional transition from the subflow to the Automatic
7. add this logic to the Automatic: "action = BACK"
This is what I want to do.
I want to push the process into a subflow. which will have an interactive behind it. Then once the action is taken on it the process comes out of the subflow and then moved to an automatic in the original flow, sets some status and moves to End.
And I cannot keep the Subflow seperated out. Its part of the original process and the process will flow into it # some point of time.
But here is the thing. If the process recieved a external notification event no matter where the process is currently I want it to move to the SubFlow. 
This part worries me a little:
And I cannot keep the Subflow seperated out. Sure you know this, but the Subflow activity is just an icon that represents a synchronous flow to a subprocess. You can have one Subflow activity symbol invoking a process or you can have two Subflow activity symbols that invoke the same subprocess. We'd all like and should strive for elegantly designed processes and I understand what you're saying, but unless you're willing to have two Subflow activity icons on your process that invoke the same subprocess I don't believe there is a way to make your use case work.
If you can make this concession, then add a Grab activity in your process somewhere near the End activity. Change the Grab's property to be "From all". Add your Subflow activity that invokes your subprocess next to it. Add a transition from the Grab an have it go to the Subflow. Add a transition from the Subflow activity and have it go to the End activity. Put the Grab into a role only a PAPI user would be granted authorization for. Grabs can be invoked from PAPI and PAPI-WS. Since this is the case, you do not have to send the process a notification. Instead programmatically grab the instance and then have it automatically flow to the subprocess.
so let me understand what you are saying here.
1) create a notification wait ( external type) and connect it to a "subflow activity". attach the subflow-activity to the sub-process that I want to send the instance to.
2) attach the "subflow-activity" to a automatic-activity and in the automatic activity put action=BACK.
now my question is once the process finishes the subprocess task and comes out of the subflow. where will this back take me to.coz i don't want to go back to the interactive i was before i interrupted the process but rather continue down the path to the next activity after the subflow-activity and eventually end the process. 
If you change "action = BACK" to "action =SKIP" then it will go to the next Interactive activity and skip the one it originated in.