Assembly: OptimaJet.Workflow.Core

Class SchemeFilePersistence

OptimaJet.Workflow.Core.Persistence.SchemeFilePersistence

Stores and retrieves unparsed source schemes, Scheme Inlining relationships, and scheme tags in the file system.

public class SchemeFilePersistence

Constructors

public SchemeFilePersistence(string storePath, WorkflowRuntime runtime) #
Creates a file-system scheme store backed by the specified directory.

Parameters

Name
Type
Description
storePath
String
The directory that contains source scheme XML files and scheme settings.
runtime
WorkflowRuntime
The WorkflowRuntime used to parse schemes and update their tags.

Methods

public void AddSchemeTags(string schemeCode, IEnumerable<string> tags) #
Adds tags to the source scheme identified by schemeCode.

Parameters

Name
Type
Description
schemeCode
String
The code of the source scheme to update.
tags
IEnumerable<String>
The scheme tags to add.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with schemeCode exists.
public List<string> GetInlinedSchemeCodes() #
Gets the codes of schemes available for use as inlinable schemes.

Returns

Type
Description
List<String>
The inlinable scheme codes.
public List<string> GetRelatedByInliningSchemeCodes(string schemeCode) #
Gets the codes of schemes that inline the specified scheme.

Parameters

Name
Type
Description
schemeCode
String
The code of the inlinable scheme.

Returns

Type
Description
List<String>
The codes of schemes that inline the scheme identified by schemeCode.
public XElement GetScheme(string code) #
Gets the unparsed source scheme identified by a scheme code.

Parameters

Name
Type
Description
code
String
The code of the source scheme to retrieve.

Returns

Type
Description
XElement
The XElement that contains the unparsed source scheme.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with code exists.
public void RemoveSchemeTags(string schemeCode, IEnumerable<string> tags) #
Removes tags from the source scheme identified by schemeCode.

Parameters

Name
Type
Description
schemeCode
String
The code of the source scheme to update.
tags
IEnumerable<String>
The scheme tags to remove.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with schemeCode exists.
public void SaveScheme(string schemeCode, bool canBeInlined, List<string> inlinedSchemes, string scheme, List<string> tags) #
Saves an unparsed source scheme together with its Scheme Inlining relationships and tags.

Parameters

Name
Type
Description
schemeCode
String
The code under which the source scheme is stored.
canBeInlined
Boolean
true if the scheme can be inlined into another scheme; otherwise, false.
inlinedSchemes
List<String>
The codes of the inlinable schemes referenced by this scheme.
scheme
String
The serialized unparsed source scheme.
tags
List<String>
The scheme tags to store.
public List<string> SearchSchemesByTags(IEnumerable<string> tags) #
Gets the codes of schemes that match at least one specified tag.

Parameters

Name
Type
Description
tags
IEnumerable<String>
The scheme tags to match.

Returns

Type
Description
List<String>
The codes of schemes that match at least one tag in tags.

Exceptions

Type
Description
ArgumentException
Thrown when tags is null or empty.
public void SetSchemeTags(string schemeCode, IEnumerable<string> tags) #
Replaces all tags on the source scheme identified by schemeCode.

Parameters

Name
Type
Description
schemeCode
String
The code of the source scheme to update.
tags
IEnumerable<String>
The replacement scheme tags; an empty collection removes all tags.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with schemeCode exists.
public List<string> GetSchemeCodes() #
Gets the codes of all source schemes in the store directory.

Returns

Type
Description
List<String>
The scheme codes derived from the source scheme XML file names.
public void DeleteScheme(string schemeCode) #
Deletes a source scheme and its associated settings from the store.

Parameters

Name
Type
Description
schemeCode
String
The code of the source scheme to delete.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with schemeCode exists.