use of org.finra.herd.model.api.xml.Job in project herd by FINRAOS.
the class ActivitiDelegateTest method testActivitiUnReportableError.
/**
* This method tests the scenario when an workflow related error is throws while workflow is executing an Async type task like Timer. This error is logged
* as WARN.
*/
@Test(expected = ActivitiException.class)
public void testActivitiUnReportableError() throws Exception {
BpmnModel bpmnModel = getBpmnModelForXmlResource(ACTIVITI_XML_HERD_TIMER_WITH_CLASSPATH);
ServiceTask serviceTask = (ServiceTask) bpmnModel.getProcesses().get(0).getFlowElement("servicetask1");
serviceTask.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION);
serviceTask.setImplementation("${BeanNotAvailable}");
jobDefinitionServiceTestHelper.createJobDefinitionForActivitiXml(getActivitiXmlFromBpmnModel(bpmnModel));
Job job = jobService.createAndStartJob(jobServiceTestHelper.createJobCreateRequest(TEST_ACTIVITI_NAMESPACE_CD, TEST_ACTIVITI_JOB_NAME, null));
org.activiti.engine.runtime.Job timer = activitiManagementService.createJobQuery().processInstanceId(job.getId()).timers().singleResult();
if (timer != null) {
executeWithoutLogging(TimerExecuteNestedActivityJobHandler.class, () -> {
activitiManagementService.executeJob(timer.getId());
});
}
}
Aggregations