Author |
Message
|
Surfer |
Posted: Tue May 17, 2005 6:58 pm Post subject: How to know that activity that is runing ? |
|
|
 Apprentice
Joined: 14 Jun 2002 Posts: 31
|
I am writting a java program that will be launched automatically from an automatic activity.
I that program I should now that I am in that activity and show it in dialog box.
Do I need to query _ACTIVITY from the process ? And how to get the uuid of the activity ?
Thank you once again.
Best regards |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed May 18, 2005 3:48 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
I don't think I have got ur question correctly.
But if ur trying to get the name of the activity for which this Java application has run, u can do the folowing.
Is there some container field which uniquely identifies ur workitem, if there is, set it in the Description field of Activity.....
Set that field as the Java application parameter i.e args[0] for the application.
Next , with the workitem in hand, I am sure there is an API to get the activityName....i.e workitem.activityName() or something |
|
Back to top |
|
 |
jmac |
Posted: Wed May 18, 2005 6:56 am Post subject: Re: How to know that activity that is runing ? |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Surfer wrote: |
I am writting a java program that will be launched automatically from an automatic activity.
I that program I should now that I am in that activity and show it in dialog box.
Do I need to query _ACTIVITY from the process ? And how to get the uuid of the activity ?
Thank you once again.
Best regards |
You need to be much more specific.
You are going to launch a program from an automatic activity? How? Is this a UPES?
Your other questions are all based on the answers to the above. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
Surfer |
Posted: Thu May 19, 2005 9:57 am Post subject: thank you |
|
|
 Apprentice
Joined: 14 Jun 2002 Posts: 31
|
Thank you.
It is a PEA.
A batch file that is in program property.
But there is an other question please; how to get the programID during the execution time of that automatic activity?
When trying to get the programID, workflow throws an exception and stops : NOT AUTHORIZED.
here is a piece of code :
Agent agent = new Agent();
try
{
agent.setLocator(Agent.LOC_LOCATOR);
}
catch (PropertyVetoException e1)
{
e1.printStackTrace();
}
try
{
agent.setName("agent");
}
catch (PropertyVetoException e1)
{
e1.printStackTrace();
}
System.out.println("1");
ExecutionService service = agent.locate("", "");
service.passthrough();
eAgent = agent.getExecutionAgent();
inContainer = eAgent.inContainer();
programId = eAgent.programID();//<----this is generating the NOT
//AUTHORIZED ERROR OR EXCEPTION.
thank you, all of you. |
|
Back to top |
|
 |
vennela |
Posted: Thu May 19, 2005 10:44 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Two things:
1. You can directly invoke a java program by workflow if you set the setting right on the program.
2. What is programID? What are you expecting? At the point where you are getting the error, you are in the java program called by ProgramID.
If you are talking about ACTIVITY, then you should be able to get it from the container.
The following is the code from the sample ActImpl supplied along with the product.
Code: |
Agent agent = new Agent( );
agent.setLocator( Agent.LOC_LOCATOR );
agent.setName( "LOCAL" );
ExecutionAgent pea = agent.getExecutionAgent( );
if ( pea != null )
{
// get the input- and output container
ReadOnlyContainer input = pea.inContainer( );
ReadWriteContainer output = pea.outContainer( );
// display all input container members
System.out.println( "Input Container:" );
DisplayContainer( input );
// copy the data members from the input- to the output container
CopyContainer( input, output );
output.setLong("_RC", 0);
// display all output container members
System.out.println( "Output Container:" );
DisplayContainer( output );
// return the output container to the PEA
pea.setOutContainer( output );
} |
|
|
Back to top |
|
 |
|