Author |
Message
|
Surfer |
Posted: Wed May 04, 2005 11:11 am Post subject: [SOLVED] lookup the first activity in certain process(java) |
|
|
 Apprentice
Joined: 14 Jun 2002 Posts: 31
|
I am using Workflow 3.4.
I need to know by using java what is the first activity in a process.
THank you in advance for your help. |
|
Back to top |
|
 |
Ratan |
Posted: Wed May 04, 2005 11:25 am Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
you have to get a list of Activity instances and control Connector instances. An Activity which does not have an incoming control connector is your first activity. Check the Java API. _________________ -Ratan |
|
Back to top |
|
 |
Ratan |
Posted: Wed May 04, 2005 11:42 am Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
|
Back to top |
|
 |
Surfer |
Posted: Wed May 04, 2005 11:53 am Post subject: How to lookup the first activity in certain process(java) |
|
|
 Apprentice
Joined: 14 Jun 2002 Posts: 31
|
Yes I an checking java API but can t find the way to check what is the incoming control instance.
ActivityInstance actINs[] = procInstances[ndx].obtainProcessMonitor(true).activityInstances();
if ( actINs != null)
for (int i = 0; i < actINs.length; i++)
{
System.out.println("instances name :" + actINs[i].fullName());
ControlConnectorInstance[] cci = actINs[i].obtainProcessInstanceMonitor(true).controlConnectorInstances();
}
Tnak you for your help |
|
Back to top |
|
 |
jmac |
Posted: Wed May 04, 2005 12:09 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
What you are trying to do is non-trivial. I agree with what Ratan is saying that you will need to use the ControlConnector Instances. The trick is going to be to figure out which are your "start" activities, i.e those which have no incomming control connector. I have done similar things in the past so I am sure it can be done, you will just need to work thru a simple example.
Also, be aware, that it is possible for an instance to have multiple "start" activities.
GOOD LUCK
Ratan and I posted simultaneously.... but I agree exactly with what he is saying. _________________ John McDonald
RETIRED
Last edited by jmac on Wed May 04, 2005 12:25 pm; edited 1 time in total |
|
Back to top |
|
 |
Ratan |
Posted: Wed May 04, 2005 12:09 pm Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
A Control Connector instance has a source activity and a target activity. Take the source activity and see if it is the target activity for another control connector. If so, take another control connector instance and get the source and target activities and repeat the process. You should end up with atleast one source activity which is not a target activity for any connectors. That is your first activity. _________________ -Ratan |
|
Back to top |
|
 |
Surfer |
Posted: Thu May 12, 2005 4:43 pm Post subject: Hi |
|
|
 Apprentice
Joined: 14 Jun 2002 Posts: 31
|
Thank you soo much. I solved the problem by following your suggestion. It works very nice.
Thank you once again for your help. |
|
Back to top |
|
 |
|