@@ -154,17 +154,40 @@ public SignalResponse signal(String workflowId, Task.Status status, Map<String,
154154 * @return SignalResponse with data based on the return strategy
155155 */
156156 public SignalResponse signal (String workflowId , Task .Status status , Map <String , Object > output , ReturnStrategy returnStrategy ) {
157- ConductorClientRequest request = ConductorClientRequest .builder ()
157+ return signal (workflowId , status , output , returnStrategy , null );
158+ }
159+
160+ /**
161+ * Signals a task in a workflow synchronously and returns data based on the specified return strategy.
162+ *
163+ * @param workflowId Workflow Id of the workflow to be signaled
164+ * @param status Signal status to be set for the workflow
165+ * @param output Output for the task
166+ * @param returnStrategy Strategy for what data to return
167+ * @param timeoutMillis Timeout in milliseconds
168+ * @return SignalResponse with data based on the return strategy
169+ */
170+ public SignalResponse signal (String workflowId ,
171+ Task .Status status ,
172+ Map <String , Object > output ,
173+ ReturnStrategy returnStrategy ,
174+ Long timeoutMillis ) {
175+ var builder = ConductorClientRequest .builder ()
158176 .method (ConductorClientRequest .Method .POST )
159177 .path ("/tasks/{workflowId}/{status}/signal/sync" )
160178 .addPathParam ("workflowId" , workflowId )
161179 .addPathParam ("status" , status .name ())
162180 .addQueryParam ("returnStrategy" , returnStrategy .name ())
163- .body (output )
164- .build ();
181+ .body (output );
182+
183+ if (timeoutMillis != null ) {
184+ builder .addQueryParam ("timeoutMillis" , timeoutMillis .toString ());
185+ }
165186
166- ConductorClientResponse <SignalResponse > resp = client .execute (request , new TypeReference <SignalResponse >() {
187+ var request = builder .build ();
188+ var resp = client .execute (request , new TypeReference <SignalResponse >() {
167189 });
190+
168191 return resp .getData ();
169192 }
170193
0 commit comments