Search in sources :

Example 1 with VariableInstanceEntity

use of org.activiti.engine.impl.persistence.entity.VariableInstanceEntity in project Activiti by Activiti.

the class GetTasksLocalVariablesCmd method execute.

@Override
public List<VariableInstance> execute(CommandContext commandContext) {
    if (taskIds == null) {
        throw new ActivitiIllegalArgumentException("taskIds is null");
    }
    if (taskIds.isEmpty()) {
        throw new ActivitiIllegalArgumentException("Set of taskIds is empty");
    }
    List<VariableInstance> instances = new ArrayList<VariableInstance>();
    List<VariableInstanceEntity> entities = commandContext.getVariableInstanceEntityManager().findVariableInstancesByTaskIds(taskIds);
    for (VariableInstanceEntity entity : entities) {
        entity.getValue();
        instances.add(entity);
    }
    return instances;
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) ArrayList(java.util.ArrayList) VariableInstanceEntity(org.activiti.engine.impl.persistence.entity.VariableInstanceEntity) VariableInstance(org.activiti.engine.impl.persistence.entity.VariableInstance)

Example 2 with VariableInstanceEntity

use of org.activiti.engine.impl.persistence.entity.VariableInstanceEntity in project Activiti by Activiti.

the class GetExecutionsVariablesCmd method execute.

@Override
public List<VariableInstance> execute(CommandContext commandContext) {
    // Verify existance of executions
    if (executionIds == null) {
        throw new ActivitiIllegalArgumentException("executionIds is null");
    }
    if (executionIds.isEmpty()) {
        throw new ActivitiIllegalArgumentException("Set of executionIds is empty");
    }
    List<VariableInstance> instances = new ArrayList<VariableInstance>();
    List<VariableInstanceEntity> entities = commandContext.getVariableInstanceEntityManager().findVariableInstancesByExecutionIds(executionIds);
    for (VariableInstanceEntity entity : entities) {
        entity.getValue();
        instances.add(entity);
    }
    return instances;
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) ArrayList(java.util.ArrayList) VariableInstanceEntity(org.activiti.engine.impl.persistence.entity.VariableInstanceEntity) VariableInstance(org.activiti.engine.impl.persistence.entity.VariableInstance)

Aggregations

ArrayList (java.util.ArrayList)2 ActivitiIllegalArgumentException (org.activiti.engine.ActivitiIllegalArgumentException)2 VariableInstance (org.activiti.engine.impl.persistence.entity.VariableInstance)2 VariableInstanceEntity (org.activiti.engine.impl.persistence.entity.VariableInstanceEntity)2