Example #1
0
        protected override void ExecuteCrmWorkFlowActivity(CodeActivityContext context, LocalWorkflowContext localContext)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (localContext == null)
            {
                throw new ArgumentNullException(nameof(localContext));
            }

            string   aiSetupJson = AiSetupJson.Get(context);
            AiLogger aiLogger    = new AiLogger(aiSetupJson, localContext.OrganizationService, localContext.TracingService,
                                                localContext.WorkflowExecutionContext, null, localContext.WorkflowExecutionContext.WorkflowCategory);

            string name       = Name.Get(context);
            string method     = Method.Get(context);
            string type       = Type.Get(context);
            int    duration   = Duration.Get(context);
            int?   resultCode = ResultCode.Get(context);
            bool   success    = Success.Get(context);
            string data       = Data.Get(context);

            bool logSuccess = aiLogger.WriteDependency(name, method, type, duration, resultCode, success, data);

            LogSuccess.Set(context, logSuccess);
        }