diff --git a/src/main/java/io/takima/temporalpractice/bakery/CookieOrderer.java b/src/main/java/io/takima/temporalpractice/bakery/CookieOrderer.java index a369b38fc96c9dd67aa13d97fae940a8e0573d98..d32beb34f103d42c57a5f428cebd13b46c2198bf 100644 --- a/src/main/java/io/takima/temporalpractice/bakery/CookieOrderer.java +++ b/src/main/java/io/takima/temporalpractice/bakery/CookieOrderer.java @@ -1,6 +1,25 @@ package io.takima.temporalpractice.bakery; +import io.temporal.client.WorkflowClient; +import io.temporal.client.WorkflowOptions; +import io.temporal.serviceclient.WorkflowServiceStubs; +import io.takima.temporalpractice.bakery.cookie.CookieWorkflow; +import io.takima.temporalpractice.bakery.cookie.BestCookieWorkflow; + public class CookieOrderer { public static void main(String[] args) { + // Represents the connection to your local cluster. For now, lets keep it simple + WorkflowServiceStubs serviceStub = WorkflowServiceStubs.newLocalServiceStubs(); + // Your key for interacting with the Temporal world. + WorkflowClient client = WorkflowClient.newInstance(serviceStub); + + WorkflowOptions options = WorkflowOptions.newBuilder() + .setTaskQueue("theOneAndOnlyQueue") + .setWorkflowId("best-cookie") + .build(); + + CookieWorkflow workflow = client.newWorkflowStub(BestCookieWorkflow.class, options); + + workflow.orderCookie(); // Start the Workflow Execution } -} +} \ No newline at end of file