use of org.camunda.bpm.engine.externaltask.ExternalTask in project camunda-bpm-platform by camunda.
the class SetExternalTaskRetriesAuthorizationTest method testSetRetries.
@Test
@Deployment(resources = "org/camunda/bpm/engine/test/api/externaltask/oneExternalTaskProcess.bpmn20.xml")
public void testSetRetries() {
// given
ProcessInstance processInstance = engineRule.getRuntimeService().startProcessInstanceByKey("oneExternalTaskProcess");
ExternalTask task = engineRule.getExternalTaskService().createExternalTaskQuery().singleResult();
// when
authRule.init(scenario).withUser("userId").bindResource("processInstanceId", processInstance.getId()).bindResource("processDefinitionKey", "oneExternalTaskProcess").start();
engineRule.getExternalTaskService().setRetries(task.getId(), 5);
// then
if (authRule.assertScenario(scenario)) {
task = engineRule.getExternalTaskService().createExternalTaskQuery().singleResult();
Assert.assertEquals(5, (int) task.getRetries());
}
}
use of org.camunda.bpm.engine.externaltask.ExternalTask in project camunda-bpm-platform by camunda.
the class SetExternalTaskPriorityAuthorizationTest method testSetPriority.
@Test
@Deployment(resources = "org/camunda/bpm/engine/test/api/externaltask/oneExternalTaskProcess.bpmn20.xml")
public void testSetPriority() {
// given
ProcessInstance processInstance = engineRule.getRuntimeService().startProcessInstanceByKey("oneExternalTaskProcess");
ExternalTask task = engineRule.getExternalTaskService().createExternalTaskQuery().singleResult();
// when
authRule.init(scenario).withUser("userId").bindResource("processInstanceId", processInstance.getId()).bindResource("processDefinitionKey", "oneExternalTaskProcess").start();
engineRule.getExternalTaskService().setPriority(task.getId(), 5);
// then
if (authRule.assertScenario(scenario)) {
task = engineRule.getExternalTaskService().createExternalTaskQuery().singleResult();
Assert.assertEquals(5, task.getPriority());
}
}
use of org.camunda.bpm.engine.externaltask.ExternalTask in project camunda-bpm-platform by camunda.
the class SetExternalTasksRetriesBatchAuthorizationTest method testSetRetriesAsync.
@Test
public void testSetRetriesAsync() {
// given
ProcessDefinition processDefinition = testRule.deployAndGetDefinition(ExternalTaskModels.ONE_EXTERNAL_TASK_PROCESS);
ProcessInstance processInstance1 = engineRule.getRuntimeService().startProcessInstanceByKey("Process");
List<ExternalTask> externalTasks = engineRule.getExternalTaskService().createExternalTaskQuery().list();
ArrayList<String> externalTaskIds = new ArrayList<String>();
for (ExternalTask task : externalTasks) {
externalTaskIds.add(task.getId());
}
// when
authRule.init(scenario).withUser("userId").bindResource("batchId", "*").bindResource("processInstance1", processInstance1.getId()).bindResource("processDefinition", processDefinition.getKey()).start();
Batch batch = engineRule.getExternalTaskService().setRetriesAsync(externalTaskIds, null, 5);
if (batch != null) {
executeSeedAndBatchJobs(batch);
}
// then
if (authRule.assertScenario(scenario)) {
externalTasks = engineRule.getExternalTaskService().createExternalTaskQuery().list();
for (ExternalTask task : externalTasks) {
Assert.assertEquals(5, (int) task.getRetries());
}
}
}
use of org.camunda.bpm.engine.externaltask.ExternalTask in project camunda-bpm-platform by camunda.
the class ExtendLockOnExternalTaskAuthorizationTest method assertExternalTaskResults.
@Override
public void assertExternalTaskResults() {
ExternalTask taskWithExtendedLock = engineRule.getExternalTaskService().createExternalTaskQuery().locked().singleResult();
Assert.assertNotNull(taskWithExtendedLock);
}
use of org.camunda.bpm.engine.externaltask.ExternalTask in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricExternalTaskLogTest method startProcessInstanceFailAndCompleteExternalTask.
protected void startProcessInstanceFailAndCompleteExternalTask(String tenant) {
ExternalTask task = startProcessInstanceAndFailExternalTask(tenant);
completeExternalTask(task.getId());
}
Aggregations