Run Workflow with Arguments
I am using the Run External Command: "RunWorkflowWithArguments" to try and pass an argument into another. Is the syntax similar to using Invoke Workflow like:
New System.Collections.Generic.Dictionary(Of String, Object) From { { "WorkflowID", 1}, "inVar", inVar} ???? I am not getting any results, so I am guessing not.
My goal is to create a different url pattern, other than the original workflow, for content inspection of an attachment.
So, the main workflow url looks like: /Geocortex/Essentials/REST/sites/Ryan_Test/workflows/0/run?...
But I want to call another workflow so the url pattern looks like: /Geocortex/Essentials/REST/sites/Ryan_Test/workflows/1/run?...'
I can do this successfully by using the "RunWorkflowByID" external command, but I cannot pass in arguments. Anyone have any suggestions?
thank you,
-
Bump.
Anyone able to assist with this? It seems like I need to assign properties in the workflow of interest too.
Again, the goal is to use the RunWorkflowWithArguments external command in a workflow to trigger another workflow. I need the syntax for the parameter, and any additional property settings of a workflow that is needed in the Site config.
Ryan
0 -
Hi Ryan,
Have you found a solution for this?0 -
Ryan or Hani,
Did either of you figure out how to do this?0 -
If you're trying to pass a value from one workflow to another, you can use the Set/Get External Value activities to store values on the client machine that you can then pass to other activites while the viewer session is up.
Example:
1) Run your first workflow and include a SetExternalValue activity right before invoking the second workflow.
2) Use GetExternalValue in the second workflow to retrieve the stored value from the first workflow.
I haven't built a workflow that does this precisely, but I'm pretty positive it should work.0 -
All,
1) What John Nerge suggested is working to set some values to share among different workflows usgin Set/Get External which is stored on client browser.
2) A Command Parameter for a command "RunWorkflowWithArguments" on RunExternalCommand taks the type as Object as you mouse over it. Here is what I did for some custom project I used. I can't add that workflow I implemented since the custom paid it so I just describe the steps below.
2-1 Add one Sequence (named as seq-WFArgs) before 'RunExeternalCommand'
2-2 create a variable say 'wfArgs' as Object type
2-3 on seq-WFArgs, create a var named 'wfArgsIObj' which type is JObject (which is a Newtonsoft.Json.Linq.JObject, which is available with GcxWorkflow as Newtonsoft.Json.dll)
2-4 Assign wfArgsIObj with the values such as
2-4-1 Use Assign: wfArgsIObj("workflowId") = [Your Workflow ID]
2-4-2 Use Assign: wfArgsIObj("otherParm") = [ANother Parameter to pass which another WF expects on Argument]
2-4-3 do 2-4-3 to pass all arguments you want to pass to the callee workflow
2-5 Assign wfArgs = wfArgsIObj
NOTE: keep in mind that wfArgsIObj variable should be in different scope. That is why I create another sequent above. Otherwise, it will give you one error about serialization or so... so Only wfArgs variable (NOT wfArgIObj variable) is exposed to the scope to the RunExternalCommand activity is used.
wish this helps you out to achieve to excute "RunWorkflowWithArguments" inside Workflow by passing the WorkflowID and extra parameter(s) expected on the second workflow.
Munhwan at Latitude Geographics Professional Service Team0
Please sign in to leave a comment.
Comments
5 comments