Created
July 22, 2019 16:32
-
-
Save AshV/a8efc39c05bab8009c8944774d462e90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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