@@ -494,6 +494,26 @@ func (w *Workflows) sleep(ctx workflow.Context, d time.Duration) error {
494494 return workflow .ExecuteActivity (ctx , "sleep" , d ).Get (ctx , nil )
495495}
496496
497+ func (w * Workflows ) InspectActivityInfo (ctx workflow.Context ) error {
498+ info := workflow .GetInfo (ctx )
499+ domain := info .Domain
500+ wfType := info .WorkflowType .Name
501+ taskList := info .TaskListName
502+ ctx = workflow .WithActivityOptions (ctx , w .defaultActivityOptions ())
503+ return workflow .ExecuteActivity (ctx , "inspectActivityInfo" , domain , taskList , wfType ).Get (ctx , nil )
504+ }
505+
506+ func (w * Workflows ) InspectLocalActivityInfo (ctx workflow.Context ) error {
507+ info := workflow .GetInfo (ctx )
508+ domain := info .Domain
509+ wfType := info .WorkflowType .Name
510+ taskList := info .TaskListName
511+ ctx = workflow .WithLocalActivityOptions (ctx , w .defaultLocalActivityOptions ())
512+ activites := Activities {}
513+ return workflow .ExecuteLocalActivity (
514+ ctx , activites .InspectActivityInfo , domain , taskList , wfType ).Get (ctx , nil )
515+ }
516+
497517func (w * Workflows ) register () {
498518 workflow .Register (w .Basic )
499519 workflow .Register (w .ActivityRetryOnError )
@@ -508,6 +528,8 @@ func (w *Workflows) register() {
508528 workflow .Register (w .ChildWorkflowSuccess )
509529 workflow .Register (w .ChildWorkflowSuccessWithParentClosePolicyTerminate )
510530 workflow .Register (w .ChildWorkflowSuccessWithParentClosePolicyAbandon )
531+ workflow .Register (w .InspectActivityInfo )
532+ workflow .Register (w .InspectLocalActivityInfo )
511533 workflow .Register (w .sleep )
512534 workflow .Register (w .child )
513535 workflow .Register (w .childForMemoAndSearchAttr )
@@ -525,6 +547,13 @@ func (w *Workflows) defaultActivityOptions() workflow.ActivityOptions {
525547 StartToCloseTimeout : 9 * time .Second ,
526548 }
527549}
550+
551+ func (w * Workflows ) defaultLocalActivityOptions () workflow.LocalActivityOptions {
552+ return workflow.LocalActivityOptions {
553+ ScheduleToCloseTimeout : 5 * time .Second ,
554+ }
555+ }
556+
528557func (w * Workflows ) defaultActivityOptionsWithRetry () workflow.ActivityOptions {
529558 return workflow.ActivityOptions {
530559 ScheduleToStartTimeout : 5 * time .Second ,
0 commit comments