• Guides
  • API Reference
  • Changelog
Show / Hide Table of Contents
  • DCR
    • EventKind
    • Expression
    • Flat
    • Graph
    • IEvent
    • Marking
    • NotEnabled
    • Path
    • TimeManager
    • Tools
    • UserNotAllowed
    • Value
  • DCR.Time
    • Duration
    • Timezones

Class Graph

Representation of a DCR graph

Inheritance
System.Object
Graph
Namespace: DCR
Assembly: Engine.dll
Syntax
public class Graph : Object

Constructors

Graph()

Construct the DCR graph with no events

Declaration
public Graph()

Graph(Acta.Process<Ex.Info>)

Declaration
public Graph(Acta.Process<Ex.Info> G)
Parameters
Type Name Description
DCR.Core.Acta.Process<DCR.Xml.Ex.Info> G

Graph(Acta.Process<Ex.Info>, FSharpList<Tuple<Log.Entry<Log.Event, XElement>, FSharpList<Tuple<String, String>>>>)

Declaration
public Graph(Acta.Process<Ex.Info> G0, FSharpList<Tuple<Log.Entry<Log.Event, XElement>, FSharpList<Tuple<string, string>>>> l)
Parameters
Type Name Description
DCR.Core.Acta.Process<DCR.Xml.Ex.Info> G0
Microsoft.FSharp.Collections.FSharpList<System.Tuple<DCR.Log.Entry<DCR.Log.Event, System.Xml.Linq.XElement>, Microsoft.FSharp.Collections.FSharpList<System.Tuple<System.String, System.String>>>> l

Graph(Graph)

Copy constructor

Declaration
public Graph(Graph dcr)
Parameters
Type Name Description
Graph dcr

Graph(Log.Trace<Log.Entry<Log.Event, XElement>>[])

Graph with given events only

Declaration
public Graph(Log.Trace<Log.Entry<Log.Event, XElement>>[] l)
Parameters
Type Name Description
DCR.Log.Trace<DCR.Log.Entry<DCR.Log.Event, System.Xml.Linq.XElement>>[] l

Properties

Custom

XML serialisation of the "Custom" part of the graph or null if the graph does not have custom XML. The latter will happen when the graph was not constructed from XML serialization.

Declaration
public XElement Custom { get; set; }
Property Value
Type Description
System.Xml.Linq.XElement

Stored XML

Remarks

The set implementation clones the given XElement.

G

Declaration
public Acta.Process<Ex.Info> G { get; set; }
Property Value
Type Description
DCR.Core.Acta.Process<DCR.Xml.Ex.Info>

LogToXml

Declaration
public XElement LogToXml { get; }
Property Value
Type Description
System.Xml.Linq.XElement

P

Declaration
public Acta.Node<Ex.Info> P { get; set; }
Property Value
Type Description
DCR.Core.Acta.Node<DCR.Xml.Ex.Info>

Time

Current time of the graph

Declaration
public DateTimeOffset Time { get; set; }
Property Value
Type Description
System.DateTimeOffset

The time against which time-sensitive operations (deadlines, delays) is compared

Remarks

The result of setting this to value earlier than the current one is undefined.

TimeManager

Time manager for all graphs

Declaration
public static TimeManager TimeManager { get; set; }
Property Value
Type Description
TimeManager
Remarks

The TimeManager is invoked in situations where computing a relative limit for a response or a condition requires additional information. See TimeManager for more information.

Version

Declaration
public static string Version { get; }
Property Value
Type Description
System.String

Methods

AddCondition(String, String, Expression, Path)

Add a condition relation

Declaration
public void AddCondition(string src, string tgt, Expression guard, Path loc)
Parameters
Type Name Description
System.String src

The name of the source event (see remark)

System.String tgt

The name of the target event (see remark)

Expression guard

The guard governing whether the relation is active, or null if it is permanently active

Path loc

The location at which the relation should be defined, or null to define it at the top-level.

Remarks

Since the relation is defined at the location loc, it is sufficient to specify the name of the target and source events, rather than their complete paths. E.g., to add a condition relation from P[2].B to P[2].C, defining the relation inside the subprocess P[2], use this code:

  graph.AddCondition("B", "C", 0, null, new Path("P[2]"));

AddCondition(String, String, Duration, Expression, Path)

Add a condition relation

Declaration
public void AddCondition(string src, string tgt, Duration delay, Expression guard, Path loc)
Parameters
Type Name Description
System.String src

The name of the source event (see remark)

System.String tgt

The name of the target event (see remark)

Duration delay

The delay required by the condition.

Expression guard

The guard governing whether the relation is active, or null if it is permanently active

Path loc

The location at which the relation should be defined, or null to define it at the top-level.

Remarks

Since the relation is defined at the location loc, it is sufficient to specify the name of the target and source events, rather than their complete paths. E.g., to add a condition relation from P[2].B to P[2].C, defining the relation inside the subprocess P[2], use this code:

  graph.AddCondition("B", "C", 0, null, new Path("P[2]"));

Refer to DCR.Graph.AddCondition(System.String,System.String,System.Int32,DCR.Expression,DCR.Path) for a variant that does not require specification of a delay.

AddCoResponse(String, String, Expression, Path)

Add a co-reponse

Declaration
public void AddCoResponse(string src, string tgt, Expression guard, Path loc)
Parameters
Type Name Description
System.String src
System.String tgt
Expression guard
Path loc
Remarks

Refer to DCR.Graph.AddCondition(System.String,System.String,System.Int32,DCR.Expression,DCR.Path) for an explanation of parameters

AddEvent(Path)

Add an event to the graph

Declaration
public void AddEvent(Path evt)
Parameters
Type Name Description
Path evt

The event to add

Remarks

This is a short-hand function for constructing a located event with the default marking, taking the final part of the event id as the label of the event. See AddEvent(Path, Marking) for more details, or how to specify non-default label and marking.

Examples

Define an event with id "A" and label "A" at the root:

    graph.AddEvent(new Path("A"));

AddEvent(Path, Marking)

Add an event to the graph

Declaration
public void AddEvent(Path evt, Marking m)
Parameters
Type Name Description
Path evt

The path of the event

Marking m

The marking of the event

Remarks

The event will be defined and located at the location implicit in the path, i.e.,

Path Event added
A.B Create an event B defined and located inside the event A
P[8].B Create an event B defined and located inside the 8'th instance of the subprocess P

To define an event without locating it, use DCR.Graph.AddEventDefinition(DCR.Path) Refer to the location guide for details on the distinction between location of definition and location.

Examples

The most common usage is when the new event should be defined at the root:

    graph.AddEvent(new Path("A"), new Marking("A"));

AddEventDefinition(Path, Marking)

Add an event definition to the graph

Declaration
public void AddEventDefinition(Path evt, Marking m)
Parameters
Type Name Description
Path evt

The path to define

Marking m

The marking of the defined event

Remarks

The event will be defined at the location implicit in the path, i.e.,

Path Event added
A.B Create an event B inside the event A
P[8].B Create an event B inside the 8'th instance of the subprocess P

Note that this method only defines the event, it does not locate it. Use subsequent calls to AddLocation(Path, String) to locate the event. If you want to define and locate an event at the same location, use AddEvent(Path, Marking). Refer to the location guide for details on the distinction between location of definition and location.

The event is created with the default marking. Use GetMarking and SetMarking to subsequently retrieve, update, and store the marking of the new event.

Examples

Define an event with id "A", label "Payout" at the root, but do not locate it:

    graph.AddEvent(new Path("A"), new Marking("Payout"));

AddExclude(String, String, Expression, Path)

Add an exclude relation

Declaration
public void AddExclude(string src, string tgt, Expression guard, Path loc)
Parameters
Type Name Description
System.String src
System.String tgt
Expression guard
Path loc
Remarks

Refer to DCR.Graph.AddCondition(System.String,System.String,System.Int32,DCR.Expression,DCR.Path) for an explanation of parameters

AddInclude(String, String, Expression, Path)

Add an include relation

Declaration
public void AddInclude(string src, string tgt, Expression guard, Path loc)
Parameters
Type Name Description
System.String src
System.String tgt
Expression guard
Path loc
Remarks

Refer to DCR.Graph.AddCondition(System.String,System.String,System.Int32,DCR.Expression,DCR.Path) for an explanation of parameters

AddLocation(Path, String)

Place an event

Declaration
public void AddLocation(Path loc, string e)
Parameters
Type Name Description
Path loc

The location at which to put the event

System.String e

The event to locate

Remarks

The core engine will work correctly if events are placed in more than one location, however, serialisation to XML is in this case undefined.

Examples

Suppose we want to nest the event A inside the (nesting) event N:

graph.AddLocation (new Path("N"), "A");

AddMilestone(String, String, Expression, Path)

Add a milestone

Declaration
public void AddMilestone(string src, string tgt, Expression guard, Path loc)
Parameters
Type Name Description
System.String src
System.String tgt
Expression guard
Path loc
Remarks

Refer to DCR.Graph.AddCondition(System.String,System.String,System.Int32,DCR.Expression,DCR.Path) for an explanation of parameters

AddResponse(String, String, Expression, Path)

Add a response relation.

Declaration
public void AddResponse(string src, string tgt, Expression guard, Path loc)
Parameters
Type Name Description
System.String src
System.String tgt
Expression guard
Path loc
Remarks

Refer to DCR.Graph.AddCondition(System.String,System.String,System.Int32,DCR.Expression,DCR.Path) for an explanation of parameters

AddResponse(String, String, Duration, Expression, Path)

Add a response relation.

Declaration
public void AddResponse(string src, string tgt, Duration delay, Expression guard, Path loc)
Parameters
Type Name Description
System.String src
System.String tgt
Duration delay

If null, the response has no deadline; if k, the response must happen within k time units

Expression guard
Path loc
Remarks

Refer to DCR.Graph.AddCondition(System.String,System.String,System.Int32,DCR.Expression,DCR.Path) for an explanation of parameters

AddSpawn(String, String, Expression, Path)

Add a spawn relation.

Declaration
public void AddSpawn(string src, string id, Expression guard, Path loc)
Parameters
Type Name Description
System.String src
System.String id

Spawn the body with this template id.

Expression guard
Path loc
Remarks

Refer to DCR.Graph.AddCondition(System.String,System.String,System.Int32,DCR.Expression,DCR.Path) for an explanation of remaining parameters

AddSpawn(String, String, Graph, Expression, Path)

Add a spawn relation.

Declaration
public void AddSpawn(string src, string id, Graph body, Expression guard, Path loc)
Parameters
Type Name Description
System.String src
System.String id

Assign this template id to the supplied body.

Graph body

The content of the new graph (fragment) spawned. The body graph should have a single top-level event of type subprocess.

Expression guard
Path loc
Remarks

Refer to DCR.Graph.AddCondition(System.String,System.String,System.Int32,DCR.Expression,DCR.Path) for an explanation of remaining parameters

CheckExpression(String)

Check if a given expression is valid (short form)

Declaration
public string CheckExpression(string expr)
Parameters
Type Name Description
System.String expr
Returns
Type Description
System.String

CheckExpression(String, Path)

Check if a given expression is valid

Declaration
public string CheckExpression(string expr, Path path)
Parameters
Type Name Description
System.String expr

The expression to check

Path path

The path at which to chech for validity

Returns
Type Description
System.String

null if the expression is valid, a descriptive error message otherwise

Remarks

The path argument is relevant when the expr argument refers to other events which are defined below the root. For example, suppose we have a graph in which the subprocess P defines an event X:

 A
 P 
   X
   if X > 0 then X -->% A

In this case, evaluating the expression X > 0 at the root of the graph is undefined, whereas evaluating the same expresssion at location P is defined (but null).

CheckExpressionType(String, Path, String)

Check if a given expression is valid and returns specific type

Declaration
public string CheckExpressionType(string expr, Path path, string typ)
Parameters
Type Name Description
System.String expr

The expression to check

Path path

The path at which to chech for validity

System.String typ

String determining which type we are checking the expression for. Valid strings are: "string", "bool", "int", "double", "date", "duration"

Returns
Type Description
System.String

null if the expression is correct type, a descriptive error message otherwise

Remarks

The path argument is relevant when the expr argument refers to other events which are defined below the root. For example, suppose we have a graph in which the subprocess P defines an event X:

 A
 P 
   X
   if X > 0 then X -->% A

In this case, evaluating the expression X > 0 at the root of the graph is undefined, whereas evaluating the same expresssion at location P is defined (but null).

CheckExpressionType(String, String)

Check if an expression returns a specific type (short form)

Declaration
public string CheckExpressionType(string expr, string typ)
Parameters
Type Name Description
System.String expr
System.String typ
Returns
Type Description
System.String

Deadline()

Minimum deadline

Declaration
public Nullable<DateTimeOffset> Deadline()
Returns
Type Description
System.Nullable<System.DateTimeOffset>

The closest point in time after the graph's current time at which an activity must execute, or Null if there is no such point.

Delay()

Declaration
public Nullable<DateTimeOffset> Delay()
Returns
Type Description
System.Nullable<System.DateTimeOffset>

The closest point in time after the graph's current time at which a delay runs out, or Null if there is no such point. This will very often, but not always, coincide with an event becoming enabled.

Delta(Graph, Boolean)

Compute the difference in markings

Declaration
public XElement Delta(Graph other, bool full_enabled)
Parameters
Type Name Description
Graph other

The graph to compare against

System.Boolean full_enabled

If true, report all enabled event in this as having become enabled

Returns
Type Description
System.Xml.Linq.XElement

XML serialisation of changes required to change the markings of other to the markings of this.

Remarks

This is a legacy method required by dcrgraphs.net.

Enabled()

Enabled events

Declaration
public IEnumerable<Path> Enabled()
Returns
Type Description
System.Collections.Generic.IEnumerable<Path>

An enumeration of the enabled events of the graph

Remarks

The enumeration is stable under subsequent updates to the graph; in particular, calls to Execute and Advance will not render the enumeration undefined. However, careless use of the modification API may remove returned events from the graph, at which point using them as arguments for GetMarking or the like on them will throw.

EvalExpression(String)

Evaluate a given expression

Declaration
public Value EvalExpression(string expr)
Parameters
Type Name Description
System.String expr

The expression to check

Returns
Type Description
Value

The Value of the expression

Remarks

If the expression cannot be evaluated, an exception will be thrown.

Events()

List summarising information for all events

Declaration
public IEnumerable<IEvent> Events()
Returns
Type Description
System.Collections.Generic.IEnumerable<IEvent>

An enumeration of all event definition paths, their markings, and their enabled state

Remarks

If you wish to work with some subset of events, say, those that are either pending or disabled, this method is helpful:

    var enabledOrPending = 
        from evt in graph.Events()
        where evt.Enabled &amp;&amp; evt.Marking.Pending
        select evt;

Comments for Enabled() apply.

Execute(Path)

Execute an event

Declaration
public void Execute(Path evt)
Parameters
Type Name Description
Path evt

A Path identifying the event to execute

Remarks

This method may throw the following exceptions:

Exception Circumstances
Loader.SyntaxError A data expression (typically a guard) was malformed
NotEnabled The requested event was not enabled
UserNotAllowed The requested event is not allowed to be executed by current user
D.Err Less common errors; refer to exception description

Execute(Path, Value)

Execute an event with data

Declaration
public void Execute(Path evt, Value data)
Parameters
Type Name Description
Path evt

A Path identifying the event to execute

Value data

The data value to assign to the event upon succesful execution

Remarks

This method may throw the following exceptions:

Exception Circumstances
Loader.SyntaxError A data expression (typically a guard) was malformed
NotEnabled The requested event was not enabled
UserNotAllowed The requested event is not allowed to be executed by current user
D.Err Less common errors; refer to exception description

Execute(Path, String)

Execute an event

Declaration
public void Execute(Path evt, string role)
Parameters
Type Name Description
Path evt

A Path identifying the event to execute

System.String role

The role trying to execute this event

Remarks

This method may throw the following exceptions:

Exception Circumstances
Loader.SyntaxError A data expression (typically a guard) was malformed
NotEnabled The requested event was not enabled
UserNotAllowed The requested event is not allowed to be executed by current user
D.Err Less common errors; refer to exception description

Execute(Path, String, Value)

Execute an event

Declaration
public void Execute(Path evt, string role, Value data)
Parameters
Type Name Description
Path evt

A Path identifying the event to execute

System.String role

The role trying to execute this event

Value data

The data value to assign to the event upon succesful execution

Remarks

This method may throw the following exceptions:

Exception Circumstances
Loader.SyntaxError A data expression (typically a guard) was malformed
NotEnabled The requested event was not enabled
UserNotAllowed The requested event is not allowed to be executed by current user
D.Err Less common errors; refer to exception description

Execute(Path, String, String)

Execute an event

Declaration
public void Execute(Path evt, string role, string userid)
Parameters
Type Name Description
Path evt

A Path identifying the event to execute

System.String role

The role trying to execute this event

System.String userid

The userid trying to execute this event

Remarks

This method may throw the following exceptions:

Exception Circumstances
Loader.SyntaxError A data expression (typically a guard) was malformed
NotEnabled The requested event was not enabled
UserNotAllowed The requested event is not allowed to be executed by current user
D.Err Less common errors; refer to exception description

Execute(Path, String, String, Value)

Execute an event

Declaration
public void Execute(Path evt, string role, string userid, Value data)
Parameters
Type Name Description
Path evt

A Path identifying the event to execute

System.String role

The role trying to execute this event

System.String userid

The userid trying to execute this event

Value data

The data value to assign to the event upon succesful execution

Remarks

This method may throw the following exceptions:

Exception Circumstances
Loader.SyntaxError A data expression (typically a guard) was malformed
NotEnabled The requested event was not enabled
D.Err Less common errors; refer to exception description

ExecuteTransaction(XDocument, Path)

Execute a sequence of events transactionally

Declaration
public void ExecuteTransaction(XDocument log, Path container)
Parameters
Type Name Description
System.Xml.Linq.XDocument log

An XDocument containing a DCR log

Path container

The subprocess to consider the container of the transaction.

ExecuteTransaction(XDocument, Path, String)

Execute a sequence of events transactionally

Declaration
public void ExecuteTransaction(XDocument log, Path container, string userid)
Parameters
Type Name Description
System.Xml.Linq.XDocument log

An XDocument containing a DCR log

Path container

The subprocess to consider the container of the transaction.

System.String userid

The id of the user executing this transaction

ExecuteTransaction(XElement, Path)

Execute a sequence of events transactionally

Declaration
public void ExecuteTransaction(XElement elem, Path container)
Parameters
Type Name Description
System.Xml.Linq.XElement elem
Path container

The subprocess to consider the container of the transaction.

ExecuteTransaction(XElement, Path, String)

Execute a sequence of events transactionally

Declaration
public void ExecuteTransaction(XElement elem, Path container, string userid)
Parameters
Type Name Description
System.Xml.Linq.XElement elem

An XElement containing a DCR log

Path container

The subprocess to consider the container of the transaction.

System.String userid

The id of the user executing this transaction

Remarks

The execution is atomic in the sense that the container subprocess is not allowed to fire as a result of events in the sequence firing, until the very end.

FindISO8601Time(String)

Short version where we fixing 'time' to current process time

Declaration
public string FindISO8601Time(string expr)
Parameters
Type Name Description
System.String expr

A date or duration expression to calculate with regards to current process time

Returns
Type Description
System.String

FindISO8601Time(String, String)

Calculate a new date with 'expr' with regards to the date in 'time'

Declaration
public string FindISO8601Time(string expr, string time)
Parameters
Type Name Description
System.String expr

A date or duration expression to be calculated in regards to a DateTimeOffset

System.String time

ISO8601 DateTimeOffset string to be the date, expr is calculated from

Returns
Type Description
System.String

Flatten()

Flatten the graph

Declaration
public Flat Flatten()
Returns
Type Description
Flat

A data structure represented events and relations of the flattened graph.

Remarks

Flattening expands all nestings into the relations they imply, e.g., a graph

nesting M { A B } 
nesting N { C D }
M *--> N

will be flattened to

A *--> C
A *--> D
B *--> C
B *--> D

Flattening of subprocesses is undefined (unimplemented, in fact), and generally will not do what you want.

Flattening of graphs with spawn relations or co-response relations will fail.

FromXml(XDocument)

Deserialize DCR graph from XML

Declaration
public static Graph FromXml(XDocument xml)
Parameters
Type Name Description
System.Xml.Linq.XDocument xml
Returns
Type Description
Graph

GetEnabledAndPending()

Declaration
public IEnumerable<IEvent> GetEnabledAndPending()
Returns
Type Description
System.Collections.Generic.IEnumerable<IEvent>

GetEnabledOrPending()

Return all Enabled or Pending events

Declaration
public IEnumerable<IEvent> GetEnabledOrPending()
Returns
Type Description
System.Collections.Generic.IEnumerable<IEvent>

GetMarking(Path)

Retrieve the marking of an event

Declaration
public Marking GetMarking(Path path)
Parameters
Type Name Description
Path path

A path to the event to access

Returns
Type Description
Marking
Remarks

Regular events, Nesting events and Container events all markings, whereas subprocesses do not.

Initialise()

Initialise the graph

Declaration
public void Initialise()
Remarks

You need to call initialise iff

  1. is serialised from XML with non-empty globalStore, and
  2. references a variable defined in that globalStore in an expression

or

  1. you have initial deadlines or delays; these will be evaluated wrt. Time.

It is permitted but not necessary to Initialise more than once.

Insert(Graph, Path, IDictionary<String, String>)

Insert graph under subprocess

Declaration
public void Insert(Graph other, Path loc, IDictionary<string, string> subst)
Parameters
Type Name Description
Graph other

The graph to insert

Path loc

The location under which to insert the graph. This should be a path to a location of a subprocess. The previous contents of this location, if any, will be silently removed.

NB! Because of the very complex rules of serialization of subprocesses currently required by the portal, inserted subprocess will be serialised correctly only if the event either (a) was deserialized from XML the referId attribute set, or (b) was programmatically constructed to have associated XML with the referId attribute set.

System.Collections.Generic.IDictionary<System.String, System.String> subst

A substitution to apply to the inserted graph. The substitution allows events in the inserted graph to be fused with events in the current graph. E.g., supplying the substitution A -> B will remove A from the top-level marking of other, then replace all references to the event A in guards, relations, and locations with references to the event B.

Remarks

The substitution is useful when using this method for composition of graphs. The intended use is that B is an event of the outer graph, and A is an event of the inner graph which we would really prefer be B instead.

IsAccepting()

Acceptance state

Declaration
public bool IsAccepting()
Returns
Type Description
System.Boolean

true iff the graph is accepting (has no included, pending events)

IsEnabled(Path)

Check whether an event is enabled

Declaration
public bool IsEnabled(Path evt)
Parameters
Type Name Description
Path evt
Returns
Type Description
System.Boolean

True if the specified event is enabled, otherwise false

Load(String)

Load DCR graph from file

Declaration
public static Graph Load(string file)
Parameters
Type Name Description
System.String file
Returns
Type Description
Graph

Normalise(Path)

Normalise a path

Declaration
public Path Normalise(Path path)
Parameters
Type Name Description
Path path

A Path to normalise

Returns
Type Description
Path

The unique fully-expanded corresponding path

Remarks

The engine generally will accept missing path components in a location or event definition path, provided there is a unique expansion of the provided path fragment. This function computes the internally used full path for a given path fragment.

Note(Path, String)

Add a note to the current log

Declaration
public void Note(Path evt, string description)
Parameters
Type Name Description
Path evt

A Path identifying the event to execute

System.String description
Remarks

The note will appear in the log as a note tag

Parse(String)

Parse DCR graph from string

Declaration
public static Graph Parse(string s)
Parameters
Type Name Description
System.String s
Returns
Type Description
Graph

ParseDuration(String, out Duration)

Declaration
public static bool ParseDuration(string str, out Duration d)
Parameters
Type Name Description
System.String str
Duration d
Returns
Type Description
System.Boolean

ParseToValue(Path, String)

Parses an input string to fit the data type of an event if this is set. Uses Value.Parse if not.

Declaration
public Value ParseToValue(Path evt, string value)
Parameters
Type Name Description
Path evt

path to event with set data type

System.String value

the value that are to be parsed

Returns
Type Description
Value

Paths()

List all paths to event definitions

Declaration
public IEnumerable<Path> Paths()
Returns
Type Description
System.Collections.Generic.IEnumerable<Path>

An enumeration of every path to an event definition in the graph

Remarks

Comments for Enabled() apply. See the @Location Guide for more on the distinction between definition and location.

RemoveCondition(Path, String, String)

Remove a condition relation from the graph

Declaration
public void RemoveCondition(Path evt, string src, string tgt)
Parameters
Type Name Description
Path evt

A path to the definition of the relation to remove

System.String src

The name of the source of the relation at that path

System.String tgt

The name of the target of the relation at that path

RemoveEvent(Path)

Remove an event from the graph

Declaration
public void RemoveEvent(Path evt)
Parameters
Type Name Description
Path evt

A path to the definition of the event to remove

Remarks

This method will automatically remove all relations for which the event is a source or target; however, after the call succeeds, the event may still be mentioned in guards or other data expressions.

RemoveExclude(Path, String, String)

Remove an exclude relation from the graph

Declaration
public void RemoveExclude(Path evt, string src, string tgt)
Parameters
Type Name Description
Path evt

A path to the definition of the relation to remove

System.String src

The name of the source of the relation at that path

System.String tgt

The name of the target of the relation at that path

RemoveInclude(Path, String, String)

Remove an include relation from the graph

Declaration
public void RemoveInclude(Path evt, string src, string tgt)
Parameters
Type Name Description
Path evt

A path to the definition of the relation to remove

System.String src

The name of the source of the relation at that path

System.String tgt

The name of the target of the relation at that path

RemoveLocation(Path, String)

Remove the placement of an event

Declaration
public void RemoveLocation(Path loc, string e)
Parameters
Type Name Description
Path loc

The location at which to put the event

System.String e

The event to locate

Remarks

This is the inverse of AddLocation(Path, String)

RemoveMilestone(Path, String, String)

Remove a mileston relation from the graph

Declaration
public void RemoveMilestone(Path evt, string src, string tgt)
Parameters
Type Name Description
Path evt

A path to the definition of the relation to remove

System.String src

The name of the source of the relation at that path

System.String tgt

The name of the target of the relation at that path

RemoveResponse(Path, String, String)

Remove a response relation from the graph

Declaration
public void RemoveResponse(Path evt, string src, string tgt)
Parameters
Type Name Description
Path evt

A path to the definition of the relation to remove

System.String src

The name of the source of the relation at that path

System.String tgt

The name of the target of the relation at that path

RemoveSpawn(Path, String)

Remove a spawn relation from the graph

Declaration
public void RemoveSpawn(Path evt, string src)
Parameters
Type Name Description
Path evt

A path to the definition of the spawn relation to remove

System.String src

The name of the source of the spawn at that path

RemoveSpawn(Path, String, String)

Remove a spawn relation from the graph

Declaration
public void RemoveSpawn(Path evt, string src, string tgt)
Parameters
Type Name Description
Path evt

A path to the definition of the spawn relation to remove

System.String src

The name of the source of the spawn at that path

System.String tgt

The name of the single top-level event in the body of the spawned graph

Roles()

All roles

Declaration
public IEnumerable<string> Roles()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

An enumeration of the roles of the graph. Each role is returned only once.

Remarks

Comments for Enabled() apply.

SetMarking(Path, Marking)

Update the marking of an event

Declaration
public void SetMarking(Path path, Marking marking)
Parameters
Type Name Description
Path path

A path to the event to update

Marking marking
Remarks

Regular events, Nesting events and Container events all have markings, whereas subprocesses do not.

Splice(Graph, Path, IDictionary<String, String>)

Insert graph under subprocess

Declaration
public void Splice(Graph other, Path loc, IDictionary<string, string> subst)
Parameters
Type Name Description
Graph other
Path loc
System.Collections.Generic.IDictionary<System.String, System.String> subst
Remarks

Like Insert(Graph, Path, IDictionary<String, String>), except nesting structure of definitions is not preserved. Rather, events defined at the top-level of the inner graph will be moved to defined at the top-level of the outer graph. This is likely what you want.

Split(Path)

Split graph at given location

Declaration
public Tuple<Graph, Graph> Split(Path path)
Parameters
Type Name Description
Path path

The path a which to split the graph. The path must identify a location of a subprocess or an atomic event.

Returns
Type Description
System.Tuple<Graph, Graph>

If the input path identifies a subprocess: A tuple of an outer and an inner graph; Using Insert(Graph, Path, IDictionary<String, String>) will inner into outer at path will give back the original graph.

If the input path identifies an atomic event: A tuple of an outer and an inner graph, where outer is the original graph (this), and inner is the graph comprising exactly the identified event.

ToActa()

Convert to underlying (F#) Acta

Declaration
public Acta.Process<Ex.Info> ToActa()
Returns
Type Description
DCR.Core.Acta.Process<DCR.Xml.Ex.Info>

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String

ToString(Int32)

Represent the graph as a string, indenting everything k spaces.

Declaration
public string ToString(int k)
Parameters
Type Name Description
System.Int32 k
Returns
Type Description
System.String

ToXml()

Serialise to XML

Declaration
public XElement ToXml()
Returns
Type Description
System.Xml.Linq.XElement

TryComputeLeafPhase(out Boolean)

Declaration
public Tuple<int, string> TryComputeLeafPhase(out bool success)
Parameters
Type Name Description
System.Boolean success
Returns
Type Description
System.Tuple<System.Int32, System.String>

TryComputePhase(out Boolean)

Declaration
public Tuple<int, string> TryComputePhase(out bool success)
Parameters
Type Name Description
System.Boolean success
Returns
Type Description
System.Tuple<System.Int32, System.String>
In This Article
Back to top © 2019 DCR Solutions