Search in sources :

Example 1 with TaskIdentifier

use of org.apache.airavata.model.messaging.event.TaskIdentifier 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();
    }
}
Also used : TaskStatusChangeEvent(org.apache.airavata.model.messaging.event.TaskStatusChangeEvent) WorkflowIdentifier(org.apache.airavata.model.messaging.event.WorkflowIdentifier) TaskIdentifier(org.apache.airavata.model.messaging.event.TaskIdentifier) ExperimentStatusChangeEvent(org.apache.airavata.model.messaging.event.ExperimentStatusChangeEvent) JobStatusChangeEvent(org.apache.airavata.model.messaging.event.JobStatusChangeEvent) JobIdentifier(org.apache.airavata.model.messaging.event.JobIdentifier) WorkflowNodeStatusChangeEvent(org.apache.airavata.model.messaging.event.WorkflowNodeStatusChangeEvent)

Aggregations

ExperimentStatusChangeEvent (org.apache.airavata.model.messaging.event.ExperimentStatusChangeEvent)1 JobIdentifier (org.apache.airavata.model.messaging.event.JobIdentifier)1 JobStatusChangeEvent (org.apache.airavata.model.messaging.event.JobStatusChangeEvent)1 TaskIdentifier (org.apache.airavata.model.messaging.event.TaskIdentifier)1 TaskStatusChangeEvent (org.apache.airavata.model.messaging.event.TaskStatusChangeEvent)1 WorkflowIdentifier (org.apache.airavata.model.messaging.event.WorkflowIdentifier)1 WorkflowNodeStatusChangeEvent (org.apache.airavata.model.messaging.event.WorkflowNodeStatusChangeEvent)1