Exemplo n.º 1
0
        protected override void ExecuteActivity(CodeActivityContext executionContext)
        {
            var trace = executionContext.GetExtension <ITracingService>();

            trace?.Trace("Start Account Web Hook WF");
            var target = WorkflowContext?.GetTarget();

            if (target != null)
            {
                var account = new WebHookAccount
                {
                    Id    = target.Id,
                    Name  = target.GetAttributeValue <string>("name"),
                    Phone = target.GetAttributeValue <string>("telephone1"),
                    City  = target.GetAttributeValue <string>("address1_city")
                };

                var json = JsonConvert.Serialize(account);
                trace?.Trace("Send post");
                PostData(executionContext, json, trace);
            }
        }