Assembly: OptimaJet.Workflow.Core

Class XmlWorkflowParser

OptimaJet.Workflow.Core.Parser.XmlWorkflowParser

Parses Scheme XML represented by XElement instances into ProcessDefinition instances and serializes process definitions back to XML.

public class XmlWorkflowParser : WorkflowParser<XElement>, IWorkflowParser<XElement>

Type Hierarchy

Methods

public override List<TimerDefinition> ParseTimers(XElement schemeMedium) #
Parses the TimerDefinition instances from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.

Returns

Type
Description
List<TimerDefinition>
The parsed TimerDefinition instances.

Exceptions

Type
Description
ArgumentNullException
schemeMedium is null.
public override List<ActorDefinition> ParseActors(XElement schemeMedium) #
Parses the ActorDefinition instances from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.

Returns

Type
Description
List<ActorDefinition>
The parsed ActorDefinition instances.

Exceptions

Type
Description
ArgumentNullException
schemeMedium is null.
ArgumentException
The Scheme XML declares duplicate actor names.
public override List<Translation> ParseLocalization(XElement schemeMedium) #
Parses the Translation entries from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.

Returns

Type
Description
List<Translation>
The parsed Translation entries.

Exceptions

Type
Description
ArgumentNullException
schemeMedium is null.
public override List<ParameterDefinition> ParseParameters(XElement schemeMedium, SchemeParsingType schemeParsingType = SchemeParsingType.Strict) #
Parses the ParameterDefinition instances from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.
schemeParsingType
SchemeParsingType
The SchemeParsingType mode. SchemeParsingType.Strict rejects unresolved parameter types, while SchemeParsingType.Soft permits them when parsing an uploaded scheme for correction.

Returns

Type
Description
List<ParameterDefinition>
The parsed ParameterDefinition instances.

Exceptions

Type
Description
ArgumentNullException
schemeMedium is null.

Remarks

The returned collection also includes DefaultDefinitions.DefaultParameters.
public override List<CommandDefinition> ParseCommands(XElement schemeMedium, List<ParameterDefinition> parameterDefinitions) #
Parses the CommandDefinition instances from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.
parameterDefinitions
List<ParameterDefinition>
The parsed ParameterDefinition instances used to resolve command input parameters.

Returns

Type
Description
List<CommandDefinition>
The parsed CommandDefinition instances.

Exceptions

Type
Description
ArgumentNullException
schemeMedium or parameterDefinitions is null.
SchemeNotValidException
A command input references a Parameter that is absent from parameterDefinitions.
public override List<CommentDefinition> ParseComments(XElement schemeMedium) #
Parses the CommentDefinition instances placed on the process scheme canvas.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.

Returns

Type
Description
List<CommentDefinition>
The parsed CommentDefinition instances.

Exceptions

Type
Description
ArgumentNullException
schemeMedium is null.
public override string GetCalendarName(XElement schemeMedium) #
Reads the scheme-level work calendar name stored in ProcessDefinition.CalendarName.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.

Returns

Type
Description
String
The scheme-level work calendar name.

Remarks

Returns null when no work calendar is specified.
public override List<ActivityDefinition> ParseActivities(XElement schemeMedium) #
Parses the ActivityDefinition instances from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.

Returns

Type
Description
List<ActivityDefinition>
The parsed ActivityDefinition instances.

Exceptions

Type
Description
ArgumentNullException
schemeMedium is null, or the Scheme XML does not contain an Activities element.
public override ActivityTimeout GetExecutionTimeout(XElement schemeMedium) #
Parses the ActivityDefinition.ExecutionTimeout configuration for an activity.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed activity representation.

Returns

Type
Description
ActivityTimeout
The parsed ActivityTimeout configuration.

Remarks

Returns null when no execution timeout is specified.
public override ActivityTimeout GetIdleTimeout(XElement schemeMedium) #
Parses the ActivityDefinition.IdleTimeout configuration for an activity.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed activity representation.

Returns

Type
Description
ActivityTimeout
The parsed ActivityTimeout configuration.

Remarks

Returns null when no idle timeout is specified.
public override List<ActivityExceptionsHandler> GetExceptionsHandlers(XElement schemeMedium) #
Parses the handlers stored in ActivityDefinition.ExceptionsHandlers for an activity.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed activity representation.

Returns

Type
Description
List<ActivityExceptionsHandler>
The parsed ActivityExceptionsHandler instances.
public override List<CodeActionDefinition> ParseCodeActions(XElement schemeMedium) #
Parses the CodeActionDefinition instances from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.

Returns

Type
Description
List<CodeActionDefinition>
The parsed CodeActionDefinition instances.

Exceptions

Type
Description
ArgumentNullException
schemeMedium is null.
public override List<TransitionDefinition> ParseTransitions(XElement schemeMedium, List<ActorDefinition> actorDefinitions, List<CommandDefinition> commandDefinitions, List<ActivityDefinition> activityDefinitions, List<TimerDefinition> timerDefinitions) #
Parses the TransitionDefinition instances from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.
actorDefinitions
List<ActorDefinition>
The parsed ActorDefinition instances used to resolve transition restrictions.
commandDefinitions
List<CommandDefinition>
The parsed CommandDefinition instances used to resolve command triggers.
activityDefinitions
List<ActivityDefinition>
The parsed ActivityDefinition instances used to resolve transition endpoints.
timerDefinitions
List<TimerDefinition>
The parsed TimerDefinition instances used to resolve timer triggers.

Returns

Type
Description
List<TransitionDefinition>
The parsed TransitionDefinition instances.

Exceptions

Type
Description
ArgumentNullException
schemeMedium, commandDefinitions, or activityDefinitions is null.
SchemeNotValidException
A Transition restriction references an Actor that is absent from actorDefinitions.
public override string GetSchemeCode(XElement schemeMedium) #
Reads the process scheme code from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.

Returns

Type
Description
String
The process scheme code.
public override bool GetCanBeInlined(XElement schemeMedium) #
Reads the value for ProcessDefinition.CanBeInlined from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.

Returns

Type
Description
Boolean
true if the process scheme can be inlined into another process scheme; otherwise, false.
public override bool GetLogEnabled(XElement schemeMedium) #
Reads the value for ProcessDefinition.LogEnabled from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.

Returns

Type
Description
Boolean
true if logging is enabled by default for ProcessInstance instances created from the scheme; otherwise, false.
public override DesignerSettings GetDesignerSettings(XElement schemeMedium) #
Parses the DesignerSettings from an unparsed representation.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed representation containing the settings.

Returns

Type
Description
DesignerSettings
The parsed DesignerSettings.

Remarks

Returns DesignerSettings.Empty when the XML contains neither a Designer nor an InlineDesigner element.
public static bool GetConditionInversion(XElement element) #
Reads the value for ConditionDefinition.ConditionInversion from a condition XML element.

Parameters

Name
Type
Description
element
XElement
The XElement containing the condition XML.

Returns

Type
Description
Boolean
The parsed inversion value, or false when the attribute is absent or invalid.
public override ProcessDefinition Parse(WorkflowRuntime workflowRuntime, string scheme, SchemeParsingType schemeParsingType = SchemeParsingType.Strict) #
Parses scheme text into a ProcessDefinition.

Parameters

Name
Type
Description
workflowRuntime
WorkflowRuntime
The WorkflowRuntime whose configuration is available during parsing.
scheme
String
The scheme text to parse.
schemeParsingType
SchemeParsingType
The parsing mode. Use SchemeParsingType.Soft only for an uploaded scheme that may contain an unresolved parameter CLR type.

Returns

Type
Description
ProcessDefinition
The parsed ProcessDefinition.

Exceptions

Type
Description
ArgumentNullException
scheme is null.
XmlException
scheme is not well-formed XML.
public override XElement SerializeToSchemeMedium(ProcessDefinition processDefinition) #
Serializes a ProcessDefinition to the unparsed scheme representation.

Parameters

Name
Type
Description
processDefinition
ProcessDefinition
The ProcessDefinition to serialize.

Returns

Type
Description
XElement
The serialized scheme represented by XElement.

Remarks

The returned XElement has a Process root element.
public override List<string> GetSchemeTags(XElement schemeMedium) #
Reads the tags stored in ProcessDefinition.Tags from an unparsed process scheme.

Parameters

Name
Type
Description
schemeMedium
XElement
The unparsed process scheme representation.

Returns

Type
Description
List<String>
The tags associated with the process scheme.

Remarks

Returns an empty collection when no tags are specified.
public override string GetCommonUsings(XElement element) #
Reads the namespace imports stored in ProcessDefinition.CodeActionsCommonUsings from an unparsed process scheme.

Parameters

Name
Type
Description
element
XElement

Returns

Type
Description
String
The semicolon-delimited namespace imports shared when CodeActionDefinition instances are compiled.

Remarks

Returns null when no shared namespace imports are specified.