如何在JBPM 5.4 Final中获得任务

时间:2014-02-04 07:10:35

标签: java jbpm bpm bpmn

我正在进行jBpm流程。我已经为每个演员确定了车道,但是我没有看到如何在运行时找出哪个演员与任务相关的方法。

到目前为止,我所知道的是如何找出存在的车道:

    @Override
    public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) {
        WorkflowProcessInstance wpi = (WorkflowProcessInstance) event.getProcessInstance();
        SwimlaneContextInstance slci = (SwimlaneContextInstance) wpi.getContextInstance(SwimlaneContext.SWIMLANE_SCOPE);
        SwimlaneContext swimlaneContext = slci.getSwimlaneContext();

        Collection<Swimlane> swimlanes = swimlaneContext.getSwimlanes();
    }

但我无法找出目前属于哪条车道

关于如何获取任务的通道名称/演员的任何想法?

1 个答案:

答案 0 :(得分:0)

好的,我在节点的元数据中找到了它......

event.getNodeInstance().getNode().getMetaData().get("Lane");

@Override
public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) {
        log.info("before node triggered " + event.getNodeInstance().getNodeName());
        log.info("   in lane " + event.getNodeInstance().getNode().getMetaData().get("Lane"));
}