819
func (d *namespaceHandler) DeleteWorkflowRule(
820
ctx context.Context, ruleID string, nsName string,
822
>
if ruleID == "" {
823
return serviceerror.NewInvalidArgument("Workflow Rule ID is not set.")
824
}
825
827
>
if err != nil {
828
return err
829
}
830
831
>
getNamespaceResponse, err := d.metadataMgr.GetNamespace(ctx, &persistence.GetNamespaceRequest{Name: nsName})
namespace_handler.go
832
>
if err != nil {
833
return err
834
}
835
837
>
config := getNamespaceResponse.Namespace.Config
838
>
if config.WorkflowRules == nil {
839
>
return serviceerror.NewInvalidArgument("Workflow Rule with this ID not Found.")
840
>
}
841
>
_, ok := config.WorkflowRules[ruleID]
842
>
if !ok {
843
>
return serviceerror.NewInvalidArgument("Workflow Rule with this ID not Found.")
844
>
}
845
847
>
848
>
updateReq := &persistence.UpdateNamespaceRequest{
849
>
Namespace: &persistencespb.NamespaceDetail{
850
>
Info: existingNamespace.Info,
851
>
Config: config,
852
>
ReplicationConfig: existingNamespace.ReplicationConfig,
853
>
ConfigVersion: existingNamespace.ConfigVersion + 1,
854
>
FailoverVersion: existingNamespace.FailoverVersion,
855
>
FailoverNotificationVersion: existingNamespace.FailoverNotificationVersion,
856
>
},
857
>
IsGlobalNamespace: getNamespaceResponse.IsGlobalNamespace,
858
>
NotificationVersion: metadata.NotificationVersion,
859
>
}
860
>
return d.metadataMgr.UpdateNamespace(ctx, updateReq)
861
}
862