use of io.crnk.activiti.example.model.ScheduleApprovalValues in project crnk-framework by crnk-project.
the class ProcessInstanceRepositoryTest method postProcess.
private ScheduleApprovalProcessInstance postProcess(String name, String businessKey, String tenantId) {
QuerySpec querySpec = new QuerySpec(ScheduleApprovalProcessInstance.class);
ScheduleApprovalValues newValues = new ScheduleApprovalValues();
newValues.setName("newScheduleName");
ScheduleApprovalProcessInstance resource = new ScheduleApprovalProcessInstance();
resource.setName(name);
resource.setResourceId("newScheduleId");
resource.setResourceType("schedules");
resource.setTenantId(tenantId);
resource.setBusinessKey(businessKey);
resource.setProcessDefinitionKey("scheduleChange");
resource.setNewValues(newValues);
resource.setDescription(ENFORCED_DESCRIPTION);
ScheduleApprovalProcessInstance createdProcessInstance = processRepository.create(resource);
Assert.assertEquals(name, createdProcessInstance.getName());
Assert.assertNotNull(createdProcessInstance.getId());
createdProcessInstance = processRepository.findOne(createdProcessInstance.getId(), querySpec);
Assert.assertNotNull(createdProcessInstance.getId());
Assert.assertEquals(name, createdProcessInstance.getName());
Assert.assertEquals(businessKey, createdProcessInstance.getBusinessKey());
Assert.assertEquals("newScheduleName", createdProcessInstance.getNewValues().getName());
return createdProcessInstance;
}
use of io.crnk.activiti.example.model.ScheduleApprovalValues 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.ScheduleApprovalValues in project crnk-framework by crnk-project.
the class ApprovalMapper method mapValues.
protected ScheduleApprovalValues mapValues(Schedule entity) {
ScheduleApprovalValues values = new ScheduleApprovalValues();
values.setName(entity.getName());
return values;
}
Aggregations