Question

I'm working on a jBpm process. I've defined lanes for every Actor but I don't see a way how to find out at runtime which actor is related to a task.

What I know so far is how to find out which lanes are existing:

    @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();
    }

But I can't find out which lane is currently belongs to which

Any ideas on how to get the lane name/actor of a task?

Was it helpful?

Solution

Ok I found it ... in the metadata of the node

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"));
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top