io.takari.bpm.api.interceptors.InterceptorStartEvent Maven / Gradle / Ivy
package io.takari.bpm.api.interceptors;
import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class InterceptorStartEvent implements Serializable {
private static final long serialVersionUID = 1L;
private final String processBusinessKey;
private final String processDefinitionId;
private final UUID executionId;
private final Map variables;
public InterceptorStartEvent(String processBusinessKey, String processDefinitionId, UUID executionId, Map variables) {
this.processBusinessKey = processBusinessKey;
this.processDefinitionId = processDefinitionId;
this.executionId = executionId;
// TODO deep-copy the variables map
this.variables = variables != null ? new HashMap<>(variables) : Collections.emptyMap();
}
public String getProcessBusinessKey() {
return processBusinessKey;
}
public String getProcessDefinitionId() {
return processDefinitionId;
}
public UUID getExecutionId() {
return executionId;
}
public Collection getVariableNames() {
return variables.keySet();
}
/**
* Returns a value of the process variable. WARNING: returning value is
* no a copy — modifying it is not recommended and could affect the
* internal state of the process.
* @param name
* @return
*/
public Object getVariable(String name) {
return variables.get(name);
}
}