|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Update WorkItem |
« View previous topic :: View next topic » |
Author |
Message
|
nMQWF |
Posted: Mon Apr 23, 2007 11:35 pm Post subject: Update WorkItem |
|
|
 Apprentice
Joined: 02 Oct 2005 Posts: 27
|
Is the following code correct...
Do we need to check Out and Check In work items in this manner...
WorkItem[] workItems = null;
ExecutionService executionService = null;
ReadOnlyContainer inContainer = null;
ReadWriteContainer outContainer = null;
executionService.logon();
workItems = executionService.queryWorkItems(strFilter, strSort, iThreshold);
inContainer = workItems[0].inContainer();
outContainer = workItems[0].outContainer();
outContainer.setString(inContainer.getString(""));
outContainer.setString(inContainer.getString(""));
outContainer.setString(inContainer.getString(""));
outContainer.setString(inContainer.getString(""));
outContainer.setString(inContainer.getString(""));
outContainer.setString(inContainer.getString(""));
outContainer.setString(... Some Constant ...);
if(workItems[0].state().value()==ExecutionState._CHECKED_OUT)
{}
else
{
workItems[0].checkOut();
}
workItems[0].checkIn(outContainer, (long)0);
Thanks in Advance |
|
Back to top |
|
 |
hos |
Posted: Tue Apr 24, 2007 5:17 am Post subject: |
|
|
Chevalier
Joined: 03 Feb 2002 Posts: 470
|
Hi,
not sure what you want to achieve.
Checkout and Checkin APIs are intended for client users sitting in front of a terminal, checkout a workitem, check the activitie's input container, doing 'some action' on behalf of the input data and eventually setting the output container and checkin the workitem.
Your code snipped seems to be intented to run without user interaction.
If you just want to set a workitem's / activitie's output container and let MQWF continue the navigation on the process instance, you might consider the finish() or forceFinish() API, where you can provide an output container.
You code snippet is suboptimal because it needs a lot of server calls (see Programming Guide for 'action' calls) to achieve what you want to do. You can get the in- and outContainers directly via the checkout() api. |
|
Back to top |
|
 |
nMQWF |
Posted: Thu Apr 26, 2007 2:00 am Post subject: |
|
|
 Apprentice
Joined: 02 Oct 2005 Posts: 27
|
Hi,
Thanx for the reply.
But I could not get some points.
Let me explain the code more..
The Process template being used has two activities.
Now when the flow is at the first activity which is manual,
the user logs in and forwards it to the next activity.
When doing so, the user might update all or some of the container
members.
The aim of this code is to update the 'Action' container member so that the process flows to the next activity (the Transition condition is Action = 'F' ) and at the same time update some / all of the container members.
Can you explain more as to how the code can be changed to make it perect.
Thanx in Advance |
|
Back to top |
|
 |
hos |
Posted: Thu Apr 26, 2007 11:11 pm Post subject: |
|
|
Chevalier
Joined: 03 Feb 2002 Posts: 470
|
So you do have a user interaction. If I don't miss something, this is exactly the scenario that I described for the usage of checkout() / checkin().
Do not obtain the containers by calling workitem.xxContainer().
You client code should implement the following logic:
Code: |
- queryWorkitems
- workitem.checkout /* ProgramRetrieval = CommonDataOnly =
input and output containers */
- programData.inContainer
- programData.outContainer
- outContainer.setString
- workitem.checkin(outContainer)
|
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|