Skip to main content
Nintex Community Menu Bar

Startvariables not passed correctly using the start Webservice Call with StartWorkflowOnListItem

  • March 20, 2020
  • 4 replies
  • 33 views

Forum|alt.badge.img+1

 Hi folks,

 

I'm starting a workflow from another workflow usind the Webservice Call with the StartWorkflowOnListItem Method. The Outputs of the call look right to me, but the receiving workflow doesn't get the right values. 

 

Here's what I'm sending: 

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<StartWorkflowOnListItem xmlns="http://nintex.com">
<itemId>123</itemId>
<listName>Testlist</listName>
<workflowName>TESTWORKFLOW</workflowName>
<associationData><![CDATA[
<Data>
<status1>TRUE</status1>
<status2>TRUE</status2>
<comment1>Test</comment1>
<comment2>Test</comment2>
</Data>]]>
</associationData>
</StartWorkflowOnListItem>
</soap:Body>
</soap:Envelope>

The endpoint, list, item and workflow parameters are fine - the right workflow starts on the right element in the right list.

 

The Target-Workflow has the following Variable configuration:

status1: yes/no, Default: no
status2: yes/no, Default: yes
comment1: single line of text, Default: empty
comment2: single line of text, Default: empty

 

I have put a logging action in the first step and this is what I get:

status1: FALSE
status2: FALSE
comment1: ""
comment2: ""

 

This is confusing - those are not even the Defaults (check status2). If I start the workflow by Webservice Call witout any parameter, it starts with the Defaults as expected.

 

Can someone make sense of this? I've created a new workflow for testing and it behaves the same - There appears to be an issue with what I'm sending.

 

Any input is highly appreciated :)

Thanks and take care!

Alex

 

4 replies

Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • March 22, 2020
Hi,

Thse SDK says "You cannot include the Data element within the associationData element without first converting it to an XML-encoded string; otherwise, an error occurs."

This means your associated data should look like.

<associationData>
&lt;Data&gt;
&lt;status1&gt;TRUE&lt;/status1&gt;
&lt;status2&gt;TRUE&lt;/status2&gt;
&lt;comment1&gt;Test&lt;/comment1&gt;
&lt;comment2&gt;Test&lt;/comment2&gt;
&lt;/Data&gt;
</associationData>

Forum|alt.badge.img+1

Hi :)

 

I tried it exactly like that, but I get back an error 400 invalid request everytime...


Forum|alt.badge.img+1

If I put this in a compose string action:

 

&lt;Data&gt;
&lt;status1&gt;TRUE&lt;/status1&gt;
&lt;status2&gt;TRUE&lt;/status2&gt;
&lt;comment1&gt;Test&lt;/comment1&gt;
&lt;comment2&gt;Test&lt;/comment2&gt;
&lt;/Data&gt;

 

The output is :

 

<Data>
<status1>TRUE</status1>
<status2>TRUE</status2>
<comment1>Test</comment1>
<comment2>Test</comment2>
</Data>

 

If I then take that string varialbe and pass it into the associaten data, it works. Crazy stuff.
So: The XML-Encoding is the solution, but I needed an extra compose action to get it to work.

Thanks @SimonMuntz for the help!

(Sorry for accepting my own reply as the solution, but it's the one that contains all steps necessary. I don't mean to take credit - just aggregated it.)


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • March 24, 2020
I'm here to help Nintex users not tally up points so glad I was able to point you in the right direction to reach the solution.