ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » Activity Status

Post new topic  Reply to topic
 Activity Status « View previous topic :: View next topic » 
Author Message
vedbhat
PostPosted: Sun Mar 24, 2002 5:12 pm    Post subject: Reply with quote

Disciple

Joined: 19 Mar 2002
Posts: 186
Location: Singapore

Hi,

Is it possible to retrieve the details of completed activities without launching Monitor window, when the process is still running.

Thanks in Advance

Regards
Ved
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
JImmy
PostPosted: Sun Mar 24, 2002 9:44 pm    Post subject: Reply with quote

Acolyte

Joined: 23 Feb 2002
Posts: 59
Location: Shanghai, China

yes you can, there is a piece of code to show you how to achieve this:
when you logon to MQWF, try

Integer myint = new Integer(40);
// First retrieve the instances
ProcessInstance[] insts = service.queryProcessInstances("NAME LIKE '*'", "NAME", myint);
System.out.println("service.queryWorkItems successfully!");

// Print out the instance names
System.out.println("We have " + insts.length + " instances in runtime:");
for (int i = 0; i < insts.length; i++)
{
System.out.println("Instance #" + (i+1) + ": " + insts[i].name());
InstanceMonitor monitor = insts[i].obtainProcessMonitor(false); // Notice here,
ActivityInstance[] acts = monitor.activityInstances();
System.out.println(" we have " + acts.length + " activities in the instance:");
for (int j = 0; j < acts.length; j++) {
String actName = acts[j].name();
String[] persons = acts[j].staff();
String stat = "" + acts[j].state().value();
System.out.println(" Activity #" + j + ": " + actName);
System.out.println(" Status: " + stat);
System.out.println(" The following persons in the staff: ");
for (int k = 0; k < persons.length; k++) {
System.out.println(" " + persons[k]);
}
}
System.out.println();
}

Hope that can help you.

[ This Message was edited by: JImmy on 2002-03-24 21:44 ]

[ This Message was edited by: JImmy on 2002-03-24 21:45 ]

[ This Message was edited by: JImmy on 2002-03-24 21:47 ]
Back to top
View user's profile Send private message Visit poster's website AIM Address
vedbhat
PostPosted: Sun Mar 24, 2002 9:46 pm    Post subject: Reply with quote

Disciple

Joined: 19 Mar 2002
Posts: 186
Location: Singapore

Hi Jimmy,

Thanks and Will try this one. Hope really it works.

Regards
Ved
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
jmac
PostPosted: Mon Mar 25, 2002 7:39 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

The monitor api will give you what you are looking for, what the above code shows is only for Program Activities. For Process or Block Activities you will need to recurse thru the logic to access the contained activities.


_________________
John McDonald
RETIRED
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vedbhat
PostPosted: Mon Mar 25, 2002 5:10 pm    Post subject: Reply with quote

Disciple

Joined: 19 Mar 2002
Posts: 186
Location: Singapore

Hi John,

Thanks for the reply. I will try to do as you said.

Regards
Ved
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
vedbhat
PostPosted: Tue Mar 26, 2002 5:17 pm    Post subject: Reply with quote

Disciple

Joined: 19 Mar 2002
Posts: 186
Location: Singapore

Hi John/Jimmy,

I have tried to retrieve the details for program activities but ActivityInstanceArray and ControlConnectorArray size is always returned as zero. Can you let me know whether I have overlooked something or it is not possible in Visual Basic. Below is the code that I used for this purpose.

Waiting for your reply.

Regards
Ved

Code
----

Dim eService As ExecutionService
Dim pilArray As ProcessInstanceListArray
Dim pil As ProcessInstanceList
Dim pi As ProcessInstance
Dim Rc, pilSize, piSize, Retcode As Long
Dim aiSize, ccSize As Long
Dim prcMon As InstanceMonitor
Dim aiArray As ActivityInstanceArray
Dim ccArray As ControlConnectorArray
Dim cci As ControlConnectorInstance
Dim ai As ActivityInstance

Rc = eService.QueryProcessInstanceLists
pilSize = eService.ProcessInstanceListArray.GetSize
MsgBox "No of Process Instance Lists: " & pilSize
If (pilSize > 0) Then
Set pil = eService.ProcessInstanceListArray.GetAt(0)
MsgBox "Name of Process Instance List : " & pil.Name

Rc = pil.QueryProcessInstances
piSize = pil.GetSize
MsgBox "Process instances running: " & piSize
If (piSize > 0) Then
Set pi = pil.GetAt(0)
Set prcMon = pi.ObtainMonitor(Retcode, True)
If (Retcode = FMC_OK) Then
MsgBox "Process Instance Name : " & pi.Name
MsgBox "Process Instance Description : " & pi.Description

Set aiArray = prcMon.ActivityInstanceArray
Set ccArray = prcMon.ControlConnectorArray
aiSize = aiArray.GetSize
ccSize = ccArray.GetSize

MsgBox "Activity Instance Size : " & aiSize
MsgBox "Control Connectors Size: " & ccSize

Else
MsgBox "Monitor obtained with errors"
End If
Else
MsgBox "No Process Instance."
End If
Else
MsgBox "No Process Instance List."
End If


Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
jmac
PostPosted: Tue Mar 26, 2002 5:42 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

I've not done this type of processing with VB, but I bet you need to use the ControlConnectorInstances and ActivityInstances as follows:

prcMon.ActivityInstances
Set aiArray = prcMon.ActivityInstanceArray
prcMon.ControlConnectorInstances
Set ccArray = prcMon.ControlConnectorArray
aiSize = aiArray.GetSize
ccSize = ccArray.GetSize

I don't begin to understand this VB api, but based on other objects I've had trouble with I bet this will solve the problem


_________________
John McDonald
SYSCOM Inc.
IBM Certified Solutions Expert -
MQSeries Workflow

[ This Message was edited by: jmac on 2002-03-26 17:44 ]
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vedbhat
PostPosted: Tue Mar 26, 2002 5:50 pm    Post subject: Reply with quote

Disciple

Joined: 19 Mar 2002
Posts: 186
Location: Singapore

Hi John,

I have tried as you mentioned and it works fine.

Thanks and Regards
Ved
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
vedbhat
PostPosted: Mon Apr 01, 2002 1:39 am    Post subject: Reply with quote

Disciple

Joined: 19 Mar 2002
Posts: 186
Location: Singapore

Hi,

I was able to retrieve most of the details except for the values of date/time fields. From an Activity Instance, If I would like to retrieve the StartTime/ Endtime/Last Modification, how could I retrieve the same.

Regards
Ved
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
JImmy
PostPosted: Tue Apr 02, 2002 2:07 am    Post subject: Reply with quote

Acolyte

Joined: 23 Feb 2002
Posts: 59
Location: Shanghai, China

If you just want to retrieve start time, end time, and last modification, I think all of them are described in API document.
Back to top
View user's profile Send private message Visit poster's website AIM Address
vedbhat
PostPosted: Tue Apr 02, 2002 6:30 pm    Post subject: Reply with quote

Disciple

Joined: 19 Mar 2002
Posts: 186
Location: Singapore

Hi,

I had tried as mentioned in the programming guide but couldn't get it working. Did anybody tried it before and got it working. If so, pls let me know.

From what I understood, If one have access to Activity Instance, he/she should be able to retrieve the EndTime/Start Time/Last modification time etc etc for an activity.

I have access to ActivityInstance and I can retrieve all the other parameters except the DateTime fields. Below is the segment of code according to the API document.

Code
--------------------------------
Dim lmTime as DateAndTime
Dim ai as ActivityInstance

.......
ai.LastModifiedTime(lmTime)

--------------------------------
Thanks in Advance

Regards,
Ved

Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
jmac
PostPosted: Wed Apr 03, 2002 5:47 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

Is it possible that these times are not avaialable based on the state of the activity instance?

_________________
John McDonald
RETIRED
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vedbhat
PostPosted: Wed Apr 03, 2002 5:26 pm    Post subject: Reply with quote

Disciple

Joined: 19 Mar 2002
Posts: 186
Location: Singapore

Hi John,

I guess for the completed activities, I think one should be able to retrieve these values because if one opens the monitor window for a completed activity, he/she could see all these values in the properties. Also API's are provided for retrieving these values. I think either I have done something wrong or this could be a bug. Pls let me know your view on this.

Pls let me know if I am wrong. Is there any other way to get these details other than by fetching the details from Audit trail table.

Thanks and Regards
Ved
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » Activity Status
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.