What I came up with in the end was to use a TaskActivityBehaviour class which combines both service and receive tasks in to one step. Then as each document finishes rendering (receiving a JMS message), I can then signal from the JMS on message to the waiting activiti step.
<code>public class SnsStep extends TaskActivityBehavior {
private final Logger log = LoggerFactory.getLogger(getClass());
@Override
public void execute(ActivityExecution execution) throws Exception {
log.info("Running Step " + execution.getCurrentActivityName());
}
@Override
public void signal(ActivityExecution execution, String signalName, Object signalData) throws Exception {
leave(execution);
}
}
<code>
Is using the TaskActivityBehavior the ideal way to do this?