2015-07-29 04:21 AM - edited 2016-10-04 01:50 AM
I see that executing a workflow via REST APIs requires lot of work to be done just to prepare the right User-input XML body. Any mistake and you have some major debugging to do.
How about if I could enter all the User-Input values in my workflow execution at WFA GUI, I can do a preview which passed to my satisfaction and then I can magically get the XML body for it which I can use to execute my workflow from REST APIs from any client. It could be so very much easy for me than building my User-Input XML body manually.
This is exactly what I'm going to give you right now. You open the WFA in browser, Go to your workflow, Start execution, you input values from GUI reading carefully the display names, preview it to your satisfaction and then get the XML body.
Assume your workflow is called “Workflow to Print a given Message”. It’s a simple workflow with only 1 user-input Displayed as "Message to Print"
The following are the one-time prerequisites.
Username: <WFA Admin/Architect Username>
Password: <User Password>
Suppose you have a workflow called "Workflow to Print a given Message". You want to execute it from REST apis and need to prepare the user input XML body.
Clone Your workflow and Add the command "Generate Workflow User Input Body in XML" as your first command.
Start Execution, provide your User-inputs and preview it. Be satisfied and Press Okay.
Now Execute it. After a few scconds this cloned workflow will fail with Error "All done. The Workflow will fail now."
See the command execution logs for this command. You'll see the User-Input XML body. It has also saved the XML file at C:\temp in your WFA server.
2016-10-03 10:14 AM
I am getting the following error message when i execute my workflow with the command in it.
Exception calling "Save" with "1" argument(s): "Could not find a part of the path 'C:\temp\TFG27 DS NFS volume Resize - copy__03_10_2016_10_08_36_.xml'."
c:\temp exists on my PC.
PS C:\temp> ls
Any help is much appreciated.
2016-10-03 11:55 PM - edited 2016-10-04 12:00 AM
Okay. First thing I want to tell that DO NOT expect this command to pass. Its made to fail. Yeah not with this error, see here.
The command tries to save the XML file on the WFA server's C:\temp\ . Have you installed your WFA on your PC? Do you have permission to create files in this folder? If not check if C:\temp is on your WFA server or not.
I'll modify the code to perform this check before. Will update the Dar file.
In this image, you should still be getting the Uer-Input XML body in command execution logs even though saving the file failed. You can copy-paste that line.
2016-10-04 01:52 AM