Connection

Connection

new Connection(graph, from, to, type, guard, level, desc) → {object}

Source:
Properties:
Name Type Description
graph object

Main Graph Object.

from object

Stores the connection from object which is instance of Element class.

to object

Stores the connection to object which is instance of Element class.

type string

Stores the type of connection as string.

guard string

Stores Guard for the connection as string.

level number

Stores filter level of the connection greater than or equal to Zero.

desc string

Stores description of the connection as string.

Main Connection Class, it will be used to create connection b/w Events or Events to Multi Instance Processes

Examples
var myApp = new DCR();
myApp.createEvent({'id':'Enter'}).connectTo(myApp.createEvent({'id':'Exit'}), 'condition');
//this will create an Event Element with Enter Id and will create a condition relation from this element to another new Exit element
var myApp = new DCR();
myApp.createEvent({'id':'Enter'}).connectFrom(myApp.createEvent({'id':'Exit'}), 'condition');
//this will create an Event Element with Enter Id and will create a condition relation from another Exit element to this Enter
var myApp = new DCR();
myApp.createEvent({'id':'Enter'}).createConnection(myApp.createEvent({'id':'Exit'}), 'condition', true);
//this will create an Event Element with Enter Id and will create a condition relation from another Exit element to this Enter
var myApp = new DCR();
myApp.createEvent({'id':'Enter'});
myApp.createEvent({'id':'Exit'});
myApp.createConnection(myApp.getById('Enter'), myApp.getById('Exit'), 'response');
//this will create an Event Element Enter and Exit, then we can use the app to create a response connection between two by finding them by their Ids.
Parameters:
Name Type Description
graph object

A graph object of the current application is passed so it can be used to update the garph easily.

from object

An element object is passed as source element from where connection will originate.

to object

An element object is passed as target element to where connection will end up.

type string

Connection type is passed as string so a connection can be identified, possible values are 'condition', 'response', 'include', 'exclude', 'milestone', 'spawn', 'coresponse', update.

guard string

Guard for the connection as string.

level number

filter level of the connection greater than or equal to Zero.

desc string

Description of the connection as string.

Returns:

Returns Connection Object.

Type
object

Methods

(static) addHighlight() → {Highlight}

Source:

Add Highlight to Connection of graph.

Returns:
  • An object of Highlight class.
Type
Highlight

(static) getHighlights() → {array}

Source:

Get Highlights related to a connection of graph.

Returns:
  • An array of graph Highlights.
Type
array