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 » Question on a simple program to access PI list using WSAD

Post new topic  Reply to topic
 Question on a simple program to access PI list using WSAD « View previous topic :: View next topic » 
Author Message
anveshita
PostPosted: Fri Oct 20, 2006 8:28 am    Post subject: Question on a simple program to access PI list using WSAD Reply with quote

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
View user's profile Send private message
jmac
PostPosted: Fri Oct 20, 2006 10:29 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
anveshita
PostPosted: Fri Oct 20, 2006 10:47 am    Post subject: Reply with quote

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
View user's profile Send private message
jmac
PostPosted: Fri Oct 20, 2006 11:13 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
anveshita
PostPosted: Fri Oct 20, 2006 11:25 am    Post subject: Reply with quote

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
View user's profile Send private message
jmac
PostPosted: Fri Oct 20, 2006 11:38 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
hos
PostPosted: Sun Oct 22, 2006 11:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
anveshita
PostPosted: Mon Oct 23, 2006 8:11 am    Post subject: Reply with quote

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
View user's profile Send private message
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 » Question on a simple program to access PI list using WSAD
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.