Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Run 'gradle checkUpdates' to find out which dependencies have newer versions

plugins {
id 'net.minecrell.licenser' version '0.4.1'
id 'com.github.sherter.google-java-format' version '0.8'
id "net.ltgt.errorprone" version "0.6"
id 'com.github.sherter.google-java-format' version '0.9'
id "net.ltgt.errorprone" version "1.2.1"
id 'name.remal.check-updates' version '1.0.201'
}

apply plugin: 'java'
Expand All @@ -27,16 +30,16 @@ repositories {
}

dependencies {
implementation group: 'io.temporal', name: 'temporal-sdk', version: '0.25.0-SNAPSHOT'
implementation group: 'commons-configuration', name: 'commons-configuration', version: '1.9'
implementation group: 'io.temporal', name: 'temporal-sdk', version: '0.26.0-SNAPSHOT'
implementation group: 'commons-configuration', name: 'commons-configuration', version: '1.10'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'

testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'junit', name: 'junit', version: '4.13'
testImplementation group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
testImplementation group: 'org.powermock', name: 'powermock-api-mockito', version: '1.7.3'
testImplementation group: 'org.powermock', name: 'powermock-api-mockito', version: '1.7.4'

errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
errorprone("com.google.errorprone:error_prone_core:2.3.1")
errorprone("com.google.errorprone:error_prone_core:2.4.0")
}

compileJava {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 3 additions & 0 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,50 @@
public interface TripBookingActivities {

/**
* Request a car rental reservation.
*
* @param name customer name
* @return reservationID
*/
String reserveCar(String name);

/**
* Request a flight reservation.
*
* @param name customer name
* @return reservationID
*/
String bookFlight(String name);

/**
* Request a hotel reservation.
*
* @param name customer name
* @return reservationID
*/
String bookHotel(String name);

/**
* Cancel a flight reservation.
*
* @param name customer name
* @param reservationID id returned by bookFlight
* @return cancellationConfirmationID
*/
String cancelFlight(String reservationID, String name);

/**
* Cancel a hotel reservation.
*
* @param name customer name
* @param reservationID id returned by bookHotel
* @return cancellationConfirmationID
*/
String cancelHotel(String reservationID, String name);

/**
* Cancel a car rental reservation.
*
* @param name customer name
* @param reservationID id returned by reserveCar
* @return cancellationConfirmationID
Expand Down
1 change: 0 additions & 1 deletion src/main/java/io/temporal/samples/hello/HelloActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class HelloActivity {
/** Workflow interface has to have at least one method annotated with @WorkflowMethod. */
@WorkflowInterface
public interface GreetingWorkflow {
/** @return greeting string */
@WorkflowMethod
String getGreeting(String name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class HelloActivityRetry {

@WorkflowInterface
public interface GreetingWorkflow {
/** @return greeting string */
@WorkflowMethod
String getGreeting(String name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public class HelloAsyncActivityCompletion {

@WorkflowInterface
public interface GreetingWorkflow {
/** @return greeting string */
@WorkflowMethod
String getGreeting(String name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class HelloAsyncLambda {

@WorkflowInterface
public interface GreetingWorkflow {
/** @return greeting string */
@WorkflowMethod
String getGreeting(String name);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/io/temporal/samples/hello/HelloChild.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class HelloChild {
/** The parent workflow interface. */
@WorkflowInterface
public interface GreetingWorkflow {
/** @return greeting string */
@WorkflowMethod
String getGreeting(String name);
}
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/io/temporal/samples/hello/HelloCron.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ public static class GreetingWorkflowImpl implements GreetingWorkflow {
GreetingActivities.class,
ActivityOptions.newBuilder().setScheduleToCloseTimeout(Duration.ofSeconds(10)).build());

/**
* Stub used to terminate this workflow run and create the next one with the same ID atomically.
*/
private final GreetingWorkflow continueAsNew =
Workflow.newContinueAsNewStub(GreetingWorkflow.class);

@Override
public void greet(String name) {
activities.greet("Hello " + name + "!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
import io.temporal.workflowservice.v1.DescribeWorkflowExecutionResponse;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.util.Date;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
Expand All @@ -53,7 +54,6 @@ public class HelloSearchAttributes {
/** Workflow interface has to have at least one method annotated with @WorkflowMethod. */
@WorkflowInterface
public interface GreetingWorkflow {
/** @return greeting string */
@WorkflowMethod
String getGreeting(String name);
}
Expand Down Expand Up @@ -161,7 +161,8 @@ private static Map<String, Object> generateSearchAttributes() {

// CustomDatetimeField takes times encoded in the RFC 3339 format.
private static String generateDateTimeFieldValue() {
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX").format(new Date());
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX")
.format(LocalDateTime.now(ZoneId.systemDefault()));
}

// example for extract value from search attributes
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/temporal/samples/hello/HelloSignal.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public class HelloSignal {
@WorkflowInterface
public interface GreetingWorkflow {
/**
* @return list of greeting strings that were received through the waitForNameMethod. This
* method will block until the number of greetings specified are received.
* list of greeting strings that were received through the waitForNameMethod. This method will
* block until the number of greetings specified are received.
*/
@WorkflowMethod
List<String> getGreetings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

import io.temporal.workflow.Workflow;
import java.time.Duration;
import java.util.Date;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import org.slf4j.Logger;

public final class UpdatableTimer {
Expand All @@ -32,7 +34,9 @@ public final class UpdatableTimer {
private boolean wakeUpTimeUpdated;

public void sleepUntil(long wakeUpTime) {
logger.info("sleepUntil: " + new Date(wakeUpTime));
Instant wakeUpInstant = Instant.ofEpochMilli(wakeUpTime);
LocalDateTime date = wakeUpInstant.atZone(ZoneId.systemDefault()).toLocalDateTime();
logger.info("sleepUntil: " + date);
this.wakeUpTime = wakeUpTime;
while (true) {
wakeUpTimeUpdated = false;
Expand Down