Author |
Message
|
anveshita |
Posted: Fri Oct 20, 2006 8:28 am Post subject: Question on a simple program to access PI list using WSAD |
|
|
Master
Joined: 27 Sep 2004 Posts: 254 Location: Jambudweepam
|
Hello,
I am trying to develop a simple program to access the process instance list.
Following is my setup:
Windows, WSAD, hasve MQWF installed. I have not configured it yet.
Trying to access process instance list from MQWF server running on unix server called "myserver".
I have looked at the examples listed and on this web site.Following is the code I have:
t
Code: |
ry{
prop.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtx.Factory") ;
//prop.put( javax.naming.Context.PROVIDER_URL, "iiop://<Hostname of JNDI Name Server>:<JNDI Name Server Port>" );
prop.put( javax.naming.Context.PROVIDER_URL, "iiop://<myserver>:900" );
agent.setLocator( Agent.JNDI_LOCATOR );
agent.setName( "MQWFAgent");
ExecutionService execSer = agent.locate(Group,wfSystem);
execSer.logon2(Username,Password, SessionMode.DEFAULT, AbsenceIndicator.NOT_SET);
ProcessInstance[] pis = null;
ProcessInstance pInst=null;
int nCount = 1;
System.out.println ("Entering...");
pis = execSer.queryProcessInstances("","NAME ASC",new Integer(30));
System.out.println ("Error occurred 01 : "+pis.length);
while(pis.length > 0){
int nIndex;
System.out.println ("Entering PI loop...");
for(nIndex = 0;nIndex < pis.length;nIndex++)
{
ActivityInstance [] ais = null;
pInst=pis[nIndex];
try{
ais = pInst.obtainProcessMonitor(true).activityInstances();
}catch(FmcException fmce)
{
fmce.printStackTrace();
System.out.println ("Error occurred 1 : "+fmce.toString());
return;
}
for(int nAIndex = 0;nAIndex < ais.length;nAIndex++)
{
try{
if(ais[nAIndex].state().equals(com.ibm.workflow.api.ActivityInstancePackage.ExecutionState.RUNNING))
{
activityName=ais[nAIndex].name();
if(activityName == null || (activityName.length() > 0 && ais[nAIndex].name().equalsIgnoreCase(activityName)))
{
nRestartCount++;
// ais[nAIndex].forceRestart();
}
}
}catch(FmcException fmce)
{
fmce.printStackTrace();
System.out.println ("Error occurred 2 : "+fmce.toString());
}
}
nCount++;
}
pis = execSer.queryProcessInstances("NAME > '" +pis[nIndex - 1].name() ,"NAME ASC",new Integer(500));
System.out.println("Process Instance List Built....");
}
catch{
}
|
I am getting an error "Error occurred : java.beans.PropertyVetoException: FMC38000E Could not locate Agent for Domain MQWFAgent"
I have taken care of the following:
1. Added fmcjojagt.jar to the build path in WSAD.
2. The code compiled with out any errors.
My knowledge of java and mqwf is limited. Any help is appreciated |
|
Back to top |
|
 |
jmac |
Posted: Fri Oct 20, 2006 10:29 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
The examples you are looking at are quite old.... If you are using MQWF V3.6 you are using the native Java API. Have a look at the samples that come with V3.6 to see some current examples _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
anveshita |
Posted: Fri Oct 20, 2006 10:47 am Post subject: |
|
|
Master
Joined: 27 Sep 2004 Posts: 254 Location: Jambudweepam
|
We are using 3.5. Still you suggest I take a look at the 3.6. Please let me know |
|
Back to top |
|
 |
jmac |
Posted: Fri Oct 20, 2006 11:13 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Are you using the native java API? This is available as a support pac in V3.5 and if you are that would be why you are having this problem... _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
anveshita |
Posted: Fri Oct 20, 2006 11:25 am Post subject: |
|
|
Master
Joined: 27 Sep 2004 Posts: 254 Location: Jambudweepam
|
I am using fmcojagt.jar in the class path. Not sure what you mean "java Native API". My ignorance |
|
Back to top |
|
 |
jmac |
Posted: Fri Oct 20, 2006 11:38 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Have a look at MQWF support pac WA0c... I think you need to be 3.5.0.3 or higher to run native java api... but you should definitely run it if you are at that leve or higher.
fmcojagt.jar = Traditional mqwf java API
fmcjapi.jar = Native Java API _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
hos |
Posted: Sun Oct 22, 2006 11:40 pm Post subject: |
|
|
Chevalier
Joined: 03 Feb 2002 Posts: 470
|
Hi,
1. You should not use the JNDI locator. It is deprecated and no longer
supported in version 3.6. Use the LOC locator instead.
2. If you use the JNDI locator, check this code in your program:
"iiop://<myserver>:900"
Verify that your system has the hostname 'myserver' and that port 900
is properly set up. Also make sure that the Java Agent is running.
3. Create a MQWF client configuration on your machine so that your Java
program can access the proper profile values.
4. I would recommend to start with a simple Java Program (logon(),
logout() ) outside of RAD. Continue with integration into RAD once this
program runs successfully. |
|
Back to top |
|
 |
anveshita |
Posted: Mon Oct 23, 2006 8:11 am Post subject: |
|
|
Master
Joined: 27 Sep 2004 Posts: 254 Location: Jambudweepam
|
Thanks for the response.
Quote: |
2. If you use the JNDI locator, check this code in your program:
"iiop://<myserver>:900"
Verify that your system has the hostname 'myserver' and that port 900
is properly set up. Also make sure that the Java Agent is running. |
How to make sure the Java Agent is running? <myserver> ( AIX machine)is the name of the machine where the Workflow is running. I am trying to run a Java program on my PC in WASD that would acces the Workflow configuration on <myserver>
What do you mean by "port 900 is properly set up". How can I check this? |
|
Back to top |
|
 |
|