Skip to content

Commit 5eed6b3

Browse files
committed
Fill in more WorkflowOptions
Signed-off-by: Greg Haskins <[email protected]>
1 parent bd0629b commit 5eed6b3

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

src/temporal/internal/workflow.clj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@
1111
[io.temporal.client WorkflowOptions WorkflowOptions$Builder]))
1212

1313
(def wf-option-spec
14-
{:task-queue #(.setTaskQueue ^WorkflowOptions$Builder %1 (u/namify %2))
15-
:workflow-id #(.setWorkflowId ^WorkflowOptions$Builder %1 %2)
16-
:retry-options #(.setRetryOptions %1 (common/retry-options-> %2))})
14+
{:task-queue #(.setTaskQueue ^WorkflowOptions$Builder %1 (u/namify %2))
15+
:workflow-id #(.setWorkflowId ^WorkflowOptions$Builder %1 %2)
16+
:workflow-execution-timeout #(.setWorkflowExecutionTimeout ^WorkflowOptions$Builder %1 %2)
17+
:workflow-run-timeout #(.setWorkflowRunTimeout ^WorkflowOptions$Builder %1 %2)
18+
:workflow-task-timeout #(.setWorkflowTaskTimeout ^WorkflowOptions$Builder %1 %2)
19+
:retry-options #(.setRetryOptions %1 (common/retry-options-> %2))
20+
:cron-schedule #(.setCronSchedule ^WorkflowOptions$Builder %1 %2)
21+
:memo #(.setMemo ^WorkflowOptions$Builder %1 %2)
22+
:search-attributes #(.setSearchAttributes ^WorkflowOptions$Builder %1 %2)})
1723

1824
(defn wf-options->
1925
^WorkflowOptions [params]

test/temporal/test/types.clj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
;; Copyright © 2022 Manetu, Inc. All rights reserved
2+
3+
(ns temporal.test.types
4+
(:require [clojure.test :refer :all]
5+
[temporal.internal.workflow :as workflow])
6+
(:import [java.time Duration]))
7+
8+
(deftest workflow-options
9+
(testing "Verify that our workflow options work"
10+
(let [x (workflow/wf-options-> {:workflow-id "foo"
11+
:task-queue "bar"
12+
:workflow-execution-timeout (Duration/ofSeconds 1)
13+
:workflow-run-timeout (Duration/ofSeconds 1)
14+
:workflow-task-timeout (Duration/ofSeconds 1)
15+
:retry-options {:maximum-attempts 1}
16+
:cron-schedule "* * * * *"
17+
:memo {"foo" "bar"}
18+
:search-attributes {"foo" "bar"}})]
19+
(is (-> x (.getWorkflowId) (= "foo")))
20+
(is (-> x (.getTaskQueue) (= "bar"))))))

0 commit comments

Comments
 (0)