Search in sources :

Example 11 with VariableType

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;
}
Also used : ActivitiException(org.activiti.engine.ActivitiException) VariableType(org.activiti.engine.impl.variable.VariableType)

Example 12 with VariableType

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);
}
Also used : VariableTypes(org.activiti.engine.impl.variable.VariableTypes) VariableType(org.activiti.engine.impl.variable.VariableType)

Example 13 with VariableType

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);
}
Also used : CustomStringVariableType(org.alfresco.repo.workflow.activiti.variable.CustomStringVariableType) VariableType(org.activiti.engine.impl.variable.VariableType) CustomStringVariableType(org.alfresco.repo.workflow.activiti.variable.CustomStringVariableType)

Aggregations

VariableType (org.activiti.engine.impl.variable.VariableType)13 LongStringType (org.activiti.engine.impl.variable.LongStringType)4 StringType (org.activiti.engine.impl.variable.StringType)4 VariableTypes (org.activiti.engine.impl.variable.VariableTypes)4 ActivitiException (org.activiti.engine.ActivitiException)3 BooleanType (org.activiti.engine.impl.variable.BooleanType)3 DateType (org.activiti.engine.impl.variable.DateType)3 DefaultVariableTypes (org.activiti.engine.impl.variable.DefaultVariableTypes)3 DoubleType (org.activiti.engine.impl.variable.DoubleType)3 IntegerType (org.activiti.engine.impl.variable.IntegerType)3 LongType (org.activiti.engine.impl.variable.LongType)3 SerializableType (org.activiti.engine.impl.variable.SerializableType)3 ShortType (org.activiti.engine.impl.variable.ShortType)3 UUIDType (org.activiti.engine.impl.variable.UUIDType)3 ItemInstance (org.activiti.engine.impl.bpmn.data.ItemInstance)2 MessageInstance (org.activiti.engine.impl.bpmn.webservice.MessageInstance)2 ByteArrayType (org.activiti.engine.impl.variable.ByteArrayType)2 CustomObjectType (org.activiti.engine.impl.variable.CustomObjectType)2 JPAEntityListVariableType (org.activiti.engine.impl.variable.JPAEntityListVariableType)2 JPAEntityVariableType (org.activiti.engine.impl.variable.JPAEntityVariableType)2