mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Fixed ALF-10851: GET workflow-instances REST API is returning completed workflows (should only be returning in progress workflows)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31734 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -67,6 +67,12 @@ public class WorkflowInstancesGet extends AbstractWorkflowWebscript
|
||||
// state is not included into filters list as it will be taken into account before filtering
|
||||
WorkflowState state = getState(req);
|
||||
|
||||
// if no state is provided default to ACTIVE workflows only (ALF-10851)
|
||||
if (state == null)
|
||||
{
|
||||
state = WorkflowState.ACTIVE;
|
||||
}
|
||||
|
||||
// get filter param values
|
||||
Map<String, Object> filters = new HashMap<String, Object>(9);
|
||||
filters.put(PARAM_INITIATOR, req.getParameter(PARAM_INITIATOR));
|
||||
@@ -96,12 +102,8 @@ public class WorkflowInstancesGet extends AbstractWorkflowWebscript
|
||||
|
||||
List<WorkflowInstance> workflows;
|
||||
|
||||
// list workflows for specified workflow definition
|
||||
if(state == null)
|
||||
{
|
||||
workflows = workflowService.getWorkflows(workflowDefinitionId);
|
||||
}
|
||||
else if (state == WorkflowState.ACTIVE)
|
||||
// get workflows, if definition id is null all workflows are returned
|
||||
if (state == WorkflowState.ACTIVE)
|
||||
{
|
||||
workflows = workflowService.getActiveWorkflows(workflowDefinitionId);
|
||||
}
|
||||
|
Reference in New Issue
Block a user