Class TagHelper
OptimaJet.Workflow.Core.Model.TagHelper
Provides operations for normalizing the scheme tags in ProcessDefinition.Tags and converting them between collections and the representations used in scheme XML and persistence.
Namespace: OptimaJet.Workflow.Core.Model
public static class TagHelperMethods
public static string ToTagStringForDatabase(List<string> tags) #Normalizes scheme tags and serializes them as a JSON array for persistence.
Parameters
Name
Type
Description
tagsList<String>The scheme tags to normalize and serialize.
Returns
Type
Description
Stringnull when
tags is empty; otherwise, a string containing a JSON array of the tags returned by TagHelper.PrepareTagsList(List<string>).public static string ToTagString(List<string> tags) #Normalizes scheme tags and converts them to the comma-separated representation used by ProcessDefinition.SerializeToXElement().
Parameters
Name
Type
Description
tagsList<String>The scheme tags to normalize and join.
Returns
Type
Description
StringA string containing the comma-separated tags returned by TagHelper.PrepareTagsList(List<string>).
public static List<string> PrepareTagsList(List<string> tags) #Trims each scheme tag, removes empty and duplicate tags, and sorts the remaining tags.
Parameters
Name
Type
Description
tagsList<String>The scheme tags to normalize.
Returns
Type
Description
List<String>A new List<T> containing the normalized tags.
public static List<string> FromTagStringForDatabase(string value) #Deserializes scheme tags from the JSON representation used in persistence.
public static List<string> FromTagString(string value) #Splits the comma-separated scheme tag representation produced by ProcessDefinition.SerializeToXElement().
Parameters
Name
Type
Description
Returns
public static string ReplaceTagsInScheme(this IWorkflowBuilder workflowBuilder, string schemeText, IEnumerable<string> tags) #Parses a raw scheme, replaces its ProcessDefinition.Tags, and serializes the updated scheme to XML.
Parameters
Name
Type
Description
workflowBuilderIWorkflowBuilderThe IWorkflowBuilder whose IWorkflowBuilder.Parse(string, SchemeParsingType) method parses
schemeText.schemeTextStringThe raw scheme to parse.
tagsIEnumerable<String>The scheme tags to assign to ProcessDefinition.Tags. Serialization normalizes them through TagHelper.ToTagString(List<string>).
Returns
Type
Description
StringThe XML representation produced by ProcessDefinition.Serialize() after replacing ProcessDefinition.Tags.