Assembly: OptimaJet.Workflow.Core

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.

public static class TagHelper

Methods

public static string ToTagStringForDatabase(List<string> tags) #
Normalizes scheme tags and serializes them as a JSON array for persistence.

Parameters

Name
Type
Description
tags
List<String>
The scheme tags to normalize and serialize.

Returns

Type
Description
String
null 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
tags
List<String>
The scheme tags to normalize and join.

Returns

Type
Description
String
A 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
tags
List<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.

Parameters

Name
Type
Description
value
String
The JSON representation to deserialize. A null or empty string represents no tags.

Returns

Type
Description
List<String>
The deserialized scheme tags, or a new empty List<T> when value is null or empty.
public static List<string> FromTagString(string value) #
Splits the comma-separated scheme tag representation produced by ProcessDefinition.SerializeToXElement().

Parameters

Name
Type
Description
value
String
The comma-separated representation to split. A null or empty string represents no tags.

Returns

Type
Description
List<String>
A new List<T> containing the comma-separated segments in their original order without normalization, or an empty List<T> when value is null or empty.
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
workflowBuilder
IWorkflowBuilder
schemeText
String
The raw scheme to parse.
tags
IEnumerable<String>
The scheme tags to assign to ProcessDefinition.Tags. Serialization normalizes them through TagHelper.ToTagString(List<string>).

Returns

Type
Description
String
The XML representation produced by ProcessDefinition.Serialize() after replacing ProcessDefinition.Tags.