File tree Expand file tree Collapse file tree 3 files changed +35
-3
lines changed Expand file tree Collapse file tree 3 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ along with the Activity Task for the next retry attempt and can be extracted by
4141 (log/trace " get-heartbeat-details:" v)
4242 v)))
4343
44+ (defn get-info
45+ " Returns information about the Activity execution"
46+ []
47+ (a/get-info ))
48+
4449(defn- complete-invoke
4550 [activity result]
4651 (log/trace activity " completed with" (count result) " bytes" )
Original file line number Diff line number Diff line change 5858 :activity-type (.getActivityType d)}))
5959
6060(defn get-info []
61- (-> (Activity/getExecutionContext )
62- (.getInfo )
63- (d/datafy )))
61+ (->> (Activity/getExecutionContext )
62+ (.getInfo )
63+ (d/datafy )
64+ (into {})))
6465
6566(defn get-annotation
6667 ^String [x]
Original file line number Diff line number Diff line change 1+ ; ; Copyright © Manetu, Inc. All rights reserved
2+
3+ (ns temporal.test.activity-info
4+ (:require [clojure.test :refer :all ]
5+ [temporal.client.core :as c]
6+ [temporal.workflow :refer [defworkflow ]]
7+ [temporal.activity :refer [defactivity ] :as a]
8+ [temporal.test.utils :as t]))
9+
10+ (use-fixtures :once t/wrap-service)
11+
12+ (defactivity getinfo-activity
13+ [ctx args]
14+ (a/get-info ))
15+
16+ (defworkflow getinfo-workflow
17+ [args]
18+ @(a/invoke getinfo-activity args))
19+
20+ (deftest the-test
21+ (testing " Verifies that we can retrieve our activity-id"
22+ (let [workflow (t/create-workflow getinfo-workflow)]
23+ (c/start workflow {})
24+ (let [{:keys [activity-id]} @(c/get-result workflow)]
25+ (is (some? activity-id))))))
26+
You can’t perform that action at this time.
0 commit comments