Get "Called Element" in call activity

image

Can you get the name of “Called Element” from a call activity?

@CRA You can get called element attribute from BpmnModelElementInstance

Here’s a sample code:

@Slf4j
@Component
public class CallActivityListener implements ExecutionListener {

	@Override
	public void notify(DelegateExecution execution) throws Exception {
		FlowElement flowElement = execution.getBpmnModelElementInstance();
		CallActivity callActivity = (CallActivityImpl) flowElement;
		String calledElement = callActivity.getCalledElement();
		execution.setVariable("calledElement", calledElement);
		log.info("Called element: {}", calledElement);
	}
}

Here’s the attached bpmn file: callActivityTest.bpmn (5.3 KB)

1 Like