Author |
Message
|
jmac |
Posted: Tue Apr 22, 2003 2:31 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
You need code like this.
Code: |
// pi is a pointer to the proper ProcessInstance
InstanceMonitor piM = pi.obtainProcessMonitor(false);
ActivityInstance[] ais = piM.activityInstances();
// Now loop thru the ais[] and find the right activityinstance by
// matching the ais[i].name()
// once you have the right one simply issue force restart
ais[i].forceRestart(); |
_________________ John McDonald
RETIRED |
|
Back to top |
|
 |
Ratan |
Posted: Tue Apr 22, 2003 2:44 pm Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
I dont have a code., but just wrote up a fragment of how i t would look like this:
Code: |
Agent agent = new Agent();
agent.setLocator(Agent.LOC_LOCATOR);
agent.setName(AgentName);
service = agent.locate(WFGroup,WFSystem);
service.logon(UserName, password);
ProcessInstance[] PInstances;
ProcessInstance pi;
PInstances = service.queryProcessInstances(FILTER, SORTCRITERIA,null);
//set the filter with NAME, so you will only get the process instance you require.
pi = PInstance[0];
ActivityInstance[] ainstances;
ActivityInstance ai;
InstanceMonitor im = pi.obtainProcessMonitor(boolean value);
ainstances = im.activityInstances();
for(i=0; i<= ainstances.length(); i++)
{ ai = ainstances[i];
if ( ai.fullName().equals("YOUR ACTIVITY NAME")) // replace with your activity name
ai.forceRestart();
}
|
-Ratan |
|
Back to top |
|
 |
ucbus1 |
Posted: Wed Apr 23, 2003 4:50 am Post subject: |
|
|
Knight
Joined: 30 Jan 2002 Posts: 560
|
Thanks Ratan and Jmac.
Just to seek further clarification as this is going to be my first modification. The code you have sent ..Is it going to be a stand alone program or I have to include it in some other existing programs suppiled by MQ Workflow??
Also, it would be great help if any of you come across the reason for "all buttons NOT showing upon my webclient", I appreciate very much |
|
Back to top |
|
 |
jmac |
Posted: Wed Apr 23, 2003 5:33 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Ucbus:
Vennys program will run standalone. His example is more complete than the snip of code I posted. You should be able to just compile and run.
As far as the Buttons not showing up. I would recommend you open a PMR with IBM, since as far as I know there is no reason for this behaviour.
When you get an answer from IBM, please post it here.
THANKS _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
kriersd |
Posted: Wed Apr 23, 2003 6:08 am Post subject: |
|
|
 Master
Joined: 22 Jul 2002 Posts: 209 Location: IA, USA
|
I have a question? When you clicked on the monitor (Movie Cam button) and it displayed your process model. Did you click on the upes activity icon that of which is in the running state. I am using the out of the box web client for version 3.3.0.3 and I can only see the force restart button if I click on the activity within the monitor view. I would guess this to be the same for everyone? _________________ Dave Krier
IBM WebSphere MQ Workflow V3.4 Solution Designer |
|
Back to top |
|
 |
jmac |
Posted: Wed Apr 23, 2003 6:17 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Dave:
Based on a previous post in this thread, I believe that the Activity Instance was displayed, as Ucbus indicated he could see the Input and Ouptut container tabs.
It seems like you are running the same version as Ucbus, so to me this seems to indicate that there might be a problem with the JSP that is being used to display the monitor.
Perhaps you could post the exact size of your Monitor.jsp file and UCBUS could compare and see if he has the latest version. At one point in time, for sure, there was a version that did not have the buttons, since the API (forceRestartwithContainer) is newer than the WebClient. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
Ratan |
Posted: Wed Apr 23, 2003 9:16 am Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
The program will be stand-alone, but you have to complete it (import statements and Java stuff). Also you have to specify values for FILTER, SORTCRITERIA, .... . I am not sure if all those methods are supported with your version on MQWF. Check the API and fix it as needed.
-Ratan. |
|
Back to top |
|
 |
|