You are viewing limited content. For full access, please sign in.

Question

Question

Remove Security Tag Workflow

asked on July 8, 2015

Hi,

Currently there is 'Assign Tag' step in which we can chose to remove tag as required . We have more than 500 tags . 

Is there a way in workflow where we can say remove any security tag assigned to an entry?

Regards,

Srikanth

0 0

Replies

replied on July 8, 2015 Show version history

We used below code in one of the steps to remove security tag. Recently we moved to SSL. This script activity stopped working after moving to SSL


namespace WorkflowActivity.Scripting.RemoveAccessTags
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;
    using System.Text;
    using LFSO80Lib;
    //using LFSO81Lib;


    /// <summary>
    /// Provides one or more methods that can be run when the workflow scripting activity is performed.
    /// </summary>
    public class RemoveAccessTags : ToolkitScriptClass
    {
        // Execute the script below when this activity is executed.
        // The 'MsgBox' function is available for design-time testing.
        protected override void Execute()
        {
            // TODO: Script Code Here
            LFDatabase db = (LFDatabase) this.Database;
            LFDocument doc = (LFDocument) this.Entry;
            RemoveTags(doc, db);
            //MsgBox("this id: ");

        }

            public void RemoveTags(LFDocument doc, LFDatabase db) {
            System.Collections.Hashtable hash = new System.Collections.Hashtable();
            LFTagData tagInfo = (LFTagData) doc.TagData;
            foreach (LFTag single in tagInfo) {
                hash.Add(single.Name, single);
            }
            LFTag t;
            foreach (string s in hash.Keys) {
                t = (LFTag) db.GetTagByName(s);
                tagInfo.RemoveTag(t);
            }
            tagInfo.Update();
        }

    }
}
0 0
replied on July 9, 2015

This issue is resolved now 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.