Search in sources :

Example 31 with WorkflowTaskQuery

use of org.alfresco.service.cmr.workflow.WorkflowTaskQuery in project alfresco-repository by Alfresco.

the class AbstractWorkflowServiceIntegrationTest method createWorkflowTaskQuery.

protected WorkflowTaskQuery createWorkflowTaskQuery(WorkflowTaskState state) {
    WorkflowTaskQuery taskQuery = new WorkflowTaskQuery();
    taskQuery.setTaskState(state);
    return taskQuery;
}
Also used : WorkflowTaskQuery(org.alfresco.service.cmr.workflow.WorkflowTaskQuery)

Example 32 with WorkflowTaskQuery

use of org.alfresco.service.cmr.workflow.WorkflowTaskQuery in project alfresco-repository by Alfresco.

the class ActivitiTaskComponentTest method createWorkflowTaskQuery.

private WorkflowTaskQuery createWorkflowTaskQuery(WorkflowTaskState state) {
    WorkflowTaskQuery taskQuery = new WorkflowTaskQuery();
    taskQuery.setTaskState(state);
    return taskQuery;
}
Also used : WorkflowTaskQuery(org.alfresco.service.cmr.workflow.WorkflowTaskQuery)

Example 33 with WorkflowTaskQuery

use of org.alfresco.service.cmr.workflow.WorkflowTaskQuery in project alfresco-repository by Alfresco.

the class ActivitiTaskComponentTest method checkTaskVariableNoMatch.

private void checkTaskVariableNoMatch(WorkflowTaskState state, QName varName, Object varValue) {
    WorkflowTaskQuery taskQuery = createWorkflowTaskQuery(state);
    Map<QName, Object> customProperties = new HashMap<QName, Object>();
    customProperties.put(varName, varValue);
    taskQuery.setTaskCustomProps(customProperties);
    assertNoTaskPresent(taskQuery);
}
Also used : HashMap(java.util.HashMap) QName(org.alfresco.service.namespace.QName) WorkflowTaskQuery(org.alfresco.service.cmr.workflow.WorkflowTaskQuery)

Example 34 with WorkflowTaskQuery

use of org.alfresco.service.cmr.workflow.WorkflowTaskQuery in project alfresco-repository by Alfresco.

the class ActivitiTaskComponentTest method testQueryUsingNodeRef.

@Test
public void testQueryUsingNodeRef() {
    NodeRef nodeRef = new NodeRef("workspace:///someRef");
    QName nodeRefPropQname = QName.createQName("testProp");
    HashMap<QName, Serializable> props = new HashMap<QName, Serializable>();
    props.put(nodeRefPropQname, nodeRef);
    // Start the workflow-path
    workflowEngine.startWorkflow(workflowDef.getId(), props);
    // Test querying with a value of type NodeRef
    WorkflowTaskQuery taskQuery = createWorkflowTaskQuery(WorkflowTaskState.IN_PROGRESS);
    HashMap<QName, Object> queryParams = new HashMap<QName, Object>();
    queryParams.put(nodeRefPropQname, nodeRef);
    taskQuery.setProcessCustomProps(queryParams);
    List<WorkflowTask> tasks = workflowEngine.queryTasks(taskQuery);
    assertNotNull(tasks);
    assertEquals(1, tasks.size());
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) Serializable(java.io.Serializable) HashMap(java.util.HashMap) QName(org.alfresco.service.namespace.QName) WorkflowTask(org.alfresco.service.cmr.workflow.WorkflowTask) WorkflowTaskQuery(org.alfresco.service.cmr.workflow.WorkflowTaskQuery) Test(org.junit.Test)

Aggregations

WorkflowTaskQuery (org.alfresco.service.cmr.workflow.WorkflowTaskQuery)34 WorkflowTask (org.alfresco.service.cmr.workflow.WorkflowTask)20 HashMap (java.util.HashMap)14 QName (org.alfresco.service.namespace.QName)14 Serializable (java.io.Serializable)9 ArrayList (java.util.ArrayList)6 WorkflowPath (org.alfresco.service.cmr.workflow.WorkflowPath)5 Test (org.junit.Test)5 NodeRef (org.alfresco.service.cmr.repository.NodeRef)4 WorkflowDefinition (org.alfresco.service.cmr.workflow.WorkflowDefinition)4 Map (java.util.Map)3 Task (org.activiti.engine.task.Task)3 Date (java.util.Date)2 List (java.util.List)2 FacesContext (javax.faces.context.FacesContext)2 UserTransaction (javax.transaction.UserTransaction)2 TaskQuery (org.activiti.engine.task.TaskQuery)2 WorkflowInstance (org.alfresco.service.cmr.workflow.WorkflowInstance)2 WorkflowTaskState (org.alfresco.service.cmr.workflow.WorkflowTaskState)2 WorkflowTransition (org.alfresco.service.cmr.workflow.WorkflowTransition)2