在Apache ode中部署和运行具有流活动的流程

时间:2015-03-31 13:58:07

标签: apache-ode

我已经用更多细节重写了这个问题。抱歉没有提供足够的细节。在创建具有流活动的实例时,我在Apache ODE中遇到问题。我可以通过soap ui创建一个实例。问题是虽然分支开始并行执行,但只有一个分支完成执行,而其他分支没有完成该并行分支中所有活动的执行。
我撰写的bpel流程有2个流分支。一个分支计算2个数字的总和,等待固定的时间段并为总和添加固定的偏移量。另一个分支计算2个数字的乘积,等待固定的时间段并为产品添加固定的偏移量。请注意,此过程中没有调用。我已粘贴代码以供参考。

当我看到ode日志时,我看到了InstanceNotFoundException。但该实例存在于BPEL_INSTANCE表中。我已粘贴下面的日志。我不确定这是否与我面临的当前问题有关。

我检查了BPEL_EVENT表,发现并未记录该进程的所有ode事件。在高级别后,活动事件仅记录流动活动:
Flow1 start,FlowSequence2 start,AssignProduct start,FlowSequence1 start,AssignSum start,AssignSum end,wait1 start,AssignProduct end,wait2 start,wait1 end,Assign1 start,Assign1 end,FlowSequence1 end
如果您注意到上面没有记录wait2 end的事件,则Assign2 start&结束,FlowSequence2结束,ProcessCompletionEvent。实例未完成且处于活动状态 如果我创建另一个实例,FlowSequence2的活动可能会完全完成,但FlowSequence1的活动将无法完成。
我在tomcat 6上使用Oracle 11g作为数据库部署了apache ode 1.3.5。

在下面找到代码:

BPEL
<?xml version="1.0" encoding="UTF-8"?>
<process
    name="ParallelProcess"
    targetNamespace="http://www.example.com/BPEL/ParallelProcess"
    xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"    
    xmlns:tns="http://www.example.com/BPEL/ParallelProcess"
    xmlns:pwsdl="http://www.example.com/WSDL/ParallelProcess"
    xmlns:pxsd="http://www.example.com/Schema/ParallelProcess" 
    >

    <import namespace="http://www.example.com/WSDL/ParallelProcess" location="ParallelProcess.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>

    <partnerLinks>
        <partnerLink name="ParallelProcess_plink" partnerLinkType="pwsdl:ParallelProcess" myRole="ParallelProcessProvider" partnerRole="ParallelProcessRequester"/>
    </partnerLinks>

    <variables>
        <variable name="ParallelProcessIn" messageType="pwsdl:ParallelProcessRequestMessage"/>
        <variable name="ParallelProcessOut" messageType="pwsdl:ParallelProcessResponseMessage"/>
    </variables>

    <sequence>
    <receive name="ReceiveInput" createInstance="yes" partnerLink="ParallelProcess_plink" operation="initiate" portType="pwsdl:ParallelProcess" variable="ParallelProcessIn"/>
      <assign name="AssignInit">
        <copy>
          <from>
              <literal><pxsd:ParallelProcessResponse><pxsd:Sum/><pxsd:Product/></pxsd:ParallelProcessResponse></literal>
          </from>
          <to>
              $ParallelProcessOut.payload
          </to>
       </copy>
     </assign>
     <flow name="Flow1">
      <sequence name="FlowSequence1">
       <assign name="AssignSum">
        <copy>
          <from>$ParallelProcessIn.payload/pxsd:Number1 + $ParallelProcessIn.payload/pxsd:Number2</from>
           <to>$ParallelProcessOut.payload/pxsd:Sum</to>
         </copy>
       </assign>
       <wait name="Wait1">
        <for>'PT5S'</for>
       </wait>
       <assign name="Assign1">
        <copy>
         <from>$ParallelProcessOut.payload/pxsd:Sum + 2</from>
         <to>$ParallelProcessOut.payload/pxsd:Sum</to>
        </copy>
       </assign>
      </sequence>
      <sequence name="FlowSequence2">
       <assign name="AssignProduct">
        <copy>
          <from>$ParallelProcessIn.payload/pxsd:Number1 * $ParallelProcessIn.payload/pxsd:Number2</from>
           <to>$ParallelProcessOut.payload/pxsd:Product</to>
         </copy>
       </assign>
       <wait name="Wait2">
        <for>'PT5S'</for>
       </wait>
       <assign name="Assign2">
        <copy>
         <from>$ParallelProcessOut.payload/pxsd:Product + 2</from>
         <to>$ParallelProcessOut.payload/pxsd:Product</to>
        </copy>
       </assign>
      </sequence>
     </flow>
    </sequence>
</process>

WSDL

<?xml version="1.0"?>
<definitions name="ParallelProcess"
        targetNamespace="http://www.example.com/WSDL/ParallelProcess"
        xmlns:tns="http://www.example.com/WSDL/ParallelProcess"
        xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
        xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:psns="http://www.example.com/Schema/ParallelProcess">

    <types>
        <schema attributeFormDefault="unqualified"
                elementFormDefault="qualified" 
                targetNamespace="http://www.example.com/WSDL/ParallelProcess" 
                xmlns="http://www.w3.org/2001/XMLSchema">
            <import schemaLocation="ParallelProcess.xsd" namespace="http://www.example.com/Schema/ParallelProcess"/>
        </schema>
    </types>

    <message name="ParallelProcessRequestMessage">
        <part name="payload" element="psns:ParallelProcessRequest"/>
    </message>

    <message name="ParallelProcessResponseMessage">
        <part name="payload" element="psns:ParallelProcessResponse"/>
    </message>

    <portType name="ParallelProcess">
        <operation name="initiate">
            <input message="tns:ParallelProcessRequestMessage"/>
        </operation>
    </portType>
    <portType name="ParallelProcessCallback">
        <operation name="onResult">
            <input message="tns:ParallelProcessResponseMessage"/>
        </operation>
    </portType>

    <plnk:partnerLinkType name="ParallelProcess">
        <plnk:role name="ParallelProcessProvider" portType="tns:ParallelProcess"/>
        <plnk:role name="ParallelProcessRequester" portType="tns:ParallelProcessCallback"/>
    </plnk:partnerLinkType>

    <binding name="ParallelProcessBinding" type="tns:ParallelProcess">
        <soap:binding style="document"
            transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="initiate">
            <soap:operation
                soapAction="http://www.example.com/WSDL/ParallelProcess/initiate"/>
            <input>
                <soap:body use="literal"/>
            </input>
        </operation>
    </binding>

    <binding name="ParallelProcessCallbackBinding" type="tns:ParallelProcessCallback">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="onResult">
            <soap:operation
                soapAction="http://www.example.com/WSDL/ParallelProcess/onResult"/>
            <input>
                <soap:body use="literal"/>
            </input>
        </operation>
    </binding>

    <service name="ParallelProcess">
        <port name="ParallelProcessPort" binding="tns:ParallelProcessBinding">
            <soap:address location="http://localhost:8086/ode/processes/ParallelProcessPort"/>
        </port>
    </service>

    <service name="ParallelProcessCallback">
        <port name="ParallelProcessPortCallbackPort" binding="tns:ParallelProcessCallbackBinding">
            <soap:address location="http://localhost:8086/ode/processes/ParallelProcessPortCallbackPort"/>
        </port>
    </service>
</definitions>

XSD

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.example.com/Schema/ParallelProcess"
    xmlns:tns="http://www.example.com/Schema/ParallelProcess"
    elementFormDefault="qualified">

    <xsd:complexType name="ParallelProcessRequestComplexType">
        <xsd:sequence>       
            <xsd:element name="Number1" type="xsd:integer"/>
            <xsd:element name="Number2" type="xsd:integer"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="ParallelProcessResponseComplxType">
        <xsd:sequence>
            <xsd:element name="Sum" type="xsd:integer"/>
            <xsd:element name="Product" type="xsd:integer"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="ParallelProcessRequest" type="tns:ParallelProcessRequestComplexType"/>
    <xsd:element name="ParallelProcessResponse" type="tns:ParallelProcessResponseComplxType"/>

</xsd:schema>

ODE记录

org.apache.ode.bpel.pmapi.InstanceNotFoundException: InstanceNotFoundException 500
    at org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl.genInstanceInfoDocument(ProcessAndInstanceManagementImpl.java:740)
    at org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl.access$700(ProcessAndInstanceManagementImpl.java:152)
    at org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl$7.run(ProcessAndInstanceManagementImpl.java:403)
    at org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl$7.run(ProcessAndInstanceManagementImpl.java:401)
    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.getInstanceInfo(ProcessAndInstanceManagementImpl.java:401)
    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)
    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:103)
    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:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)

0 个答案:

没有答案