Skip to content

Instantly share code, notes, and snippets.

@AshV
Created July 22, 2019 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshV/a8efc39c05bab8009c8944774d462e90 to your computer and use it in GitHub Desktop.
Save AshV/a8efc39c05bab8009c8944774d462e90 to your computer and use it in GitHub Desktop.
public class WF : CodeActivity
{
[RequiredArgument]
[Input("Code")]
public InArgument<string> Code { get; set; }
[Output("Custom Team")]
[ReferenceTarget("team")]
public OutArgument<EntityReference> CustomTeam { get; set; }
protected override void Execute(CodeActivityContext context)
{
var workflowContext = context.GetExtension<IWorkflowContext>();
var serviceFactory = context.GetExtension<IOrganizationServiceFactory>();
var orgService = serviceFactory.CreateOrganizationService(workflowContext.UserId);
var tracingService = context.GetExtension<ITracingService>();
try
{
CustomTeam.Set(context, GetCustomTeamForCode(orgService, tracingService, Code.Get(context)));
}
catch (Exception ex)
{
tracingService.Trace(ex.Message);
throw;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment