简体   繁体   中英

how do i get the return value from a bpel boolean variable?

I am new to BPEL. I am invoking a web service to fill a BPEL variable:

<bpel:variable name="hasASkillOutput" messageType="ns2:personHasSkillResponse"></bpel:variable>
....
<bpel:invoke name="call_personHasASkill"  partnerLink="SkillPossessionService"  operation="personHasSkill"  portType="ns2:SkillPossessionServicePortType"
                inputVariable="hasASkillInput" outputVariable="hasASkillOutput"></bpel:invoke>

The service that I invoke returns a boolean. How can I access that value as part of a condition expression?

        <bpel:if name="DoesPersonHaveTheSkill">
                <bpel:condition><hasASkillOutput is true></bpel:condition>
        </bpel:if>

The structure of the messageType personHasSkillResponse is defined in the WSDL that is linked by your partnerLink SkillPossessionService . You you have to look up that structure there and then you can use an ordinary XPath 1.0 expression in your condition and reference the variable hasASkillOutput .

If for example your message type definition looks like this:

<message name="personHasSkillResponse">
    <part name="skillResponse" element="xsd:boolean"/>
</message>

Your condition would have to look like this:

    <bpel:if name="DoesPersonHaveTheSkill">
            <bpel:condition>$hasASkillOutput.skillResponse</bpel:condition>
    </bpel:if>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM