use of io.crnk.activiti.example.model.ScheduleApprovalProcessInstance in project crnk-framework by crnk-project.
the class ProcessInstanceRepositoryTest method addProcessInstance.
private ProcessInstance addProcessInstance() {
ScheduleApprovalValues newValues = new ScheduleApprovalValues();
newValues.setName("newName");
ScheduleApprovalProcessInstance resource = new ScheduleApprovalProcessInstance();
resource.setResourceType("schedules");
resource.setResourceId("12");
resource.setNewValues(newValues);
Map<String, Object> processVariables = resourceMapper.mapToVariables(resource);
runtimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("scheduleChange", "testBusinessKey", processVariables);
runtimeService.setProcessInstanceName(processInstance.getId(), "testName");
processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance.getId()).includeProcessVariables().singleResult();
return processInstance;
}
use of io.crnk.activiti.example.model.ScheduleApprovalProcessInstance in project crnk-framework by crnk-project.
the class ApprovalIntTest method verifyApprovalCompleted.
private void verifyApprovalCompleted(Schedule schedule) {
QuerySpec taskQuery = new QuerySpec(ApproveTask.class);
taskQuery.includeRelation(Arrays.asList("form"));
// check approval completed
ResourceList<ApproveTask> tasks = taskRepo.findAll(taskQuery);
Assert.assertEquals(0, tasks.size());
// check no approval for schedule in progress
ScheduleApprovalProcessInstance scheduleApproval = approvalRelRepo.findOneTarget(schedule.getId().toString(), "approval", new QuerySpec(ScheduleApprovalProcessInstance.class));
// no approval in progress
Assert.assertNull(scheduleApproval);
}
Aggregations