@Bean public ZeebeClient zeebe() { System.out.println("Connect to Zeebe at '" + zeebeBrokerContactPoint + "'"); // Cannot yet use Spring Zeebe in current alpha ZeebeClient zeebeClient = ZeebeClient.newClientBuilder() // .brokerContactPoint(zeebeBrokerContactPoint) // .build(); // Trigger deployment zeebeClient.workflowClient().newDeployCommand() // .addResourceFromClasspath("order-kafka.bpmn") // .send().join(); return zeebeClient; }
public static void main(final String[] args) { final String broker = "localhost:26500"; final ZeebeClientBuilder clientBuilder = ZeebeClient.newClientBuilder().brokerContactPoint(broker); try (ZeebeClient client = clientBuilder.build()) { final DeploymentEvent deploymentEvent = client.newDeployCommand().addResourceFromClasspath("demoProcess.bpmn").send().join(); System.out.println("Deployment created with key: " + deploymentEvent.getKey()); } } }
/** * Deploys the given workflow to the broker. Note that the filename must have the "bpmn" file * extension, e.g. "resource.bpmn". * * @param workflow workflow to deploy * @param filename resource name, e.g. "workflow.bpmn" */ public void deployWorkflow(BpmnModelInstance workflow, String filename) { clientRule.getClient().newDeployCommand().addWorkflowModel(workflow, filename).send().join(); }
/** * Deploys the given workflow to the broker. Note that the filename must have the "bpmn" file * extension, e.g. "resource.bpmn". * * @param workflow workflow to deploy * @param filename resource name, e.g. "workflow.bpmn" */ public void deployWorkflow(BpmnModelInstance workflow, String filename) { clientRule.getClient().newDeployCommand().addWorkflowModel(workflow, filename).send().join(); }