use of org.camunda.bpm.engine.runtime.CaseInstanceBuilder in project camunda-bpm-platform by camunda.
the class CaseDefinitionRestServiceInteractionTest method setUpRuntime.
@Before
public void setUpRuntime() {
CaseDefinition mockCaseDefinition = MockProvider.createMockCaseDefinition();
setUpRuntimeData(mockCaseDefinition);
caseServiceMock = mock(CaseService.class);
when(processEngine.getCaseService()).thenReturn(caseServiceMock);
caseInstanceBuilder = mock(CaseInstanceBuilder.class);
CaseInstance mockCaseInstance = MockProvider.createMockCaseInstance();
when(caseServiceMock.withCaseDefinition(MockProvider.EXAMPLE_CASE_DEFINITION_ID)).thenReturn(caseInstanceBuilder);
when(caseInstanceBuilder.businessKey(anyString())).thenReturn(caseInstanceBuilder);
when(caseInstanceBuilder.setVariables(Matchers.<Map<String, Object>>any())).thenReturn(caseInstanceBuilder);
when(caseInstanceBuilder.create()).thenReturn(mockCaseInstance);
}
use of org.camunda.bpm.engine.runtime.CaseInstanceBuilder in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricCaseActivityInstanceQueryTest method createCaseInstance.
protected void createCaseInstance(String tenantId) {
CaseInstanceBuilder builder = caseService.withCaseDefinitionByKey("oneTaskCase");
builder.caseDefinitionTenantId(tenantId).create();
}
use of org.camunda.bpm.engine.runtime.CaseInstanceBuilder in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseInstanceCmdsTenantCheckTest method createCaseInstance.
protected String createCaseInstance(String tenantId) {
VariableMap variables = Variables.putValue(VARIABLE_NAME, VARIABLE_VALUE);
CaseInstanceBuilder builder = caseService.withCaseDefinitionByKey("twoTaskCase").setVariables(variables);
if (tenantId == null) {
return builder.create().getId();
} else {
return builder.caseDefinitionTenantId(tenantId).create().getId();
}
}
use of org.camunda.bpm.engine.runtime.CaseInstanceBuilder in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricDataCmdsTenantCheckTest method createAndCloseCaseInstance.
protected String createAndCloseCaseInstance(String tenantId) {
String caseInstanceId;
CaseInstanceBuilder builder = caseService.withCaseDefinitionByKey("oneTaskCase");
if (tenantId == null) {
caseInstanceId = builder.create().getId();
} else {
caseInstanceId = builder.caseDefinitionTenantId(tenantId).create().getId();
}
caseService.completeCaseExecution(caseInstanceId);
caseService.closeCaseInstance(caseInstanceId);
return caseInstanceId;
}
use of org.camunda.bpm.engine.runtime.CaseInstanceBuilder in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricCaseInstanceQueryTest method createCaseInstance.
protected void createCaseInstance(String tenantId) {
CaseInstanceBuilder builder = caseService.withCaseDefinitionByKey("oneTaskCase");
builder.caseDefinitionTenantId(tenantId).create();
}
Aggregations