Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

Class ProcessDefinition

Represents object model of a scheme of a process

Inheritance

↳ object

    ↳ BaseDefinition

        ↳ ProcessDefinition

Inherited Members

BaseDefinition.Name

BaseDefinition.DesignerSettings

Equals(object)

Equals(object, object)

GetHashCode()

GetType()

ReferenceEquals(object, object)

ToString()

Namespace: OptimaJet.Workflow.Core.Model

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public sealed class ProcessDefinition : BaseDefinition

Constructors

ProcessDefinition()

Declaration
public ProcessDefinition()

Properties

CodeActionsInvoker

Code action invoker with compiled code actions

Declaration
[JsonIgnore]
public CodeActionsInvoker CodeActionsInvoker { get; }
Property value
TypeDescription
CodeActionsInvoker

ExpressionsInvoker

Expressions invoker

Declaration
[JsonIgnore]
public ExpressionsInvoker ExpressionsInvoker { get; }
Property value
TypeDescription
ExpressionsInvoker

SubprocessNameGetterInvoker

Subprocess name getter invoker

Declaration
[JsonIgnore]
public SubprocessNameGetterInvoker SubprocessNameGetterInvoker { get; }
Property value
TypeDescription
SubprocessNameGetterInvoker

ExpressionManager

Expression manager

Declaration
[JsonIgnore]
public ExpressionManager ExpressionManager { get; }
Property value
TypeDescription
ExpressionManager

Actors

List of actors ActorDefinition

Declaration
public List<ActorDefinition> Actors { get; set; }
Property value
TypeDescription
List<ActorDefinition>

Parameters

List of parameters ParameterDefinition

Declaration
public List<ParameterDefinition> Parameters { get; set; }
Property value
TypeDescription
List<ParameterDefinition>

Commands

List of commands CommandDefinition

Declaration
public List<CommandDefinition> Commands { get; set; }
Property value
TypeDescription
List<CommandDefinition>

Timers

List of timers TimerDefinition

Declaration
public List<TimerDefinition> Timers { get; set; }
Property value
TypeDescription
List<TimerDefinition>

Comments

List of comments CommentDefinition

Declaration
public List<CommentDefinition> Comments { get; set; }
Property value
TypeDescription
List<CommentDefinition>

Activities

List of activities ActivityDefinition

Declaration
public List<ActivityDefinition> Activities { get; set; }
Property value
TypeDescription
List<ActivityDefinition>

Transitions

List of transitions TransitionDefinition

Declaration
public List<TransitionDefinition> Transitions { get; set; }
Property value
TypeDescription
List<TransitionDefinition>

Localization

List of localization items Translation

Declaration
public Localization Localization { get; set; }
Property value
TypeDescription
Localization

Localizer

Provides localized strings. For search used ProcessDefinition.Localization property.

Declaration
public Localizer Localizer { get; }
Property value
TypeDescription
Localizer

CodeActions

List of code actions CodeActionDefinition

Declaration
public List<CodeActionDefinition> CodeActions { get; set; }
Property value
TypeDescription
List<CodeActionDefinition>

CodeActionsCommonUsings

List of common usings separated by ;

Declaration
public string CodeActionsCommonUsings { get; set; }
Property value
TypeDescription
string

AdditionalParams

Additional parameters used by Workflow Designer

Declaration
public Dictionary<string, object> AdditionalParams { get; set; }
Property value
TypeDescription
Dictionary<string, object>

CanBeInlined

The flag indicates that this scheme can be inlined into other schemes

Declaration
public bool CanBeInlined { get; set; }
Property value
TypeDescription
bool

LogEnabled

The flag indicates that this scheme will be logging after create ProcessInstance

Declaration
public bool LogEnabled { get; set; }
Property value
TypeDescription
bool

InlinedSchemes

The property contains inlined schemes are used in this scheme

Declaration
public List<string> InlinedSchemes { get; }
Property value
TypeDescription
List<string>

StartingTransition

Declaration
public string StartingTransition { get; set; }
Property value
TypeDescription
string

Tags

The property contains tags that mark the scheme

Declaration
public List<string> Tags { get; }
Property value
TypeDescription
List<string>

ContainsSubprocesses

Returns true if the scheme contains subprocesses

Declaration
[JsonIgnore]
public bool ContainsSubprocesses { get; }
Property value
TypeDescription
bool

InitialActivity

Returns initial activity of the scheme

Declaration
[JsonIgnore]
public ActivityDefinition InitialActivity { get; }
Property value
TypeDescription
ActivityDefinition

ParametersForSerialize

Returns all parameter definitions except system ParameterDefinition.Purpose

Declaration
public ParameterDefinition[] ParametersForSerialize { get; }
Property value
TypeDescription
OptimaJet.Workflow.Core.Model.ParameterDefinition[]

PersistenceParameters

Returns all persisted parameter definitions ParameterDefinition.Purpose

Declaration
public IEnumerable<ParameterDefinition> PersistenceParameters { get; }
Property value
TypeDescription
IEnumerable<ParameterDefinition>

ActorsForSerialize

Returns all parameter definitions except system ParameterDefinition.Purpose

Declaration
public ActorDefinition[] ActorsForSerialize { get; }
Property value
TypeDescription
OptimaJet.Workflow.Core.Model.ActorDefinition[]

DefiningParametersString

Declaration
public string DefiningParametersString { get; set; }
Property value
TypeDescription
string

RootSchemeCode

Declaration
public string RootSchemeCode { get; set; }
Property value
TypeDescription
string

RootSchemeId

Declaration
public Guid? RootSchemeId { get; set; }
Property value
TypeDescription
Guid?

IsObsolete

Declaration
public bool IsObsolete { get; set; }
Property value
TypeDescription
bool

Id

Declaration
public Guid Id { get; set; }
Property value
TypeDescription
Guid

IsSubprocessScheme

Declaration
public bool IsSubprocessScheme { get; }
Property value
TypeDescription
bool

AllowedActivities

Declaration
public List<string> AllowedActivities { get; set; }
Property value
TypeDescription
List<string>

CalendarName

Declaration
public string CalendarName { get; set; }
Property value
TypeDescription
string

Methods

Create(string, bool, List<ActorDefinition>, List<ParameterDefinition>, List<CommandDefinition>, List<TimerDefinition>, List<ActivityDefinition>, List<TransitionDefinition>, List<Translation>, List<CodeActionDefinition>, DesignerSettings, List<string>, bool, string, List<CommentDefinition>, string)

Create ProcessDefinition object

Declaration
public static ProcessDefinition Create(string name, bool canBeInlined, List<ActorDefinition> actors, List<ParameterDefinition> parameters, List<CommandDefinition> commands, List<TimerDefinition> timers, List<ActivityDefinition> activities, List<TransitionDefinition> transitions, List<Translation> localization, List<CodeActionDefinition> codeActions, DesignerSettings designerSettings, List<string> tags, bool logEnabled = false, string commonUsings = null, List<CommentDefinition> comments = null, string calendarName = null)
Parameters
TypeNameDescription
stringnameName of the scheme
boolcanBeInlinedSign that the scheme can be inlined into another schemes
List<ActorDefinition>actorsList of actors <xref href="OptimaJet.Workflow.Core.Model.ActorDefinition" data-throw-if-not-resolved="false"></xref>
List<ParameterDefinition>parametersList of parameters <xref href="OptimaJet.Workflow.Core.Model.ParameterDefinition" data-throw-if-not-resolved="false"></xref>
List<CommandDefinition>commandsList of commands <xref href="OptimaJet.Workflow.Core.Model.CommandDefinition" data-throw-if-not-resolved="false"></xref>
List<TimerDefinition>timersList of timers <xref href="OptimaJet.Workflow.Core.Model.TimerDefinition" data-throw-if-not-resolved="false"></xref>
List<ActivityDefinition>activitiesList of activities <xref href="OptimaJet.Workflow.Core.Model.ActivityDefinition" data-throw-if-not-resolved="false"></xref>
List<TransitionDefinition>transitionsList of transitions <xref href="OptimaJet.Workflow.Core.Model.TransitionDefinition" data-throw-if-not-resolved="false"></xref>
List<Translation>localizationList of localization items <xref href="OptimaJet.Workflow.Core.Model.Translation" data-throw-if-not-resolved="false"></xref>
List<CodeActionDefinition>codeActionsList of code actions <xref href="OptimaJet.Workflow.Core.Model.CodeActionDefinition" data-throw-if-not-resolved="false"></xref>
DesignerSettingsdesignerSettingsDesigner settings
List<string>tagsscheme tags
boollogEnabledSign that the <xref href="OptimaJet.Workflow.Core.Model.ProcessInstance" data-throw-if-not-resolved="false"></xref> will be logging after create
stringcommonUsingsList of common usings separated by ;
List<CommentDefinition>commentsList of comments <xref href="OptimaJet.Workflow.Core.Model.CommentDefinition" data-throw-if-not-resolved="false"></xref>
stringcalendarNameWork calendar name
Returns
TypeDescription
ProcessDefinitionProcessDefinition object

FindActivity(string)

Returns activity with specific name

Declaration
public ActivityDefinition FindActivity(string activityName)
Parameters
TypeNameDescription
stringactivityNameName of the activity <see cref="!:ActivityDefinition.Name"></see>
Returns
TypeDescription
ActivityDefinitionActivityDefinition object

FindSetStateActivity(string)

Returns activity with specific state name and possibility to set the state

Declaration
public ActivityDefinition FindSetStateActivity(string stateName)
Parameters
TypeNameDescription
stringstateNameName of the state
Returns
TypeDescription
ActivityDefinitionActivityDefinition object

FindCommand(string)

Returns command with specific name

Declaration
public CommandDefinition FindCommand(string name)
Parameters
TypeNameDescription
stringnameName of the command <see cref="!:CommandDefinition.Name"></see>
Returns
TypeDescription
CommandDefinitionCommandDefinition object

FindActor(string)

Returns actor with specific name

Declaration
public ActorDefinition FindActor(string name)
Parameters
TypeNameDescription
stringnameName of the actor <see cref="!:ActorDefinition.Name"></see>
Returns
TypeDescription
ActorDefinitionActorDefinition object

FindParameterDefinition(string)

Returns the parameter specific name

Declaration
public ParameterDefinition FindParameterDefinition(string name)
Parameters
TypeNameDescription
stringnameName of the parameter <see cref="!:ParameterDefinition.Name"></see>
Returns
TypeDescription
ParameterDefinitionParameterDefinition object

FindTransition(string)

Returns transition with specific name

Declaration
public TransitionDefinition FindTransition(string name)
Parameters
TypeNameDescription
stringnameName of the transition <see cref="!:TransitionDefinition.Name"></see>
Returns
TypeDescription
TransitionDefinitionTransitionDefinition object

FindTransitions(ActivityDefinition, ActivityDefinition)

Returns transitions linked by specified activities

Declaration
public List<TransitionDefinition> FindTransitions(ActivityDefinition from, ActivityDefinition to)
Parameters
TypeNameDescription
ActivityDefinitionfromFrom activity <xref href="OptimaJet.Workflow.Core.Model.TransitionDefinition.From" data-throw-if-not-resolved="false"></xref>
ActivityDefinitiontoTo activity <xref href="OptimaJet.Workflow.Core.Model.TransitionDefinition.To" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
List<TransitionDefinition>List of TransitionDefinition objects

GetPossibleTransitionsForActivity(ActivityDefinition, ForkTransitionSearchType)

Returns the list of all outgoing transitions for specific activity

Declaration
public IEnumerable<TransitionDefinition> GetPossibleTransitionsForActivity(ActivityDefinition activity, ForkTransitionSearchType forkTransitionSearch = ForkTransitionSearchType.NotFork)
Parameters
TypeNameDescription
ActivityDefinitionactivityActivity definition
ForkTransitionSearchTypeforkTransitionSearchSearch filter for fork transitions
Returns
TypeDescription
IEnumerable<TransitionDefinition>List of all outgoing transitions

GetCommandTransitions(ActivityDefinition, ForkTransitionSearchType)

Returns the list of all outgoing command transitions for specific activity TriggerType.Command

Declaration
public IEnumerable<TransitionDefinition> GetCommandTransitions(ActivityDefinition activity, ForkTransitionSearchType forkTransitionSearch = ForkTransitionSearchType.NotFork)
Parameters
TypeNameDescription
ActivityDefinitionactivityActivity definition
ForkTransitionSearchTypeforkTransitionSearchSearch filter for fork transitions
Returns
TypeDescription
IEnumerable<TransitionDefinition>List of all outgoing command transitions

GetAutoTransitionForActivity(ActivityDefinition, ForkTransitionSearchType)

Returns the list of all outgoing auto transitions for specific activity TriggerType.Auto

Declaration
public IEnumerable<TransitionDefinition> GetAutoTransitionForActivity(ActivityDefinition activity, ForkTransitionSearchType forkTransitionSearch = ForkTransitionSearchType.NotFork)
Parameters
TypeNameDescription
ActivityDefinitionactivityActivity definition
ForkTransitionSearchTypeforkTransitionSearchSearch filter for fork transitions
Returns
TypeDescription
IEnumerable<TransitionDefinition>List of all outgoing auto transitions

GetCommandTransitionForActivity(ActivityDefinition, string, ForkTransitionSearchType)

Returns the list of all outgoing command transitions for specific activity TriggerType.Command whis specific command name !:CommandDefinition.Name

Declaration
public IEnumerable<TransitionDefinition> GetCommandTransitionForActivity(ActivityDefinition activity, string commandName, ForkTransitionSearchType forkTransitionSearch = ForkTransitionSearchType.NotFork)
Parameters
TypeNameDescription
ActivityDefinitionactivityActivity definition
stringcommandNameName of the command
ForkTransitionSearchTypeforkTransitionSearchSearch filter for fork transitions
Returns
TypeDescription
IEnumerable<TransitionDefinition>List of all outgoing command transitions whis specific command name

GetTimerTransitionForActivity(ActivityDefinition, ForkTransitionSearchType)

Returns the list of all outgoing timer transitions for specific activity TriggerType.Timer

Declaration
public IEnumerable<TransitionDefinition> GetTimerTransitionForActivity(ActivityDefinition activity, ForkTransitionSearchType forkTransitionSearch = ForkTransitionSearchType.NotFork)
Parameters
TypeNameDescription
ActivityDefinitionactivityActivity definition
ForkTransitionSearchTypeforkTransitionSearchSearch filter for fork transitions
Returns
TypeDescription
IEnumerable<TransitionDefinition>List of all outgoing timer transitions

GetLocalizedStateName(string, CultureInfo)

Returns localized state name in specific culture

Declaration
public string GetLocalizedStateName(string name, CultureInfo culture = null)
Parameters
TypeNameDescription
stringnameSystem state name
CultureInfocultureDesired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
stringLocalized state name if exists, else input <code data-dev-comment-type="paramref" class="paramref">name</code>

GetLocalizedCommandName(string, CultureInfo)

Returns localized command name in specific culture

Declaration
public string GetLocalizedCommandName(string name, CultureInfo culture = null)
Parameters
TypeNameDescription
stringnameSystem command name
CultureInfocultureDesired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
stringLocalized command name if exists, else input <code data-dev-comment-type="paramref" class="paramref">name</code>

GetLocalizedParameterName(string, CultureInfo)

Returns localized parameter name in specific culture

Declaration
public string GetLocalizedParameterName(string name, CultureInfo culture = null)
Parameters
TypeNameDescription
stringnameSystem parameter name
CultureInfocultureDesired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
stringLocalized parameter name if exists, else input <code data-dev-comment-type="paramref" class="paramref">name</code>

GetLocalizedActionName(string, CultureInfo)

Returns localized action name in specific culture

Declaration
public string GetLocalizedActionName(string name, CultureInfo culture = null)
Parameters
TypeNameDescription
stringnameSystem action name
CultureInfocultureDesired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
stringLocalized action name if exists, else input <code data-dev-comment-type="paramref" class="paramref">name</code>

GetLocalizedConditionName(string, CultureInfo)

Returns localized condition name in specific culture

Declaration
public string GetLocalizedConditionName(string name, CultureInfo culture = null)
Parameters
TypeNameDescription
stringnameSystem condition name
CultureInfocultureDesired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
stringLocalized condition name if exists, else input <code data-dev-comment-type="paramref" class="paramref">name</code>

GetLocalizedSchemeName(CultureInfo)

Returns localized scheme name in specific culture

Declaration
public string GetLocalizedSchemeName(CultureInfo culture = null)
Parameters
TypeNameDescription
CultureInfocultureDesired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
stringLocalized scheme name if exists, else just <see cref="!:ProcessDefinition.Name"></see>

GetLocalizedComment(string, CultureInfo)

Returns localized comment in specific culture

Declaration
public string GetLocalizedComment(string key, CultureInfo culture = null)
Parameters
TypeNameDescription
stringkeyKey for search localized comment
CultureInfocultureDesired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
stringLocalized value if exists, else input <code data-dev-comment-type="paramref" class="paramref">key</code>

Clone()

Declaration
public ProcessDefinition Clone()
Returns
TypeDescription
ProcessDefinition

Clone(bool, bool, bool)

Clones ProcessDefinition object

Declaration
public ProcessDefinition Clone(bool doNotCloneActivities, bool doNotCloneTransitions, bool doNotCloneCodeActions)
Parameters
TypeNameDescription
booldoNotCloneActivitiesIf True activity list will be empty after cloning
booldoNotCloneTransitionsIf True transition list will be empty after cloning
booldoNotCloneCodeActionsIf True code actions list will be empty after cloning
Returns
TypeDescription
ProcessDefinitionCloned ProcessDefinition object

GetSchemeCodeForActionCall()

Returns the code of the scheme from which the actions are called. For a subprocess it will be RootSchemeCode for root (ordinary) process it will be Name

Declaration
public string GetSchemeCodeForActionCall()
Returns
TypeDescription
string

Serialize()

Declaration
public string Serialize()
Returns
TypeDescription
string

SerializeToXElement()

Declaration
public XElement SerializeToXElement()
Returns
TypeDescription
XElement

GetActivityAnnotation<T>(string, string)

Get an annotation of an activity

Declaration
public T GetActivityAnnotation<T>(string activityName, string name)
Parameters
TypeNameDescription
stringactivityNameActivity name
stringnameAnnotation name
Returns
TypeDescription
{T}Annotation value

GetActivityAnnotation(string, string)

Get a JSON representation of annotation's value of an activity

Declaration
public string GetActivityAnnotation(string activityName, string name)
Parameters
TypeNameDescription
stringactivityNameActivity name
stringnameAnnotation name
Returns
TypeDescription
stringJSON representation of annotation's value

GetTransitionAnnotation<T>(string, string)

Get an annotation of a transition

Declaration
public T GetTransitionAnnotation<T>(string transitionName, string name)
Parameters
TypeNameDescription
stringtransitionNameTransition name
stringnameAnnotation name
Returns
TypeDescription
{T}Annotation value

GetTransitionAnnotation(string, string)

Get a JSON representation of annotation's value of a transition

Declaration
public string GetTransitionAnnotation(string transitionName, string name)
Parameters
TypeNameDescription
stringtransitionNameTransition name
stringnameAnnotation name
Returns
TypeDescription
stringJSON representation of annotation's value

Extension Methods

Stay in the know
Build Workflow Applications Faster
Star us on GitHub