mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
105791: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud) 105689: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.3) 105571: Merged DEV to V4.2-BUG-FIX (4.2.5) 103740: MNT-13855: Completing a a workflow on Mobile results in "Approve" being reported as "Rejected" in Alfresco 4.2.3 and 5.0, and no result in 4.2.1 - Updated sequence of actions to complete a task. 104919: MNT-13855: Completing a a workflow on Mobile results in "Approve" being reported as "Rejected" in Alfresco 4.2.3 and 5.0, and no result in 4.2.1 - Implemented unit test. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@105946 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -55,6 +55,7 @@ import org.alfresco.rest.api.tests.PersonInfo;
|
||||
import org.alfresco.rest.api.tests.RepoService.TestNetwork;
|
||||
import org.alfresco.rest.api.tests.RepoService.TestPerson;
|
||||
import org.alfresco.rest.api.tests.RepoService.TestSite;
|
||||
import org.alfresco.rest.api.tests.client.HttpResponse;
|
||||
import org.alfresco.rest.api.tests.client.PublicApiException;
|
||||
import org.alfresco.rest.api.tests.client.RequestContext;
|
||||
import org.alfresco.rest.api.tests.client.data.MemberOfSite;
|
||||
@@ -1055,6 +1056,29 @@ public class TaskWorkflowApiTest extends EnterpriseWorkflowTestApi
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testSetOutcome() throws Exception
|
||||
{
|
||||
RequestContext requestContext = initApiClientWithTestUser();
|
||||
ProcessInfo processInf = startReviewPooledProcess(requestContext);
|
||||
Task task = activitiProcessEngine.getTaskService().createTaskQuery().processInstanceId(processInf.getId()).singleResult();
|
||||
TasksClient tasksClient = publicApiClient.tasksClient();
|
||||
activitiProcessEngine.getTaskService().saveTask(task);
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("select", "state,variables");
|
||||
HttpResponse response = tasksClient.update("tasks",
|
||||
task.getId(),
|
||||
null,
|
||||
null,
|
||||
"{\"state\":\"completed\",\"variables\":[{\"name\":\"wf_reviewOutcome\",\"value\":\"Approve\",\"scope\":\"local\"},{\"name\":\"bpm_comment\",\"value\":\"approved by me\",\"scope\":\"local\"}]}",
|
||||
"Failed to update task", params);
|
||||
assertEquals(200, response.getStatusCode());
|
||||
HistoricTaskInstance historyTask = activitiProcessEngine.getHistoryService().createHistoricTaskInstanceQuery().taskId(task.getId()).includeProcessVariables().includeTaskLocalVariables().singleResult();
|
||||
String outcome = (String) historyTask.getTaskLocalVariables().get("bpm_outcome");
|
||||
assertEquals("Approve", outcome);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testResolveTask() throws Exception
|
||||
|
Reference in New Issue
Block a user