Author |
Message
|
Mark |
Posted: Mon Dec 31, 2001 10:26 am Post subject: |
|
|
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 |
|
 |
jmac |
Posted: Wed Jan 02, 2002 9:03 am Post subject: |
|
|
 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 |
|
 |
Mark |
Posted: Wed Jan 02, 2002 10:01 am Post subject: |
|
|
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 |
|
 |
jmac |
Posted: Wed Jan 02, 2002 11:46 am Post subject: |
|
|
 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 |
|
 |
Mark |
Posted: Wed Jan 02, 2002 3:18 pm Post subject: |
|
|
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 |
|
 |
jmac |
Posted: Thu Jan 03, 2002 7:14 am Post subject: |
|
|
 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 |
|
 |
Mark |
Posted: Thu Jan 03, 2002 11:43 am Post subject: |
|
|
Acolyte
Joined: 30 Dec 2001 Posts: 55
|
|
Back to top |
|
 |
|