gpt4 book ai didi

java - BPEL编译错误: undeclared variable

转载 作者:行者123 更新时间:2023-12-01 12:49:27 27 4
gpt4 key购买 nike

我正在使用 Eclipse BPEL Designer 和 Apache ODE。然后我尝试在 catalina.out 中部署我的流程,但收到错误 org.apache.ode.bpel.iapi.ContextException: 部署失败;错误:[CompilationErrors] 编译已完成,但有 1 个错误:
null:138:错误:[UndeclaredVariable] 尝试引用未声明的变量“expertSelectionResponse1”

这是我的 BPEL 代码: `

<bpel:process name="pskov"
targetNamespace="http://localhost.pskov"
suppressJoinFailure="yes"
xmlns:tns="http://localhost.pskov"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:ns="http://pskov.ru"

xmlns:ode="http://www.apache.org/ode/type/extension"
xmlns:ns0="http://createtask.pskov.ru/" xmlns:ns2="http://selectexpert.pskov.ru/">

<!-- Import the client WSDL -->
<bpel:import namespace="http://selectexpert.pskov.ru/" location="SelectExpert.wsdl"

importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
<bpel:import namespace="http://createtask.pskov.ru/" location="CreateTaskwsdl.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>

<bpel:import namespace="http://pskov.ru" location="InspectionWriter.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
<bpel:import location="pskovArtifacts.wsdl" namespace="http://localhost.pskov"
importType="http://schemas.xmlsoap.org/wsdl/" />

<!-- ================================================================= -->
<!-- PARTNERLINKS -->
<!-- List of services participating in this BPEL process -->
<!-- ================================================================= -->
<bpel:partnerLinks>
<!-- The 'client' role represents the requester of this service. -->
<bpel:partnerLink name="client"
partnerLinkType="tns:pskov"
myRole="pskovProvider"
/>


<bpel:partnerLink name="WriteInspectionPL"
partnerLinkType="tns:WriteINspectionPLT"
partnerRole="WriteInspectionRole"></bpel:partnerLink>

<bpel:partnerLink name="CreateTaskPL" partnerLinkType="tns:CreateTaskPLT"
partnerRole="CreateTaskRole"></bpel:partnerLink>
<bpel:partnerLink name="SelectExpertPL" partnerLinkType="tns:SelectExpertPLT"
partnerRole="SelectExpertRole"></bpel:partnerLink>
</bpel:partnerLinks>

<!-- ================================================================= -->
<!-- VARIABLES -->
<!-- List of messages and XML documents used within this BPEL process -->
<!-- ================================================================= -->
<bpel:variables>
<!-- Reference to the message passed as input during initiation -->
<bpel:variable name="input"
messageType="tns:pskovRequestMessage"/>

<!--
Reference to the message that will be returned to the requester
-->
<bpel:variable name="output"
messageType="tns:pskovResponseMessage"/>


<bpel:variable name="WriteInspectionPLResponse"
messageType="ns:writeToDBResponse">
</bpel:variable>
<bpel:variable name="WriteInspectionPLRequest" messageType="ns:writeToDBRequest">
</bpel:variable>


<bpel:variable name="CreateTaskPLResponse"
messageType="ns0:writeTaskToDBResponse">
</bpel:variable>
<bpel:variable name="CreateTaskPLRequest" messageType="ns0:writeTaskToDB">
</bpel:variable>
<bpel:variable name="SelectExpertPLResponse1"
messageType="ns2:expertSelectionResponse"></bpel:variable>
<bpel:variable name="SelectExpertPLRequest1" messageType="ns2:expertSelection">

</bpel:variable>
</bpel:variables>


<!-- ================================================================= -->
<!-- ORCHESTRATION LOGIC -->
<!-- Set of activities coordinating the flow of messages across the -->
<!-- services integrated within this business process -->
<!-- ================================================================= -->
<bpel:sequence name="main">

<!-- Receive input from requester.
Note: This maps to operation defined in pskov.wsdl
-->

<bpel:receive name="receiveInput" partnerLink="client"
portType="tns:pskov"
operation="process" createInstance="yes" variable="input"/>

<!-- Generate reply to synchronous request -->
<bpel:assign validate="no" name="CopyInstanceIDToOutput"><bpel:copy>
<bpel:from><bpel:literal><tns:pskovResponse
xmlns:tns="http://localhost.pskov" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance">

<tns:result>tns:result</tns:result>
</tns:pskovResponse>
</bpel:literal></bpel:from>
<bpel:to variable="output" part="payload"></bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">









<![CDATA[$ode:pid]]>
</bpel:from>
<bpel:to part="payload" variable="output">
<bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:result]]>
</bpel:query>
</bpel:to>
</bpel:copy>

</bpel:assign>
<bpel:reply name="replyOutputWithinstanceID" partnerLink="client"
portType="tns:pskov" operation="process" variable="output" />
<bpel:assign validate="no" name="CopyTagToSelectActivity">
<bpel:copy>
<bpel:from><bpel:literal><tns:pskovResponse
xmlns:tns="http://localhost.pskov" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance">

<tns:result>ns2:expertSelectionResponse1</tns:result>
</tns:pskovResponse>
</bpel:literal></bpel:from>
<bpel:to variable="SelectExpertPLResponse1" part="return"></bpel:to>
</bpel:copy>





<bpel:copy>
<bpel:from part="payload" variable="input">
<bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:tagID]]>
</bpel:query>
</bpel:from>
<bpel:to part="arg0" variable="SelectExpertPLRequest1">
<bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[ns2:arg0]]>
</bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:invoke name="SelectExpertByTag" partnerLink="SelectExpertPL"
operation="expertSelection" portType="ns2:SelectExpertInterface"
inputVariable="SelectExpertPLRequest1" outputVariable="SelectExpertPLResponse1">
</bpel:invoke>



<bpel:assign validate="no" name="CopyExpertName">

<bpel:copy ignoreMissingFromData="yes">
<bpel:from
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">


<![CDATA[concat($ns2:expertSelectionResponse1.payload,"123","312","12")]]>
</bpel:from>
<bpel:to part="arg0" variable="CreateTaskPLRequest"></bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:invoke name="CreateTask" partnerLink="CreateTaskPL" operation="writeTaskToDB"
portType="ns0:CreateTaskInterface" inputVariable="CreateTaskPLRequest"
outputVariable="CreateTaskPLResponse"></bpel:invoke>
<bpel:assign validate="no" name="CopyInputToWriteExpertiseResult">








<bpel:copy>
<bpel:from><bpel:literal><impl:writeToDB xmlns:impl="http://pskov.ru"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<impl:allParams>impl:allParams</impl:allParams>
</impl:writeToDB>
</bpel:literal></bpel:from>
<bpel:to variable="WriteInspectionPLRequest" part="parameters"></bpel:to>
</bpel:copy>

<bpel:copy ignoreMissingFromData="yes">
<bpel:from part="payload" variable="input">
<bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:input]]>
</bpel:query>
</bpel:from>
<bpel:to part="parameters" variable="WriteInspectionPLRequest">
<bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[ns:allParams]]>
</bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:invoke name="WriteExpertiseResult" partnerLink="WriteInspectionPL"
operation="writeToDB" portType="ns1:InspectionWriter"
inputVariable="WriteInspectionPLRequest" outputVariable="WriteInspectionPLResponse">
</bpel:invoke>




</bpel:sequence>
</bpel:process>`

据我了解,我需要初始化变量以使 ODE 知道它的类型。我做到了。你看到错误了吗?我该如何修复它?

编辑:此分配操作出错

        <bpel:copy ignoreMissingFromData="yes">
<bpel:from
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">

<![CDATA[concat($ns2:expertSelectionResponse1.payload,
"123","312","12")]]>
</bpel:from>
<bpel:to part="arg0" variable="CreateTaskPLRequest"></bpel:to>
</bpel:copy>
</bpel:assign>`

最佳答案

$ns2:expertSelectionResponse1.payload 不是有效的变量名称。正确的名称显然是 SelectExpertPLResponse1,它被声明为 ns2:expertSelectionResponse 类型。所以下面的代码片段应该可以工作:

<bpel:copy ignoreMissingFromData="yes">
<bpel:from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[concat($SelectExpertPLResponse1.payload, "123","312","12")]]>
</bpel:from>
<bpel:to part="arg0" variable="CreateTaskPLRequest"></bpel:to>
</bpel:copy>

关于java - BPEL编译错误: undeclared variable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24349428/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com