@@ -319,6 +319,15 @@ public List<StateCompletionOutput> getComplexWorkflowResultWithWait(final String
319319 return getComplexWorkflowResultWithWait (workflowId , "" );
320320 }
321321
322+ /**
323+ * Emit a signal message for the workflow object to receive from external sources
324+ *
325+ * @param workflowClass required
326+ * @param workflowId required
327+ * @param workflowRunId optional, can be empty
328+ * @param signalChannelName required
329+ * @param signalValue optional, can be null
330+ */
322331 public void signalWorkflow (
323332 final Class <? extends ObjectWorkflow > workflowClass ,
324333 final String workflowId ,
@@ -343,46 +352,92 @@ public void signalWorkflow(
343352 }
344353
345354 /**
346- * @param workflowId workflowId
347- * @param workflowRunId workflowRunId
348- * @param resetWorkflowTypeAndOptions the combination parameter for reset
355+ * Emit a signal message for the workflow object to receive from external sources
356+ *
357+ * @param workflowClass required
358+ * @param workflowId required
359+ * @param signalChannelName required
360+ * @param signalValue optional, can be null
361+ */
362+ public void signalWorkflow (
363+ final Class <? extends ObjectWorkflow > workflowClass ,
364+ final String workflowId ,
365+ final String signalChannelName ,
366+ final Object signalValue ) {
367+ signalWorkflow (workflowClass , workflowId , "" , signalChannelName , signalValue );
368+ }
369+
370+ /**
371+ * @param workflowId required
372+ * @param workflowRunId optional, can be empty
373+ * @param resetWorkflowTypeAndOptions required, the combination parameter for reset
349374 * @return the new runId after reset
350375 */
351376 public String resetWorkflow (
352377 final String workflowId ,
353378 final String workflowRunId ,
354379 final ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions
355380 ) {
356-
357381 return unregisteredClient .resetWorkflow (workflowId , workflowRunId , resetWorkflowTypeAndOptions );
358382 }
359383
360384 /**
361- * Stop a workflow, this is essentially terminate the workflow gracefully
385+ * @param workflowId required
386+ * @param resetWorkflowTypeAndOptions required, the combination parameter for reset
387+ * @return the new runId after reset
388+ */
389+ public String resetWorkflow (
390+ final String workflowId ,
391+ final ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions
392+ ) {
393+ return resetWorkflow (workflowId , "" , resetWorkflowTypeAndOptions );
394+ }
395+
396+ /**
397+ * Stop a workflow with options
362398 *
363399 * @param workflowId required
364400 * @param workflowRunId optional, can be empty
401+ * @param options optional, can be null. If not set, the workflow status will be CANCELED
365402 */
366403 public void stopWorkflow (
367404 final String workflowId ,
368- final String workflowRunId ) {
369- unregisteredClient .stopWorkflow (workflowId , workflowRunId );
405+ final String workflowRunId ,
406+ final StopWorkflowOptions options ) {
407+ unregisteredClient .stopWorkflow (workflowId , workflowRunId , options );
370408 }
371409
372410 /**
373411 * Stop a workflow with options
374412 *
375413 * @param workflowId required
376- * @param workflowRunId optional
377- * @param options optional
414+ * @param options optional, can be null. If not set, the workflow status will be CANCELED
378415 */
379416 public void stopWorkflow (
380417 final String workflowId ,
381- final String workflowRunId ,
382418 final StopWorkflowOptions options ) {
383- unregisteredClient . stopWorkflow (workflowId , workflowRunId , options );
419+ stopWorkflow (workflowId , "" , options );
384420 }
385421
422+ /**
423+ * Stop a workflow, this is essentially terminate the workflow gracefully
424+ * The workflow status will be CANCELED
425+ *
426+ * @param workflowId required
427+ */
428+ public void stopWorkflow (final String workflowId ) {
429+ stopWorkflow (workflowId , "" , null );
430+ }
431+
432+ /**
433+ * Get specified data attributes (by keys) of a workflow
434+ *
435+ * @param workflowClass required
436+ * @param workflowId required
437+ * @param workflowRunId optional, can be empty
438+ * @param keys required, cannot be empty or null
439+ * @return the data attributes
440+ */
386441 public Map <String , Object > getWorkflowDataObjects (
387442 final Class <? extends ObjectWorkflow > workflowClass ,
388443 final String workflowId ,
@@ -395,13 +450,49 @@ public Map<String, Object> getWorkflowDataObjects(
395450 return doGetWorkflowDataObjects (workflowClass , workflowId , workflowRunId , keys );
396451 }
397452
453+ /**
454+ * Get specified data attributes (by keys) of a workflow
455+ *
456+ * @param workflowClass required
457+ * @param workflowId required
458+ * @param keys required, cannot be empty or null
459+ * @return the data attributes
460+ */
461+ public Map <String , Object > getWorkflowDataObjects (
462+ final Class <? extends ObjectWorkflow > workflowClass ,
463+ final String workflowId ,
464+ List <String > keys ) {
465+ return getWorkflowDataObjects (workflowClass , workflowId , "" , keys );
466+ }
467+
468+ /**
469+ * Get all the data attributes of a workflow
470+ *
471+ * @param workflowClass required
472+ * @param workflowId required
473+ * @param workflowRunId optional, can be empty
474+ * @return the data attributes
475+ */
398476 public Map <String , Object > getAllDataObjects (
399477 final Class <? extends ObjectWorkflow > workflowClass ,
400478 final String workflowId ,
401479 final String workflowRunId ) {
402480 return doGetWorkflowDataObjects (workflowClass , workflowId , workflowRunId , null );
403481 }
404482
483+ /**
484+ * Get all the data attributes of a workflow
485+ *
486+ * @param workflowClass required
487+ * @param workflowId required
488+ * @return the data attributes
489+ */
490+ public Map <String , Object > getAllDataObjects (
491+ final Class <? extends ObjectWorkflow > workflowClass ,
492+ final String workflowId ) {
493+ return getAllDataObjects (workflowClass , workflowId , "" );
494+ }
495+
405496 private Map <String , Object > doGetWorkflowDataObjects (
406497 final Class <? extends ObjectWorkflow > workflowClass ,
407498 final String workflowId ,
@@ -471,8 +562,8 @@ public WorkflowSearchResponse searchWorkflow(final WorkflowSearchRequest request
471562 * create a new stub for invoking RPC
472563 *
473564 * @param workflowClassForRpc the class of defining the RPCs to invoke
474- * @param workflowId workflowId is required
475- * @param workflowRunId optional
565+ * @param workflowId required
566+ * @param workflowRunId optional, can be empty
476567 * @param <T> the class of defining the RPCs to invoke
477568 * @return the result of the RPC
478569 */
@@ -515,6 +606,18 @@ public <T> T newRpcStub(Class<T> workflowClassForRpc, String workflowId, String
515606 return result ;
516607 }
517608
609+ /**
610+ * create a new stub for invoking RPC
611+ *
612+ * @param workflowClassForRpc the class of defining the RPCs to invoke
613+ * @param workflowId required
614+ * @param <T> the class of defining the RPCs to invoke
615+ * @return the result of the RPC
616+ */
617+ public <T > T newRpcStub (Class <T > workflowClassForRpc , String workflowId ) {
618+ return newRpcStub (workflowClassForRpc , workflowId , "" );
619+ }
620+
518621 /**
519622 * invoking the RPC through RPC stub
520623 *
@@ -559,6 +662,15 @@ public void invokeRPC(RpcDefinitions.RpcProc0 rpcStubMethod) {
559662 rpcStubMethod .execute (null , null , null );
560663 }
561664
665+ /**
666+ * Get specified search attributes (by attributeKeys) of a workflow
667+ *
668+ * @param workflowClass required
669+ * @param workflowId required
670+ * @param workflowRunId optional, can be empty
671+ * @param attributeKeys required, cannot be empty or null
672+ * @return the search attributes
673+ */
562674 public Map <String , Object > getWorkflowSearchAttributes (
563675 final Class <? extends ObjectWorkflow > workflowClass ,
564676 final String workflowId ,
@@ -570,12 +682,55 @@ public Map<String, Object> getWorkflowSearchAttributes(
570682 return doGetWorkflowSearchAttributes (workflowClass , workflowId , workflowRunId , attributeKeys );
571683 }
572684
685+ /**
686+ * Get specified search attributes (by attributeKeys) of a workflow
687+ *
688+ * @param workflowClass required
689+ * @param workflowId required
690+ * @param attributeKeys required, cannot be empty or null
691+ * @return the search attributes
692+ */
693+ public Map <String , Object > getWorkflowSearchAttributes (
694+ final Class <? extends ObjectWorkflow > workflowClass ,
695+ final String workflowId ,
696+ List <String > attributeKeys ) {
697+ return getWorkflowSearchAttributes (workflowClass , workflowId , "" , attributeKeys );
698+ }
699+
700+ /**
701+ * Get all the search attributes of a workflow
702+ *
703+ * @param workflowClass required
704+ * @param workflowId required
705+ * @param workflowRunId optional, can be empty
706+ * @return the search attributes
707+ */
708+ public Map <String , Object > getAllSearchAttributes (
709+ final Class <? extends ObjectWorkflow > workflowClass ,
710+ final String workflowId ,
711+ final String workflowRunId ) {
712+ return doGetWorkflowSearchAttributes (workflowClass , workflowId , workflowRunId , null );
713+ }
714+
715+ /**
716+ * Get all the search attributes of a workflow
717+ *
718+ * @param workflowClass required
719+ * @param workflowId required
720+ * @return the search attributes
721+ */
722+ public Map <String , Object > getAllSearchAttributes (
723+ final Class <? extends ObjectWorkflow > workflowClass ,
724+ final String workflowId ) {
725+ return getAllSearchAttributes (workflowClass , workflowId , "" );
726+ }
727+
573728 /**
574729 * Describe a workflow to get its info.
575730 * If the workflow does not exist, throw the WORKFLOW_NOT_EXISTS_SUB_STATUS exception.
576731 *
577732 * @param workflowId required
578- * @param workflowRunId optional
733+ * @param workflowRunId optional, can be empty
579734 * @return the workflow's info
580735 */
581736 public WorkflowInfo describeWorkflow (
@@ -587,11 +742,16 @@ public WorkflowInfo describeWorkflow(
587742 .build ();
588743 }
589744
590- public Map <String , Object > getAllSearchAttributes (
591- final Class <? extends ObjectWorkflow > workflowClass ,
592- final String workflowId ,
593- final String workflowRunId ) {
594- return doGetWorkflowSearchAttributes (workflowClass , workflowId , workflowRunId , null );
745+ /**
746+ * Describe a workflow to get its info.
747+ * If the workflow does not exist, throw the WORKFLOW_NOT_EXISTS_SUB_STATUS exception.
748+ *
749+ * @param workflowId required
750+ * @return the workflow's info
751+ */
752+ public WorkflowInfo describeWorkflow (
753+ final String workflowId ) {
754+ return describeWorkflow (workflowId , "" );
595755 }
596756
597757 private Map <String , Object > doGetWorkflowSearchAttributes (
0 commit comments