private IIntegrationContextEntity StoreIntegrationContext(IExecutionEntity execution) { IIntegrationContextEntity integrationContext = BuildIntegrationContext(execution); integrationContextManager.Insert(integrationContext); return(integrationContext); }
private IIntegrationContextEntity BuildIntegrationContext(IExecutionEntity execution) { IIntegrationContextEntity integrationContext = integrationContextManager.Create(); integrationContext.ExecutionId = execution.Id; integrationContext.ProcessInstanceId = execution.ProcessInstanceId; integrationContext.ProcessDefinitionId = execution.ProcessDefinitionId; integrationContext.FlowNodeId = execution.CurrentActivityId; integrationContext.CreatedDate = DateTime.Now; return(integrationContext); }
private void SendAuditMessage(IIntegrationContextEntity integrationContext) { if (runtimeBundleProperties.EventsProperties.IntegrationAuditEventsEnabled) { IMessage <IIntegrationResultReceivedEvent[]> message = MessageBuilder <IIntegrationResultReceivedEvent[]> .WithPayload(new IIntegrationResultReceivedEvent[] { new IntegrationResultReceivedEventImpl(runtimeBundleProperties.AppName, runtimeBundleProperties.AppVersion, runtimeBundleProperties.ServiceName, runtimeBundleProperties.ServiceFullName, runtimeBundleProperties.ServiceType, runtimeBundleProperties.ServiceVersion, integrationContext.ExecutionId, integrationContext.ProcessDefinitionId, integrationContext.ProcessInstanceId, integrationContext.Id, integrationContext.FlowNodeId) }).Build(); auditProducer.Send(message); } }
/// <summary> /// /// </summary> //[JsonConstructor] public IntegrationRequestEvent([JsonProperty("Execution")] IExecutionEntity execution, [JsonProperty("IntegrationContext")] IIntegrationContextEntity integrationContext, [JsonProperty("AppName")] string appName, [JsonProperty("AppVersion")] string appVersion, [JsonProperty("ServiceName")] string serviceName, [JsonProperty("ServiceFullName")] string serviceFullName, [JsonProperty("ServiceType")] string serviceType, [JsonProperty("ServiceVersion")] string serviceVersion) : this() { this.processInstanceId = execution.ProcessInstanceId; this.processDefinitionId = execution.ProcessDefinitionId; this.executionId = integrationContext.ExecutionId; this.flowNodeId = integrationContext.FlowNodeId; this.variables = execution.Variables; this.integrationContextId = integrationContext.Id; this.appName = appName; this.appVersion = appVersion; this.serviceName = serviceName; this.serviceFullName = serviceFullName; this.serviceType = serviceType; this.serviceVersion = serviceVersion; this.connectorType = ((ServiceTask)execution.CurrentFlowElement).Implementation; }
/// <summary> /// Publishes an custom event using the Spring <seealso cref="IApplicationEventPublisher"/>. This event will be caught by /// <seealso ref="IntegrationRequestSender#sendIntegrationRequest(IntegrationRequestEvent)"/> which is annotated with /// <seealso ref="TransactionalEventListener"/> on phase <seealso ref="TransactionPhase#AFTER_COMMIT"/>. </summary> /// <param name="execution"> the related execution </param> /// <param name="integrationContext"> the related integration context </param> private void PublishSpringEvent(IExecutionEntity execution, IIntegrationContextEntity integrationContext) { IntegrationRequestEvent @event = new IntegrationRequestEvent(execution, integrationContext, runtimeBundleProperties.AppName, runtimeBundleProperties.AppVersion, runtimeBundleProperties.ServiceName, runtimeBundleProperties.ServiceFullName, runtimeBundleProperties.ServiceType, runtimeBundleProperties.ServiceVersion); eventPublisher.PublishEvent(@event); }
/// <summary> /// /// </summary> /// <param name="execution"></param> public override void Execute(IExecutionEntity execution) { IIntegrationContextEntity integrationContext = StoreIntegrationContext(execution); PublishSpringEvent(execution, integrationContext); }
public virtual void deleteIntegrationContext(IIntegrationContextEntity integrationContextEntity) { commandExecutor.Execute(new DeleteIntegrationContextCmd(integrationContextEntity)); }