Hi everybody,
I have a business request, to start a site workflow by a button. This workflow should then start a site workflow IN THE USER's CONTEXT!!! that clicks the button, without popping up the site workflow's start form directly (that's important for the further processing).
So I thought about the SOAP web service.
Found a little script to get the user logon name (GetCurrentUser.js). Then I used a script to call the web service, I found here on Connect forum (StartSiteWorkflow) and adopted it to my needs.
This I call with a button like this:
<script type="text/javascript" src="/sites/sdtools/odfbreq/SiteAssets/StartSiteWorkflow.js"></script>
<script type="text/javascript" src="/sites/sdtools/odfbreq/SiteAssets/GetCurrentUser.js"></script>
<input type="Button" value="ShowMyUserName" onclick="GetCurrentUser();"/>
Inside the workflow I created a variable "inUserLogon" (Single Line of Text, not shown on start form, not required) where I try to pass the value from my script to the workflow by web service association data - that's the point I'm struggling and ended up now after spending hours on this.
When I activate the alert(data) tag in the StartSiteWorkflow script I can see, that the variable is filled correctly.
In the workflow I added a send notification action and there the variable "inUserLogon" is empty / blank.
So the hand over from the script to the workflow must fail. I tried with and without XML encoding (both ways don't throw an error) and start the workflow but with the blank variable.
Any help would be highly appreciated!
Thanks and BR, Rubi