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);
}
}
Aggregations