use of org.apache.airavata.model.messaging.event.WorkflowNodeStatusChangeEvent in project airavata by apache.
the class EventData method process.
private void process(MessageContext event) {
this.messageId = event.getMessageId();
if (event.getType() == MessageType.EXPERIMENT) {
ExperimentStatusChangeEvent experimentStatusChangeEvent = (ExperimentStatusChangeEvent) event.getEvent();
this.status = experimentStatusChangeEvent.getState().toString();
this.experimentId = experimentStatusChangeEvent.getExperimentId();
this.workflowNodeId = "";
this.message = "Received experiment event , expId : " + experimentStatusChangeEvent.getExperimentId() + ", status : " + experimentStatusChangeEvent.getState().toString();
} else if (event.getType() == MessageType.WORKFLOWNODE) {
WorkflowNodeStatusChangeEvent wfnStatusChangeEvent = (WorkflowNodeStatusChangeEvent) event.getEvent();
WorkflowIdentifier wfIdentifier = wfnStatusChangeEvent.getWorkflowNodeIdentity();
this.status = wfnStatusChangeEvent.getState().toString();
this.experimentId = wfIdentifier.getExperimentId();
this.workflowNodeId = wfIdentifier.getWorkflowNodeId();
this.message = "Received workflow status change event, expId : " + wfIdentifier.getExperimentId() + ", nodeId : " + wfIdentifier.getWorkflowNodeId() + " , status : " + wfnStatusChangeEvent.getState().toString();
} else if (event.getType() == MessageType.TASK) {
TaskStatusChangeEvent taskStatusChangeEvent = (TaskStatusChangeEvent) event.getEvent();
TaskIdentifier taskIdentifier = taskStatusChangeEvent.getTaskIdentity();
this.status = taskStatusChangeEvent.getState().toString();
this.experimentId = taskIdentifier.getExperimentId();
this.workflowNodeId = taskIdentifier.getWorkflowNodeId();
this.message = "Received task event , expId : " + taskIdentifier.getExperimentId() + ",taskId : " + taskIdentifier.getTaskId() + ", wfNodeId : " + taskIdentifier.getWorkflowNodeId() + ", status : " + taskStatusChangeEvent.getState().toString();
} else if (event.getType() == MessageType.JOB) {
JobStatusChangeEvent jobStatusChangeEvent = (JobStatusChangeEvent) event.getEvent();
JobIdentifier jobIdentifier = jobStatusChangeEvent.getJobIdentity();
this.status = jobStatusChangeEvent.getState().toString();
this.experimentId = jobIdentifier.getExperimentId();
this.workflowNodeId = jobIdentifier.getWorkflowNodeId();
this.message = "Received task event , expId : " + jobIdentifier.getExperimentId() + " ,taskId : " + jobIdentifier.getTaskId() + ", wfNodeId : " + jobIdentifier.getWorkflowNodeId() + ", status : " + jobStatusChangeEvent.getState().toString();
}
}
Aggregations