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 » Error in getting PEA from Java API

Post new topic  Reply to topic
 Error in getting PEA from Java API « View previous topic :: View next topic » 
Author Message
Mark
PostPosted: Mon Dec 31, 2001 10:26 am    Post subject: Reply with quote

Acolyte

Joined: 30 Dec 2001
Posts: 55

Hi Friends
I am not able to get PEA .Pls Correct me where I am wrong.Sequence of Action are as follows.

Agent agent = new Agent();
ExecutionService service = agent.locate("",");
Now I do Login .
ExecutionServiceAgent Eagent = agent.getExecutionAgent();
Now If I call any method on this Eagent( which is not null ) It gives me error PEA is not Running.

Looking for help


[ This Message was edited by: Mark on 2001-12-31 10:26 ]
Back to top
View user's profile Send private message
jmac
PostPosted: Wed Jan 02, 2002 9:03 am    Post subject: Reply with quote

Jedi Knight

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

Mark:

Can you use the IBM supplied windows client? If you can start that up, it ALWAYS starts a PEA. SO, if it starts, then there is a problem with your code, send me a bigger snip of code, and perhaps I can spot it. IF it does not start, then you have some type of configuration problem.

Good Luck

_________________
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
Mark
PostPosted: Wed Jan 02, 2002 10:01 am    Post subject: Reply with quote

Acolyte

Joined: 30 Dec 2001
Posts: 55

Hi John

Yes When I use IBM Supplied Windows client I See the PEA Running.But I don't UnderStand
why It doesn't Work with my code.

The Code is as follows.

ExecutionService service = null;
Agent agent = null;
ExecutionAgent eAgent = null ;
//Login
agent.setLocator(Agent.LOC_LOCATOR );
agent.setName( "LOCAL" );
service = agent.locate("","");
service.logon(struserId,strpwssd);

// Work Item Creation
ProcessTemplateList[] processTemplateList = service.queryProcessTemplateLists();

ProcessTemplate[] processTemplates = processTemplateList[0].queryProcessTemplates();
pInstance = processTemplates[0].createAndStartInstance("Cancellation Request9","","",true);

eAgent = agent.getExecutionAgent();
//Here it gives Excep. PEA is not running ReadOnlyContainer cntr = eAgent.inContainer();
ReadWriteContainer data = pInstance.inContainer();


Thnx John
Back to top
View user's profile Send private message
jmac
PostPosted: Wed Jan 02, 2002 11:46 am    Post subject: Reply with quote

Jedi Knight

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

OK... Now I see your problem.

You must start the PEA, your code
eAgent = agent.getExecutionAgent();
Does not start a PEA... To start a pea use code like this:


service.programExecutionAgentStartUp()

Once you have a PEA running, you will then be able to Access workitems, and once you have a workitem you will be able to issue a start.

HOWEVER... for what you are doing you do not need a PEA. You only need a PEA if you are going to issue a workitem start... So far as I can see you don't have one in your code... So simply remove the offending line and I think you will be OK


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

[ This Message was edited by: jmac on 2002-01-02 11:48 ]
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Mark
PostPosted: Wed Jan 02, 2002 3:18 pm    Post subject: Reply with quote

Acolyte

Joined: 30 Dec 2001
Posts: 55

No John .I followed what u sait but It didn't work. It's irritating but
Pls see the Code where I Access a Work Item.
Before this I start PEA and get It from Agent.PEA contains the I/P & O/P container.
I have put code for get and set value of conatiner for my program But as the control reaches there it gives Excp PEA not running.


The Modified Code is as follows.

ExecutionService service = null;
Agent agent = null;
ExecutionAgent eAgent = null ;
WorkList[] lobworkList = null;
WorkItem[] lobWorkItem = null;
//Login
agent.setLocator(Agent.LOC_LOCATOR );
agent.setName( "LOCAL" );
service = agent.locate("","");
service.logon(struserId,strpwssd);

// Work Item Creation
ProcessTemplateList[] processTemplateList = service.queryProcessTemplateLists();

ProcessTemplate[] processTemplates = processTemplateList[0].queryProcessTemplates();
pInstance = processTemplates[0].createAndStartInstance("Cancellation Request9","","",true);
//Access Work Item
lobworkList = service.queryWorkLists();
lobWorkItem = lobworkList[0].queryWorkItems();
//Start PEA
service.programExecutionAgentStartUp();
eAgent = agent.getExecutionAgent();

//Here it gives Excep. PEA is not running ReadOnlyContainer cntr = eAgent.inContainer();

// To start WorkItem
lobWorkItem[0].start();
Back to top
View user's profile Send private message
jmac
PostPosted: Thu Jan 03, 2002 7:14 am    Post subject: Reply with quote

Jedi Knight

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

Mark:

You must remove the line:

eAgent = agent.getExecutionAgent();

That is the cause of your problem. This ine is ONLY used when you are running UNDER a PEA, this ONLY happens if you START a workitem.

_________________
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
Mark
PostPosted: Thu Jan 03, 2002 11:43 am    Post subject: Reply with quote

Acolyte

Joined: 30 Dec 2001
Posts: 55

Thnx a Lot John.
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 » Error in getting PEA from Java API
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.