use of org.camunda.bpm.engine.impl.core.variable.CoreVariableInstance in project camunda-bpm-platform by camunda.
the class CaseExecutionEntity method remove.
// delete/remove ///////////////////////////////////////////////////////
@SuppressWarnings({ "unchecked", "rawtypes" })
public void remove() {
super.remove();
for (VariableInstanceEntity variableInstance : variableStore.getVariables()) {
invokeVariableLifecycleListenersDelete(variableInstance, this, Arrays.<VariableInstanceLifecycleListener<CoreVariableInstance>>asList((VariableInstanceLifecycleListener) VariableInstanceEntityPersistenceListener.INSTANCE));
variableStore.removeVariable(variableInstance.getName());
}
CommandContext commandContext = Context.getCommandContext();
for (CaseSentryPartEntity sentryPart : getCaseSentryParts()) {
commandContext.getCaseSentryPartManager().deleteSentryPart(sentryPart);
}
// finally delete this execution
commandContext.getCaseExecutionManager().deleteCaseExecution(this);
}
use of org.camunda.bpm.engine.impl.core.variable.CoreVariableInstance in project camunda-bpm-platform by camunda.
the class ExecutionEntity method moveVariableTo.
protected void moveVariableTo(VariableInstanceEntity variable, ExecutionEntity other) {
if (other.variableStore.containsKey(variable.getName())) {
CoreVariableInstance existingInstance = other.variableStore.getVariable(variable.getName());
existingInstance.setValue(variable.getTypedValue(false));
invokeVariableLifecycleListenersUpdate(existingInstance, this);
invokeVariableLifecycleListenersDelete(variable, this, Collections.singletonList(getVariablePersistenceListener()));
} else {
other.variableStore.addVariable(variable);
}
}
use of org.camunda.bpm.engine.impl.core.variable.CoreVariableInstance in project camunda-bpm-platform by camunda.
the class AbstractVariableScope method setVariableLocalTransient.
/**
* Sets a variable in the local scope. In contrast to
* {@link #setVariableLocal(String, Object)}, the variable is transient that
* means it will not be stored in the data base. For example, a transient
* variable can be used for a result variable that is only available for
* output mapping.
*/
public void setVariableLocalTransient(String variableName, Object value) {
TypedValue typedValue = Variables.untypedValue(value);
checkJavaSerialization(variableName, typedValue);
CoreVariableInstance coreVariableInstance = getVariableInstanceFactory().build(variableName, typedValue, true);
getVariableStore().addVariable(coreVariableInstance);
}
use of org.camunda.bpm.engine.impl.core.variable.CoreVariableInstance in project camunda-bpm-platform by camunda.
the class AbstractVariableScope method initializeVariableStore.
public void initializeVariableStore(Map<String, Object> variables) {
for (String variableName : variables.keySet()) {
TypedValue value = Variables.untypedValue(variables.get(variableName));
CoreVariableInstance variableValue = getVariableInstanceFactory().build(variableName, value, false);
getVariableStore().addVariable(variableValue);
}
}
use of org.camunda.bpm.engine.impl.core.variable.CoreVariableInstance in project camunda-bpm-platform by camunda.
the class AbstractVariableScope method removeVariableLocal.
protected void removeVariableLocal(String variableName, AbstractVariableScope sourceActivityExecution) {
if (getVariableStore().containsKey(variableName)) {
CoreVariableInstance variableInstance = getVariableStore().getVariable(variableName);
invokeVariableLifecycleListenersDelete(variableInstance, sourceActivityExecution);
getVariableStore().removeVariable(variableName);
}
}
Aggregations