本文整理汇总了Java中org.camunda.bpm.engine.variable.VariableMap.remove方法的典型用法代码示例。如果您正苦于以下问题:Java VariableMap.remove方法的具体用法?Java VariableMap.remove怎么用?Java VariableMap.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.variable.VariableMap
的用法示例。
在下文中一共展示了VariableMap.remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: submitFormProperty
import org.camunda.bpm.engine.variable.VariableMap; //导入方法依赖的package包/类
public void submitFormProperty(VariableScope variableScope, VariableMap variables) {
if (!isWritable && variables.containsKey(id)) {
throw new ProcessEngineException("form property '"+id+"' is not writable");
}
if (isRequired && !variables.containsKey(id) && defaultExpression == null) {
throw new ProcessEngineException("form property '"+id+"' is required");
}
Object modelValue = null;
if (variables.containsKey(id)) {
final Object propertyValue = variables.remove(id);
if (type != null) {
modelValue = type.convertFormValueToModelValue(propertyValue);
} else {
modelValue = propertyValue;
}
} else if (defaultExpression != null) {
final Object expressionValue = defaultExpression.getValue(variableScope);
if (type != null && expressionValue != null) {
modelValue = type.convertFormValueToModelValue(expressionValue.toString());
} else if (expressionValue != null) {
modelValue = expressionValue.toString();
} else if (isRequired) {
throw new ProcessEngineException("form property '"+id+"' is required");
}
}
if (modelValue != null) {
if (variableName != null) {
variableScope.setVariable(variableName, modelValue);
} else if (variableExpression != null) {
variableExpression.setValue(modelValue, variableScope);
} else {
variableScope.setVariable(id, modelValue);
}
}
}
示例2: handleSubmit
import org.camunda.bpm.engine.variable.VariableMap; //导入方法依赖的package包/类
public void handleSubmit(VariableScope variableScope, VariableMap values, VariableMap allValues) {
TypedValue submittedValue = (TypedValue) values.getValueTyped(id);
values.remove(id);
// perform validation
for (FormFieldValidationConstraintHandler validationHandler : validationHandlers) {
Object value = null;
if(submittedValue != null) {
value = submittedValue.getValue();
}
validationHandler.validate(value, allValues, this, variableScope);
}
// update variable(s)
TypedValue modelValue = null;
if (submittedValue != null) {
if (type != null) {
modelValue = type.convertToModelValue(submittedValue);
}
else {
modelValue = submittedValue;
}
}
else if (defaultValueExpression != null) {
final TypedValue expressionValue = Variables.untypedValue(defaultValueExpression.getValue(variableScope));
if (type != null) {
// first, need to convert to model value since the default value may be a String Constant specified in the model xml.
modelValue = type.convertToModelValue(Variables.untypedValue(expressionValue));
}
else if (expressionValue != null) {
modelValue = Variables.stringValue(expressionValue.getValue().toString());
}
}
if (modelValue != null) {
if (id != null) {
variableScope.setVariable(id, modelValue);
}
}
}
示例3: filterVariables
import org.camunda.bpm.engine.variable.VariableMap; //导入方法依赖的package包/类
protected VariableMap filterVariables(VariableMap variables) {
if (variables != null) {
for (String key : variablesFilter) {
variables.remove(key);
}
}
return variables;
}