Search in sources :

Example 6 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 7 with VariableType

use of org.activiti.engine.impl.variable.VariableType in project Activiti by Activiti.

the class IbatisVariableTypeHandler method getResult.

public VariableType getResult(ResultSet resultSet, int columnIndex) throws SQLException {
    String typeName = resultSet.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 8 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 ((variableInstance != null) && (!variableInstance.getType().equals(newType))) {
        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)

Aggregations

VariableType (org.activiti.engine.impl.variable.VariableType)8 ActivitiException (org.activiti.engine.ActivitiException)3 BooleanType (org.activiti.engine.impl.variable.BooleanType)2 DateType (org.activiti.engine.impl.variable.DateType)2 DoubleType (org.activiti.engine.impl.variable.DoubleType)2 IntegerType (org.activiti.engine.impl.variable.IntegerType)2 JPAEntityListVariableType (org.activiti.engine.impl.variable.JPAEntityListVariableType)2 JPAEntityVariableType (org.activiti.engine.impl.variable.JPAEntityVariableType)2 LongStringType (org.activiti.engine.impl.variable.LongStringType)2 LongType (org.activiti.engine.impl.variable.LongType)2 SerializableType (org.activiti.engine.impl.variable.SerializableType)2 ShortType (org.activiti.engine.impl.variable.ShortType)2 StringType (org.activiti.engine.impl.variable.StringType)2 UUIDType (org.activiti.engine.impl.variable.UUIDType)2 VariableTypes (org.activiti.engine.impl.variable.VariableTypes)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 UUID (java.util.UUID)1