Search in sources :

Example 1 with DeployedWorkflow

use of io.zeebe.broker.workflow.map.DeployedWorkflow in project zeebe by zeebe-io.

the class WorkflowInstanceStreamProcessor method getCurrentActivity.

protected <T extends FlowElement> T getCurrentActivity() {
    final long workflowKey = workflowInstanceEvent.getWorkflowKey();
    final DeployedWorkflow deployedWorkflow = workflowDeploymentCache.getWorkflow(workflowKey);
    if (deployedWorkflow != null) {
        final DirectBuffer currentActivityId = workflowInstanceEvent.getActivityId();
        final Workflow workflow = deployedWorkflow.getWorkflow();
        return workflow.findFlowElementById(currentActivityId);
    } else {
        throw new RuntimeException("No workflow found for key: " + workflowKey);
    }
}
Also used : MutableDirectBuffer(org.agrona.MutableDirectBuffer) DirectBuffer(org.agrona.DirectBuffer) DeployedWorkflow(io.zeebe.broker.workflow.map.DeployedWorkflow) DeployedWorkflow(io.zeebe.broker.workflow.map.DeployedWorkflow)

Aggregations

DeployedWorkflow (io.zeebe.broker.workflow.map.DeployedWorkflow)1 DirectBuffer (org.agrona.DirectBuffer)1 MutableDirectBuffer (org.agrona.MutableDirectBuffer)1