Search in sources :

Example 1 with PaaSWorkflowMonitorEvent

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);
}
Also used : PaaSWorkflowMonitorEvent(alien4cloud.paas.model.PaaSWorkflowMonitorEvent)

Example 2 with PaaSWorkflowMonitorEvent

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());
        }
    }
}
Also used : AbstractPaaSWorkflowMonitorEvent(alien4cloud.paas.model.AbstractPaaSWorkflowMonitorEvent) PaaSWorkflowMonitorEvent(alien4cloud.paas.model.PaaSWorkflowMonitorEvent) Deployment(alien4cloud.model.deployment.Deployment)

Aggregations

PaaSWorkflowMonitorEvent (alien4cloud.paas.model.PaaSWorkflowMonitorEvent)2 Deployment (alien4cloud.model.deployment.Deployment)1 AbstractPaaSWorkflowMonitorEvent (alien4cloud.paas.model.AbstractPaaSWorkflowMonitorEvent)1