use of io.camunda.zeebe.client.api.ZeebeFuture in project zeebe by camunda.
the class CreateProcessInstanceWithResultTest method shouldOnlyReturnVariablesInRootScope.
@Test
public void shouldOnlyReturnVariablesInRootScope() {
// given
final BpmnModelInstance processWithVariableScopes = Bpmn.createExecutableProcess(processId).startEvent().subProcess("sub", b -> {
b.embeddedSubProcess().startEvent().serviceTask("task", t -> t.zeebeJobType(jobType)).endEvent();
b.zeebeInputExpression("x", "y");
}).endEvent().done();
processDefinitionKey = CLIENT_RULE.deployProcess(processWithVariableScopes);
final ZeebeFuture<ProcessInstanceResult> resultFuture = createProcessInstanceWithVariables(Map.of("x", "1"));
// when
completeJobWithVariables(Map.of("y", "2"));
// then
final ProcessInstanceResult result = resultFuture.join();
assertThat(result.getBpmnProcessId()).isEqualTo(processId);
assertThat(result.getProcessDefinitionKey()).isEqualTo(processDefinitionKey);
assertThat(result.getVariablesAsMap()).containsExactly(entry("x", "1"));
}
use of io.camunda.zeebe.client.api.ZeebeFuture in project zeebe by zeebe-io.
the class CreateProcessInstanceWithResultTest method shouldOnlyReturnVariablesInRootScope.
@Test
public void shouldOnlyReturnVariablesInRootScope() {
// given
final BpmnModelInstance processWithVariableScopes = Bpmn.createExecutableProcess(processId).startEvent().subProcess("sub", b -> {
b.embeddedSubProcess().startEvent().serviceTask("task", t -> t.zeebeJobType(jobType)).endEvent();
b.zeebeInputExpression("x", "y");
}).endEvent().done();
processDefinitionKey = CLIENT_RULE.deployProcess(processWithVariableScopes);
final ZeebeFuture<ProcessInstanceResult> resultFuture = createProcessInstanceWithVariables(Map.of("x", "1"));
// when
completeJobWithVariables(Map.of("y", "2"));
// then
final ProcessInstanceResult result = resultFuture.join();
assertThat(result.getBpmnProcessId()).isEqualTo(processId);
assertThat(result.getProcessDefinitionKey()).isEqualTo(processDefinitionKey);
assertThat(result.getVariablesAsMap()).containsExactly(entry("x", "1"));
}
use of io.camunda.zeebe.client.api.ZeebeFuture in project zeebe by camunda-cloud.
the class CreateProcessInstanceWithResultTest method shouldOnlyReturnVariablesInRootScope.
@Test
public void shouldOnlyReturnVariablesInRootScope() {
// given
final BpmnModelInstance processWithVariableScopes = Bpmn.createExecutableProcess(processId).startEvent().subProcess("sub", b -> {
b.embeddedSubProcess().startEvent().serviceTask("task", t -> t.zeebeJobType(jobType)).endEvent();
b.zeebeInputExpression("x", "y");
}).endEvent().done();
processDefinitionKey = CLIENT_RULE.deployProcess(processWithVariableScopes);
final ZeebeFuture<ProcessInstanceResult> resultFuture = createProcessInstanceWithVariables(Map.of("x", "1"));
// when
completeJobWithVariables(Map.of("y", "2"));
// then
final ProcessInstanceResult result = resultFuture.join();
assertThat(result.getBpmnProcessId()).isEqualTo(processId);
assertThat(result.getProcessDefinitionKey()).isEqualTo(processDefinitionKey);
assertThat(result.getVariablesAsMap()).containsExactly(entry("x", "1"));
}
Aggregations