use of org.activiti.engine.impl.variable.VariableType in project Activiti by Activiti.
the class IbatisVariableTypeHandler method getResult.
public VariableType getResult(CallableStatement cs, int columnIndex) throws SQLException {
String typeName = cs.getString(columnIndex);
VariableType type = getVariableTypes().getVariableType(typeName);
if (type == null) {
throw new ActivitiException("unknown variable type name " + typeName);
}
return type;
}
use of org.activiti.engine.impl.variable.VariableType in project Activiti by Activiti.
the class VariableScopeImpl method updateVariableInstance.
protected void updateVariableInstance(VariableInstanceEntity variableInstance, Object value, ExecutionEntity sourceActivityExecution) {
// Always check if the type should be altered. It's possible that the
// previous type is lower in the type
// checking chain (e.g. serializable) and will return true on
// isAbleToStore(), even though another type
// higher in the chain is eligible for storage.
VariableTypes variableTypes = Context.getProcessEngineConfiguration().getVariableTypes();
VariableType newType = variableTypes.findVariableType(value);
if (newType != null && !newType.equals(variableInstance.getType())) {
variableInstance.setValue(null);
variableInstance.setType(newType);
variableInstance.forceUpdate();
variableInstance.setValue(value);
} else {
variableInstance.setValue(value);
}
Context.getCommandContext().getHistoryManager().recordHistoricDetailVariableCreate(variableInstance, sourceActivityExecution, isActivityIdUsedForDetails());
Context.getCommandContext().getHistoryManager().recordVariableUpdate(variableInstance);
}
use of org.activiti.engine.impl.variable.VariableType in project alfresco-repository by Alfresco.
the class AlfrescoProcessEngineConfiguration method initVariableTypes.
@Override
protected void initVariableTypes() {
super.initVariableTypes();
// Add custom types before SerializableType
if (customTypes != null) {
int serializableIndex = variableTypes.getTypeIndex(SerializableType.TYPE_NAME);
for (VariableType type : customTypes) {
variableTypes.addType(type, serializableIndex);
}
}
// WOR-171: Replace string type by custom one to handle large text-values
int stringIndex = variableTypes.getTypeIndex("string");
variableTypes.removeType(variableTypes.getVariableType("string"));
variableTypes.addType(new CustomStringVariableType(), stringIndex);
}
Aggregations