File tree Expand file tree Collapse file tree
main/java/io/temporal/samples/hello
test/java/io/temporal/samples/hello Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ repositories {
3636}
3737
3838dependencies {
39- compile group : ' io.temporal' , name : ' temporal-sdk' , version : ' 0.20.0-SNAPSHOT '
39+ compile group : ' io.temporal' , name : ' temporal-sdk' , version : ' 0.19.0 '
4040
4141 compile group : ' commons-configuration' , name : ' commons-configuration' , version : ' 1.9'
4242 compile group : ' ch.qos.logback' , name : ' logback-classic' , version : ' 1.2.3'
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ public static void main(String[] args) throws InterruptedException {
117117 // Sets the cron schedule using the WorkflowOptions.
118118 // The cron format is parsed by "https://github.com/robfig/cron" library.
119119 // Besides the standard "* * * * *" format it supports @every and other extensions.
120+ // Note that unit testing framework doesn't support the extensions.
120121 WorkflowOptions workflowOptions =
121122 WorkflowOptions .newBuilder ().setCronSchedule ("* * * * *" ).build ();
122123 // WorkflowOptions.newBuilder().setCronSchedule("@every 2s").build();
Original file line number Diff line number Diff line change 2323
2424import io .temporal .client .WorkflowClient ;
2525import io .temporal .client .WorkflowOptions ;
26+ import io .temporal .proto .common .WorkflowIdReusePolicy ;
2627import io .temporal .samples .hello .HelloSignal .GreetingWorkflow ;
2728import io .temporal .testing .TestWorkflowEnvironment ;
2829import io .temporal .worker .Worker ;
@@ -77,6 +78,7 @@ public void testSignal() {
7778 WorkflowOptions workflowOptions =
7879 WorkflowOptions .newBuilder ()
7980 .setTaskList (HelloSignal .TASK_LIST )
81+ .setWorkflowIdReusePolicy (WorkflowIdReusePolicy .RejectDuplicate )
8082 .setExecutionStartToCloseTimeout (Duration .ofDays (30 ))
8183 .build ();
8284 GreetingWorkflow workflow = client .newWorkflowStub (GreetingWorkflow .class , workflowOptions );
You can’t perform that action at this time.
0 commit comments