简体   繁体   中英

Set InArgument when launching a workflow programmatically

Is there any way to set the value of a workflow's InArgument parameter from another workflow when launching it programmatically ?

Here's how I launch it:

var req = new ExecuteWorkflowRequest { WorkflowId = new Guid(WorkflowGuids.RenewalWorkflowId), EntityId = theContact.Id };
service.Execute(req);

I can catch the EntityId value back in the other workflow in context.PrimaryEntityId but I am at a loss as to how to populated the arguments and retrieve them on the other side.

Is this possible ? Thanks.

InArgument are defined at step level, not at workflow level.

When a workflow is executed (by a trigger, on-demand or by code) you have the record Id.

You can create a custom workflow activity to fetch other data related (or not connected at all) with your record Id and make it as OutArgument so will be available as input for the InArgument you want to set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM