diff --git a/pom.xml b/pom.xml index a1fb653dfda0779f3e5c3e4c55918830ddf43c17..aa6e70b62e9fae07339b63693cc37719de0fa4cd 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,11 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> - + <dependency> + <groupId>io.temporal</groupId> + <artifactId>temporal-sdk</artifactId> + <version>1.28.0</version> + </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> diff --git a/src/main/java/io/takima/temporalpractice/bakery/cookie/BestCookieWorkflow.java b/src/main/java/io/takima/temporalpractice/bakery/cookie/BestCookieWorkflow.java index 68fa2403a14d682d97ad474a3ab8613c536a3994..76e6fec58821f7966ebef9112ef6d42338bd439e 100644 --- a/src/main/java/io/takima/temporalpractice/bakery/cookie/BestCookieWorkflow.java +++ b/src/main/java/io/takima/temporalpractice/bakery/cookie/BestCookieWorkflow.java @@ -1,7 +1,10 @@ package io.takima.temporalpractice.bakery.cookie; -public class BestCookieWorkflow { +public class BestCookieWorkflow implements CookieWorkflow { + @Override public void orderCookie() { - System.out.println("Cookie ordered... Miam"); + // Note: System.out.println is used here for simplicity + // In real applications, you should use proper Workflow-aware logging (we'll cover this in Day 2) + System.out.println("Cookie ordered... Yuum"); } -} +} \ No newline at end of file diff --git a/src/main/java/io/takima/temporalpractice/bakery/cookie/CookieWorkflow.java b/src/main/java/io/takima/temporalpractice/bakery/cookie/CookieWorkflow.java new file mode 100644 index 0000000000000000000000000000000000000000..80ba653ab624861c28b42d0c7af5572b7d1ec7b6 --- /dev/null +++ b/src/main/java/io/takima/temporalpractice/bakery/cookie/CookieWorkflow.java @@ -0,0 +1,10 @@ +package io.takima.temporalpractice.bakery.cookie; + +import io.temporal.workflow.WorkflowInterface; +import io.temporal.workflow.WorkflowMethod; + +@WorkflowInterface +public interface CookieWorkflow { + @WorkflowMethod + void orderCookie(); +} \ No newline at end of file