Clarity

  • 1.  Gel access to WSDL Process InvokeAction content

    Posted Dec 05, 2013 05:54 AM

    Hello.

    A program submits a process InvokeAction to call a process which contains a gel script.

    The process InvokeAction includes a <request> section containing some xml.

    How can the gel script reference the xml?

    Thank you

     



  • 2.  RE: Gel access to WSDL Process InvokeAction content
    Best Answer

    Posted Dec 05, 2013 02:02 PM

     

    This works for us.

    Assuming your proces body looks like this:

    <soapenv:Body>
        <tns:Process>
        <code>ContractProcessTest</code>
        <request>
            <objparam objType="contract">1A567B87</objparam>
        </request>
        </tns:Process>
    </soapenv:Body>

    In a step gel script:

    <!-- Grab the xml passed in via the webService -->
    <gel:getDocument var="requestXml"/>
    <gel:set select="$requestXml" var="request" asString="true"/>
    <gel:log>"entire xml in start =" ${request}</gel:log>

    <!-- Pull off the objparam -->
    <gel:set select="$requestXml//request/objparam" var="objNode" asString="false"/>

    <!-- Pull off the objCode and objId -->
    <gel:set select="$objNode//@objCode" var="objCode" asString="true"/>
    <gel:set select="$objNode//text()" var="objId" asString="true"/>
    <gel:log>"Object Code in start = ${objCode}"</gel:log>
    <gel:log>"Object Id in start = ${objId}"</gel:log>

    <!-- Set these for the process -->
    <gel:persist var="objCode" value="${objCode}" scope="PROCESS"/>
    <gel:persist var="objId" value="${objId}" scope="PROCESS"/>

    V/r,

    Gene (with thanks to Bob for figuring this out for us)



  • 3.  RE: Gel access to WSDL Process InvokeAction content

    Posted Dec 05, 2013 02:33 PM

    Hi Gene.

    Thank you! That's exactly what I was after.

    We'll check that out tomorrow and let you know how we get on.

    Thanks again

    Vince

     



  • 4.  RE: Gel access to WSDL Process InvokeAction content

    Posted Dec 09, 2013 04:44 AM

    Thanks again Gene.

    That's all worked perfectly.

    I wish the documentation included this information!

    Regards

    Vince



  • 5.  RE: Gel access to WSDL Process InvokeAction content

    Posted Jul 26, 2019 05:06 PM
    Does this process need to be tied to Object? Also, not sure how the following 2 statement will work. Is it based on object linked to process, Clarity takes care of providing information for object code and id?

    <gel:set select="$objNode//@objCode" var="objCode" asString="true"/>
    <gel:set select="$objNode//text()" var="objId" asString="true"/>


  • 6.  RE: Gel access to WSDL Process InvokeAction content

    Posted Jul 27, 2019 02:43 PM
    No, it does not need to be tied to an object (the opposite even, since it has no contextual object information to bind to in the beginning).

    If you WANT to start a process bound to an object, I suggest going the route of performing a XOG instead that touches the object-based record in such a way as to meet the conditions to automatically start a process, rather than kicking it off via WSDL invokeAction calls.

    Of course, if you do start a process with an invokeAction call, you can then update one/more objects as you want, and they can have their own independent processes launched as appropriate too.

    With respect to the two lines you ask about, they are just trying to extract the textual values from the 'request payload' coming from outside of Clarity, provided in the XML body used to start the process over the WSDL call so that the information can be accessed from within the process and its gel scripts.  It is putting them into variables and then persisting them over the lifetime of the process so they can just be accessed in the rest of the script (or other steps/actions/scripts in the same process instance) via ${objCode} and ${objId} - maybe for use in queries or XOGs or similar.

    Although in that specific example, it was probably meant to be select="$objNode//@objType" in order for it to work - a minor typo.


  • 7.  RE: Gel access to WSDL Process InvokeAction content

    Posted Jul 29, 2019 09:57 AM
    Thank you Nick. You are correct.