ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robin Tao <testfor...@gmail.com>
Subject Re: how to use ODE instance management API getcommunication and replay
Date Wed, 01 May 2013 01:59:25 GMT
Yes, and I just figured out how to fix it: just change
<pmap:getCommunication >
into:
<getCommunication xmlns:ns="
http://www.apache.org/ode/pmapi/types/2006/08/02/">
May be it should be fixed in the online document.

But when I went on with the "Replay" API, I got other problems.
I started a process named Investigate in ode with one activity which needs
activemq message as a response. I did not send the activemq message, so the
process instance paused at the activity waiting for response. Then I use
"getCommunication" API to get the restoreInstance information:

<ns:restoreInstance xmlns:ns="
http://www.apache.org/ode/pmapi/types/2006/08/02/"><ns:processType
xmlns:wuz="http://wuz.bpel.example">wuz:Investigate</ns:processType><ns:exchange><ns:type>M</ns:type><ns:createTime>2013-05-01T09:15:23.511+08:00</ns:createTime><ns:service
xmlns:wuz="http://wuz.bpel.example">wuz:Investigate</ns:service><ns:operation>process</ns:operation><ns:in><message><payload><InvestigateRequest
xmlns="http://wuz.bpel.example" xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://wuz.bpel.example
">
  <input>start</input>

</InvestigateRequest></payload></message></ns:in></ns:exchange><ns:exchange><ns:type>P</ns:type><ns:createTime>2013-05-01T09:15:23.640+08:00</ns:createTime><ns:service
xmlns:impl="http://impl.ws.core.serv.wuz.com">impl:DrawStaffPortType</ns:service><ns:operation>draw</ns:operation><ns:in><message><parameters><draw
xmlns="http://impl.ws.core.serv.wuz.com"><ns:args0 xmlns:ns="
http://impl.ws.core.serv.wuz.com">1</ns:args0>
  <ns:args1 xmlns:ns="http://impl.ws.core.serv.wuz.com">200</ns:args1>


</draw></parameters></message></ns:in><ns:out><message><parameters><drawResponse
xmlns="http://impl.ws.core.serv.wuz.com" xmlns:ns="
http://impl.ws.core.serv.wuz.com"><return>1,3</return></drawResponse></parameters></message></ns:out></ns:exchange><ns:exchange><ns:type>P</ns:type><ns:createTime>2013-05-01T09:15:24.364+08:00</ns:createTime><ns:service
xmlns:impl="http://impl.ws.core.serv.wuz.com">impl:ArtificialActivityServicePortType</ns:service><ns:operation>getMessage</ns:operation><ns:in><message><parameters><getMessage
xmlns="http://impl.ws.core.serv.wuz.com"><ns:args0 xmlns:ns="
http://impl.ws.core.serv.wuz.com">Investigation for new staff</ns:args0>
  <ns:args1 xmlns:ns="http://impl.ws.core.serv.wuz.com">1,3</ns:args1>
  <ns:args2 xmlns:ns="http://impl.ws.core.serv.wuz.com">ns:args2</ns:args2>
  <ns:args3 xmlns:ns="http://impl.ws.core.serv.wuz.com">
www.wuz.com:8080/App/busi/investigate</ns:args3>
  <ns:args4 xmlns:ns="http://impl.ws.core.serv.wuz.com">2</ns:args4>


</getMessage></parameters></message></ns:in></ns:exchange></ns:restoreInstance>

Then I add this information into the replayinstance.soap:

<?xml version="1.0" encoding="utf-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/
">
  <SOAP-ENV:Body>
  <replay xmlns:kk="http://www.apache.org/ode/pmapi/types/2006/08/02/">
    <replay>
<ns:restoreInstance xmlns:ns="
http://www.apache.org/ode/pmapi/types/2006/08/02/"><ns:processType
xmlns:wuz="http://wuz.bpel.example">wuz:Investigate</ns:processType><ns:exchange><ns:type>M</ns:type><ns:createTime>2013-05-01T09:15:23.511+08:00</ns:createTime><ns:service
xmlns:wuz="http://wuz.bpel.example">wuz:Investigate</ns:service><ns:operation>process</ns:operation><ns:in><message><payload><InvestigateRequest
xmlns="http://wuz.bpel.example" xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://wuz.bpel.example
">
  <input>start</input>

</InvestigateRequest></payload></message></ns:in></ns:exchange><ns:exchange><ns:type>P</ns:type><ns:createTime>2013-05-01T09:15:23.640+08:00</ns:createTime><ns:service
xmlns:impl="http://impl.ws.core.serv.wuz.com">impl:DrawStaffPortType</ns:service><ns:operation>draw</ns:operation><ns:in><message><parameters><draw
xmlns="http://impl.ws.core.serv.wuz.com"><ns:args0 xmlns:ns="
http://impl.ws.core.serv.wuz.com">1</ns:args0>
  <ns:args1 xmlns:ns="http://impl.ws.core.serv.wuz.com">200</ns:args1>


</draw></parameters></message></ns:in><ns:out><message><parameters><drawResponse
xmlns="http://impl.ws.core.serv.wuz.com" xmlns:ns="
http://impl.ws.core.serv.wuz.com"><return>1,3</return></drawResponse></parameters></message></ns:out></ns:exchange><ns:exchange><ns:type>P</ns:type><ns:createTime>2013-05-01T09:15:24.364+08:00</ns:createTime><ns:service
xmlns:impl="http://impl.ws.core.serv.wuz.com">impl:ArtificialActivityServicePortType</ns:service><ns:operation>getMessage</ns:operation><ns:in><message><parameters><getMessage
xmlns="http://impl.ws.core.serv.wuz.com"><ns:args0 xmlns:ns="
http://impl.ws.core.serv.wuz.com">Investigation for new staff</ns:args0>
  <ns:args1 xmlns:ns="http://impl.ws.core.serv.wuz.com">1,3</ns:args1>
  <ns:args2 xmlns:ns="http://impl.ws.core.serv.wuz.com">ns:args2</ns:args2>
  <ns:args3 xmlns:ns="http://impl.ws.core.serv.wuz.com">
www.wuz.com:8080/App/busi/investigate</ns:args3>
  <ns:args4 xmlns:ns="http://impl.ws.core.serv.wuz.com">2</ns:args4>


</getMessage></parameters></message></ns:in></ns:exchange></ns:restoreInstance>
    </replay>
</replay>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I stopped the ode engine, started another ode engine, deployed a new
Investigate process in it. Then I typed "./sendsoap
http://localhost:8080/ode/processes/Investigate replayinstance.soap" and
got the error message:

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>java.lang.RuntimeException:
Invocation of method replay in management interface failed:
</faultstring><detail><axis2ns2:RuntimeException xmlns:axis2ns2="
http://www.apache.org/ode/pmapi">java.lang.RuntimeException: Invocation of
method replay in management interface failed:
    at org.apache.ode.il.DynamicService.invoke(DynamicService.java:89)
    at
org.apache.ode.axis2.service.ManagementService$DynamicMessageReceiver.invokeBusinessLogic(ManagementService.java:126)
    at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
    at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
    at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.ode.bpel.pmapi.ManagementException:
    at
org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl.replay(ProcessAndInstanceManagementImpl.java:1406)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.ode.il.DynamicService.invoke(DynamicService.java:71)
    ... 19 more
Caused by: java.lang.Exception:
    at
org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl$24.run(ProcessAndInstanceManagementImpl.java:1395)
    at
org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl$24.run(ProcessAndInstanceManagementImpl.java:1381)
    at org.apache.ode.bpel.engine.BpelDatabase$1.call(BpelDatabase.java:76)
    at
org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:284)
    at
org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:239)
    at org.apache.ode.bpel.engine.BpelDatabase.exec(BpelDatabase.java:74)
    at
org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl.replay(ProcessAndInstanceManagementImpl.java:1381)
    ... 24 more
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: I
don't have response for invoke &lt;xml-fragment xmlns:ns="
http://www.apache.org/ode/pmapi/types/2006/08/02/">
  &lt;ns:type>P&lt;/ns:type>
  &lt;ns:createTime>2013-05-01T09:15:24.364+08:00&lt;/ns:createTime>
  &lt;ns:service xmlns:impl="http://impl.ws.core.serv.wuz.com
">impl:ArtificialActivityServicePortType&lt;/ns:service>
  &lt;ns:operation>getMessage&lt;/ns:operation>
  &lt;ns:in>
    &lt;message>
      &lt;parameters>
        &lt;getMessage xmlns="http://impl.ws.core.serv.wuz.com">
          &lt;ns:args0
xmlns:ns="http://impl.ws.core.serv.wuz.com">Investigation
for new staff&lt;/ns:args0>
          &lt;ns:args1 xmlns:ns="http://impl.ws.core.serv.wuz.com
">1,3&lt;/ns:args1>
          &lt;ns:args2 xmlns:ns="http://impl.ws.core.serv.wuz.com
">ns:args2&lt;/ns:args2>
          &lt;ns:args3 xmlns:ns="http://impl.ws.core.serv.wuz.com">
www.wuz.com:8080/App/busi/investigate&lt;/ns:args3>
          &lt;ns:args4 xmlns:ns="http://impl.ws.core.serv.wuz.com
">2&lt;/ns:args4>
        &lt;/getMessage>
      &lt;/parameters>
    &lt;/message>
  &lt;/ns:in>
&lt;/xml-fragment>
    at
org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:464)
    at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
    at
org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntimeContextImpl.java:968)
    at
org.apache.ode.bpel.engine.replayer.ReplayerBpelRuntimeContextImpl$1.call(ReplayerBpelRuntimeContextImpl.java:164)
    at
org.apache.ode.bpel.engine.replayer.ReplayerScheduler.startReplaying(ReplayerScheduler.java:111)
    at
org.apache.ode.bpel.engine.replayer.Replayer.replayInstances(Replayer.java:119)
    at
org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl$24.run(ProcessAndInstanceManagementImpl.java:1386)
    ... 30 more
Caused by: java.lang.IllegalStateException: I don't have response for
invoke &lt;xml-fragment xmlns:ns="
http://www.apache.org/ode/pmapi/types/2006/08/02/">
  &lt;ns:type>P&lt;/ns:type>
  &lt;ns:createTime>2013-05-01T09:15:24.364+08:00&lt;/ns:createTime>
  &lt;ns:service xmlns:impl="http://impl.ws.core.serv.wuz.com
">impl:ArtificialActivityServicePortType&lt;/ns:service>
  &lt;ns:operation>getMessage&lt;/ns:operation>
  &lt;ns:in>
    &lt;message>
      &lt;parameters>
        &lt;getMessage xmlns="http://impl.ws.core.serv.wuz.com">
          &lt;ns:args0
xmlns:ns="http://impl.ws.core.serv.wuz.com">Investigation
for new staff&lt;/ns:args0>
          &lt;ns:args1 xmlns:ns="http://impl.ws.core.serv.wuz.com
">1,3&lt;/ns:args1>
          &lt;ns:args2 xmlns:ns="http://impl.ws.core.serv.wuz.com
">ns:args2&lt;/ns:args2>
          &lt;ns:args3 xmlns:ns="http://impl.ws.core.serv.wuz.com">
www.wuz.com:8080/App/busi/investigate&lt;/ns:args3>
          &lt;ns:args4 xmlns:ns="http://impl.ws.core.serv.wuz.com
">2&lt;/ns:args4>
        &lt;/getMessage>
      &lt;/parameters>
    &lt;/message>
  &lt;/ns:in>
&lt;/xml-fragment>
    at
org.apache.ode.bpel.engine.replayer.ReplayerBpelRuntimeContextImpl.invoke(ReplayerBpelRuntimeContextImpl.java:155)
    at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:100)
    at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:451)
    ... 36 more
</axis2ns2:RuntimeException></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

I just got confused with the case, and I also want to know the standard
steps I should follow with if I want to invoke the "getCommunication" and
"replay" API.

Thanks,
        Robin


On Tue, Apr 30, 2013 at 7:04 PM, Tammo van Lessen <tvanlessen@gmail.com>wrote:

> Hi Robin,
>
> and there was a process instance with ID 1234?
>
> Thanks,
>   Tammo
>
>
> On Sun, Apr 28, 2013 at 11:23 AM, Robin Tao <testforvln@gmail.com> wrote:
>
> > Hi all, I'm new to the Apache ODE engine. I just got confused when I try
> to
> > use the Management API to play with the engine which was deployed as war
> > file.
> >
> > I came across the page where it told me to invoke pmap:getCommunication
> to
> > get the restoreInstance,
> > http://ode.apache.org/instance-replayer.html
> > But I create a file getcommunication.soap:
> >
> > <?xml version="1.0" encoding="utf-8" ?>
> > <SOAP-ENV:Envelope xmlns:SOAP-ENV="
> > http://schemas.xmlsoap.org/soap/envelope/"
> > xmlns:ns="http://www.apache.org/ode/pmapi/types/2006/08/02/" >
> >   <SOAP-ENV:Body>
> > <pmap:getCommunication >
> >   <getCommunication>
> >      <ns:iid>1234</ns:iid>
> >   </getCommunication>
> > </pmap:getCommunication>
> >   </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > then use "./sendsoap
> >
> http://localhost:8080/ode/processes/InstanceManagementgetcommunication.soap
> > "
> > to invoke the ode management api.
> >   I got response:
> > <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
> > http://schemas.xmlsoap.org/soap/envelope/
> > "><soapenv:Body><getCommunicationResponse><getCommunicationResponse
> > /></getCommunicationResponse></soapenv:Body></soapenv:Envelope>
> >
> > It shows that I got no communication back.
> >
> > The file getcommunication.soap is a little different from the official
> > guide in which I add SOAP-ENV attribute.
> >
> > Could you tell me why the management API return nothing and how I can get
> > the right response?
> >
> > Thanks a lot
> >
>
>
>
> --
> Tammo van Lessen - http://www.taval.de
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message