use of io.camunda.zeebe.model.bpmn.BpmnModelInstance in project zeebe by camunda.
the class BusinessRuleTaskValidationTest method emptyResultVariable.
@Test
void emptyResultVariable() {
// when
final BpmnModelInstance process = process(task -> task.zeebeCalledDecisionId("decisionId").zeebeResultVariable(""));
// then
ProcessValidationUtil.assertThatProcessHasViolations(process, ExpectedValidationResult.expect(ZeebeCalledDecision.class, "Attribute 'resultVariable' must be present and not empty"));
}
use of io.camunda.zeebe.model.bpmn.BpmnModelInstance in project zeebe by camunda.
the class BusinessRuleTaskValidationTest method noCalledDecisionAndTaskDefinitionExtension.
@Test
void noCalledDecisionAndTaskDefinitionExtension() {
// when
final BpmnModelInstance process = process(task -> {
});
// then
ProcessValidationUtil.assertThatProcessHasViolations(process, ExpectedValidationResult.expect(BusinessRuleTask.class, "Must have either one 'zeebe:calledDecision' or one 'zeebe:taskDefinition' extension element"));
}
use of io.camunda.zeebe.model.bpmn.BpmnModelInstance in project zeebe by camunda.
the class ModelWalkerTest method shouldVisitTypeHiearchyInOrder.
@Test
public void shouldVisitTypeHiearchyInOrder() {
// given
final BpmnModelInstance modelInstance = Bpmn.createExecutableProcess("process").startEvent("start-1").userTask("user-1").endEvent("end-1").done();
final ModelWalker walker = new ModelWalker(modelInstance);
final List<Class<?>> visitedUserTaskTypes = new ArrayList<>();
final TypeHierarchyVisitor visitor = new TypeHierarchyVisitor() {
@Override
protected void visit(final ModelElementType implementedType, final BpmnModelElementInstance instance) {
if (instance instanceof UserTask) {
visitedUserTaskTypes.add(implementedType.getInstanceType());
}
}
};
// when
walker.walk(visitor);
// then
assertThat(visitedUserTaskTypes).containsExactly(BaseElement.class, FlowElement.class, FlowNode.class, Activity.class, Task.class, UserTask.class);
}
use of io.camunda.zeebe.model.bpmn.BpmnModelInstance in project zeebe by camunda.
the class ZeebeJobWorkerElementValidationTest method validStaticJobTypeAndRetries.
@ParameterizedTest
@MethodSource("jobWorkerElementBuilderProvider")
@DisplayName("element with static job type and retries")
void validStaticJobTypeAndRetries(final JobWorkerElementBuilder elementBuilder) {
final BpmnModelInstance process = processWithJobWorkerElement(elementBuilder, element -> element.zeebeJobType("service").zeebeJobRetries("5"));
ProcessValidationUtil.assertThatProcessIsValid(process);
}
use of io.camunda.zeebe.model.bpmn.BpmnModelInstance in project zeebe by camunda.
the class ZeebeJobWorkerElementValidationTest method validCustomHeader.
@ParameterizedTest
@MethodSource("jobWorkerElementBuilderProvider")
@DisplayName("element with custom header")
void validCustomHeader(final JobWorkerElementBuilder elementBuilder) {
final BpmnModelInstance process = processWithJobWorkerElement(elementBuilder, element -> element.zeebeJobType("service").zeebeTaskHeader("priority", "high"));
ProcessValidationUtil.assertThatProcessIsValid(process);
}
Aggregations