AnsweredAssumed Answered

Running a Process using SOAP

Question asked by fabricio.de.marchi on Jun 21, 2010
Latest reply on Nov 21, 2013 by narendargangula
Hi,

I am trying to run a Process using SOAP envelope.

I saw that the InvokeAction feature allow us to run processes and pass as parameter the object that the Process requires.

This is my code:
<gel:script xmlns:x="jelly:xml"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary"
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:core="jelly:core"
xmlns:sql="jelly:sql"
xmlns:xog="http://www.niku.com/xog">

<gel:parameter default="***" var="XOGUsername"/>
<gel:parameter default="yyy" secure="true" var="XOGPassword"/>


<soap:invoke endpoint="http://ausgchrwluat2:10202/niku/xog" var="auth">


<soap:message>



<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xog="http://www.niku.com/xog">




<soapenv:Header/>




<soapenv:Body>





<xog:Login>






<xog:Username>${XOGUsername}</xog:Username>






<xog:Password>${XOGPassword}</xog:Password>





</xog:Login>




</soapenv:Body>



</soapenv:Envelope>


</soap:message>

</soap:invoke>

<gel:out><gel:expr select="$auth"/></gel:out>

<gel:set asString="true" select="$auth/SOAP-ENV:Envelope/SOAP-ENV:Body/xog:SessionID/text()" var="sessionID"/>
<core:choose>

<core:when test="${sessionID == null}">


<gel:out>Couldn't Log in.  Check the username/password.</gel:out>

</core:when>

<core:otherwise></core:otherwise>
</core:choose>

<gel:out>SessionID: ${sessionID}</gel:out>

<soap:invoke endpoint="http://ausgchrwluat2:10202/niku/xog" var="runresult">

<soap:message>


<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">



<soapenv:Header>




<xog:Auth>





<xog:SessionID>${sessionID}</xog:SessionID>




</xog:Auth>



</soapenv:Header>



<soapenv:Body>
<Process xmlns="http://www.niku.com/xog/InvokeAction">>
<code>fbdm_test_gel</code>
<request>
<thiSDLC_PRJ_Quest
ID="5011660"
NAME="ENV.1"
CODE="SDLC001"
ODF_PARENT_ID="5006495"
DELL_SDLC_DESC="TEST557"/>

</request>
</Process>



</soapenv:Body>


</soapenv:Envelope>

</soap:message>
</soap:invoke>


<gel:out><gel:expr select="$result"/></gel:out>
<gel:out>${result}</gel:out>

</gel:script>
That code is able to log in Clarity and then fires up the Process, but the process errors out with the following message (found it in the Processes tab using the Clarity admin user:
BPM-0513: Internal Process Engine Error. Contact your site administrator (The following object(s) are not initialized: 'thisSDLC PRJ Questions').
I am going to try and change the master object name, since now it contains spaces in the name and this might be the cause of the issue. I will let you know if that works.

In the meantime, has anyone done it before? Would you care to post your example?

Thanks,

Fabricio

Outcomes