Author |
Message
|
ucbus1 |
Posted: Tue May 06, 2003 1:36 pm Post subject: upes question 2 |
|
|
Knight
Joined: 30 Jan 2002 Posts: 560
|
I have put this as upes question 2 as it is some what related to my earlier posting "upes question".
I have one work instance stuck in upes activity. There is no work item. (Thanks to jamac for clarifying that workflow does not generate a workitem for upes activities for the sake of optimization). When I click on monitor instance activity , I see couple of buttons which says "force restart" "force finish" etc.... Now since it is stuck, i wanted to force restart. When I clicked on force restart, I got pop-up with all the container values and a button to force restart. I have cliked on that and thought that it would "force restart" . But it did not.
Then I have signed on to my "fat client" configuration and located the work instance. But I could not find an option to restart the instance. Then I have looked in the "work item" list I could locate my work item. Not I could not find the work item on web client. Then I have options "start" "terminate" etc. and I started the work item and it got processed.
Now here are my questions
1.When I could not find work item on out-of-box web client , how come I could find the same on fat cleint
2. When I clicked on web-client force restart instance button, why it did not restart?
3. The options I found on web-client and fat-client are quite different. Is it normal or Have we screwed up any thing?
Please let me know
Thanks |
|
Back to top |
|
 |
jmac |
Posted: Tue May 06, 2003 3:59 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Ucbus:
From the Fat client you now do a Start.
The problem is that without the workitem you need the Thin client to issue the ActivityInstance ForceRestart(), then you need the Fat client to issue the Start on the activity.
Quote: |
1.When I could not find work item on out-of-box web client , how come I could find the same on fat cleint |
There was NO workitem until you ForceFinshed the Activity Instance.
Quote: |
2. When I clicked on web-client force restart instance button, why it did not restart? |
Because an activity will only AUTOMATIC start the first time it is activated.
Quote: |
3. The options I found on web-client and fat-client are quite different. Is it normal or Have we screwed up any thing. |
No this is normal _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
Ratan |
Posted: Tue May 06, 2003 4:49 pm Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
There is an excellant state diagram showing the different states a workitem can endup in for each call in Workflow "Programming Guide" v332 Figure 25 page 660.
I keep that diagram before me all the time.
-Ratan. |
|
Back to top |
|
 |
jmac |
Posted: Tue May 06, 2003 5:04 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Ratan wrote: |
I keep that diagram before me all the time. |
So do I.... Our secret is now out  _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
ucbus1 |
Posted: Wed May 07, 2003 5:29 am Post subject: |
|
|
Knight
Joined: 30 Jan 2002 Posts: 560
|
Thank you Jmac for the information and Thanks Ratan for the useful information. now I know where to look for answers.
Jmac,
I have the following question.
Quote: |
The problem is that without the workitem you need the Thin client to issue the ActivityInstance ForceRestart(), then you need the Fat client to issue the Start on the activity.
Quote:
1.When I could not find work item on out-of-box web client , how come I could find the same on fat cleint
There was NO workitem until you ForceFinshed the Activity Instance.
|
You mentioned that "There was NO workitem until you ForceFinshed the Activity Instance." Do you mean "ForceReStarted"?
Also does this mean I need to have both web client as well as fat client available on my machine to achieve it? Can web-cleint ( when you say thin client, i suppose you were refreeing to web client) be used to "force restart instance" and "start" work item? Could you please eloborate
Thanks |
|
Back to top |
|
 |
ucbus1 |
Posted: Wed May 07, 2003 5:34 am Post subject: |
|
|
Knight
Joined: 30 Jan 2002 Posts: 560
|
|
Back to top |
|
 |
jmac |
Posted: Wed May 07, 2003 5:48 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Quote: |
" Do you mean "ForceReStarted"? |
Yes, my mistake. ForceRestart creates the workitem
As to needing both clients, the answer is no, you could write a little utility that would do this for you. But without writting any code its the only way I know of.[/quote] _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
ucbus1 |
Posted: Wed May 07, 2003 5:57 am Post subject: |
|
|
Knight
Joined: 30 Jan 2002 Posts: 560
|
Thanks JMac,
I guessed it so.. but wanted to confirm.
Is the utility, if it is not too much to ask available anywhere? If not, I woul like to develop one for our application. however, I appreciate if you can please let me knowsome tips how I need to proceed about it
Thanks |
|
Back to top |
|
 |
Ratan |
Posted: Wed May 07, 2003 11:38 am Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
If you wrote the Program we discussed on your "UPES Question" thread, you already have the utility. All you will need to do is include a workitem.start() call, if you are not looking for a commercial grade utility. You can have some command line parameters like the 'Process Name', etc.. to be able to identify the activity to forcerestart.
-Ratan. |
|
Back to top |
|
 |
slnelson76 |
Posted: Wed May 07, 2003 12:55 pm Post subject: |
|
|
Novice
Joined: 02 Apr 2003 Posts: 13 Location: Iowa
|
This can Definitely be a pain in the butt. We run between 40 and 70 thousand short-lived processes through one of our UPES activities per day. If those start failing (one of the services is broken) we can get hundreds of stuck instances stuck in the running state. Fortunately we have put some logic that detects problems like this and keeps the instance from getting messed up. But before that we got approximately 120 thousand instances stuck in the running state. Not something you want to do one at a time. I had to write a little utility to restart them.
Please note this is a hacked together copy of my full utility and may not work out of the box. But in theory it works REALLY well.
Code: |
Agent agent = new Agent();
agent.setConfigurationID(ConfigurationID);
agent.setName(Name);
execSer = agent.locate(Group,wfSystem);
execSer.logon2(Username,Password, SessionMode.DEFAULT, AbsenceIndicator.NOT_SET);
ProcessInstance[] pis = null;
int nCount = 1;
pis = execSer.queryProcessInstances(null,"NAME ASC",new Integer(500));
while(pis.length > 0){
int nIndex;
for(nIndex = 0;nIndex < pis.length;nIndex++)
{
ActivityInstance [] ais = null;
try{
ais = pInst.obtainProcessMonitor(true).activityInstances();
}catch(FmcException fmce)
{
fmce.printStackTrace();
return;
}
for(int nAIndex = 0;nAIndex < ais.length;nAIndex++)
{
try{
if(ais[nAIndex].state().equals(com.ibm.workflow.api.ActivityInstancePackage.ExecutionState.RUNNING))
{
if(activityName == null || (activityName.length() > 0 && ais[nAIndex].name().equalsIgnoreCase(activityName)))
{
nRestartCount++;
ais[nAIndex].forceRestart();
}
}
}catch(FmcException fmce)
{
fmce.printStackTrace();
}
}
nCount++;
}
pis = execSer.queryProcessInstances("NAME > '" +pis[nIndex - 1].name() ,"NAME ASC",new Integer(500));
System.out.println("Process Instance List Built....");
}
String Filter = "STATE=READY AND NAME='" + activityName + "'";
WorkItem[] wis = execSer.queryWorkItems(Filter, "NAME ASC", new Integer(100));
while(wis.length > 0)
{
for (int k=0; k< wis.length; k++){
try{
wis[k].start();
nWorkItemCount++;
}catch(Exception e){}
}
wis = execSer.queryWorkItems(Filter, "NAME ASC", new Integer(100));
}
execSer.logoff();
|
|
|
Back to top |
|
 |
ucbus1 |
Posted: Fri May 09, 2003 4:43 am Post subject: |
|
|
Knight
Joined: 30 Jan 2002 Posts: 560
|
Thank you all for the directions. Your suggestions are very helpful |
|
Back to top |
|
 |
|