Search in sources :

Example 1 with ProcessImpl

use of io.zeebe.model.bpmn.impl.instance.ProcessImpl in project zeebe by zeebe-io.

the class CreateDeploymentTest method shouldNotDeployNonExecutableModel.

@Test
public void shouldNotDeployNonExecutableModel() {
    // given
    final WorkflowsClient workflowService = clientRule.workflows();
    final io.zeebe.model.bpmn.instance.WorkflowDefinition workflowDefinition = Bpmn.createExecutableWorkflow("not-executable").startEvent().endEvent().done();
    final ProcessImpl workflowImpl = (ProcessImpl) workflowDefinition.getWorkflows().iterator().next();
    workflowImpl.setExecutable(false);
    // then
    exception.expect(ClientCommandRejectedException.class);
    exception.expectMessage(containsString("BPMN model must contain at least one executable process"));
    // when
    workflowService.deploy(clientRule.getDefaultTopic()).addWorkflowModel(workflowDefinition, "workflow.bpmn").execute();
}
Also used : WorkflowsClient(io.zeebe.client.WorkflowsClient) ProcessImpl(io.zeebe.model.bpmn.impl.instance.ProcessImpl) Test(org.junit.Test)

Aggregations

WorkflowsClient (io.zeebe.client.WorkflowsClient)1 ProcessImpl (io.zeebe.model.bpmn.impl.instance.ProcessImpl)1 Test (org.junit.Test)1