protected override void Execute(CodeActivityContext executionContext) { ITracingService tracingService = executionContext.GetExtension <ITracingService>(); IWorkflowContext context = executionContext.GetExtension <IWorkflowContext>(); IOrganizationServiceFactory serviceFactory = executionContext.GetExtension <IOrganizationServiceFactory>(); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); try { var customerJson = CustomerInfo.Get <string>(executionContext); var operationType = OperationType.Get <string>(executionContext); PayloadCustomer payloadCustomer = new PayloadCustomer(tracingService, service); payloadCustomer.Customer = JsonHelper.DeserializeCustomerJson(customerJson, tracingService); payloadCustomer.OperationType = operationType; ProcessCustomerService process = new ProcessCustomerService(payloadCustomer); Response.Set(executionContext, process.processPayload()); } catch (FaultException <OrganizationServiceFault> ex) { tracingService.Trace(ex.ToString()); throw new InvalidPluginExecutionException(ex.ToString()); } catch (InvalidPluginExecutionException ex) { tracingService.Trace(ex.ToString()); throw new InvalidPluginExecutionException(ex.ToString()); } catch (TimeoutException ex) { tracingService.Trace(ex.ToString()); throw new InvalidPluginExecutionException(ex.ToString()); } catch (Exception ex) { tracingService.Trace(ex.ToString()); throw new InvalidPluginExecutionException(ex.ToString()); } }
public void ProcessCustomerService_PayloadCustomerNullCheck() { PayloadCustomer customer = null; ProcessCustomerService cs = new ProcessCustomerService(customer); }