I think this is the right track. Here’s how I’m trying to implement it (feel free to point and laugh, I’m new to a lot of this).
The process listener class:
…
@ProcessApplication(“Process_Xhist”)
public class Process_xhist_Impl extends ServletProcessApplication{
public ExecutionListener getExecutionListener() {
return new SendProcessVariableHistoryActivityListener();
}
public DmnDecisionTableEvaluationListener getDecisionListener() {
return new SendProcessVariableHistoryDecisionListener();
}
}
I’m not sure about the “getDecisionListener” above. The previous block for the activity listener works fine, I’m not sure what the equivalent would be for DMN evaluation, so I guessed.
The listener class:
import org.camunda.bpm.dmn.engine.delegate.DmnDecisionTableEvaluationEvent;
import org.camunda.bpm.dmn.engine.delegate.DmnDecisionTableEvaluationListener;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.VariableScope;
import com.att.gcs.bizops.cop.SendProcessVariableHistory;
public class SendProcessVariableHistoryDecisionListener implements DmnDecisionTableEvaluationListener {
@SuppressWarnings("static-access")
public void notify(DmnDecisionTableEvaluationEvent evaluationEvent) {
// Instantiate an object to hold the history record call
SendProcessVariableHistory newHistoryRecord = new SendProcessVariableHistory();
// Call the send process history variable class using the current activity and event "names"
newHistoryRecord.recordProcessVariableHistory((DelegateExecution) evaluationEvent, ((DelegateExecution) evaluationEvent).getCurrentActivityId() + ":" + "decision");
}
}
Again, I’m not sure about the above as it’s based upon my activity listener, which works. I’m ignorant, so I’m just following the activity listener code that works.
Now if only there was an equivalent for incidents…
Thanks.