use of alien4cloud.paas.model.PaaSWorkflowMonitorEvent in project yorc-a4c-plugin by ystia.
the class YorcPaaSProvider method workflowStarted.
/**
* Notify a4c that a workflow has been started
* @param paasId
* @param workflow
* @param subworkflow
*/
protected void workflowStarted(String paasId, String workflow, String subworkflow) {
PaaSWorkflowMonitorEvent event = new PaaSWorkflowMonitorEvent();
// TODO
event.setSubworkflow(subworkflow);
event.setWorkflowId(workflow);
postEvent(event, paasId);
}
use of alien4cloud.paas.model.PaaSWorkflowMonitorEvent in project alien4cloud by alien4cloud.
the class WorkflowEventHandler method send.
protected void send(AbstractMonitorEvent event) {
String eventType = MappingBuilder.indexTypeFromClass(event.getClass());
String topicName = TOPIC_PREFIX + '/' + event.getDeploymentId() + '/' + eventType;
if (log.isDebugEnabled()) {
log.debug("Send [" + event.getClass().getSimpleName() + "] to [" + topicName + "]: " + event);
}
template.convertAndSend(topicName, event);
if (event instanceof PaaSWorkflowMonitorEvent) {
Deployment deployment = alienDAO.findById(Deployment.class, event.getDeploymentId());
if (deployment != null) {
PaaSWorkflowMonitorEvent pwme = (PaaSWorkflowMonitorEvent) event;
if (log.isDebugEnabled()) {
log.debug("Workflow {} started with executionId {} (subkworkflow: {})", pwme.getWorkflowId(), pwme.getExecutionId(), pwme.getSubworkflow());
}
String workflowId = pwme.getWorkflowId();
if (pwme.getSubworkflow() != null) {
workflowId = pwme.getSubworkflow();
}
updateDeploymentExecutionId(deployment, workflowId, pwme.getExecutionId());
}
}
}
Aggregations