Skip to main content

Celonis Product Documentation

LINK_SOURCE - LINK_TARGET - LINK_ATTRIBUTES
Description

Warning

To use this feature, Object Link needs to be configured in the data model.

LINK_SOURCE and LINK_TARGET output the source or target objects of links that are generated according to the Object Link configuration of the data model. LINK_ATTRIBUTES returns link values.

LINK_SOURCE outputs values from the outgoing or source side of a link, LINK_TARGET outputs values from the incoming or target side of a link, LINK_ATTRIBUTES outputs values of the link as defined in the mapping tables. LINK_SOURCE, LINK_TARGET and LINK_ATTRIBUTES support multiple column expressions, so the links between multiple tables can be combined in one output table as long they have confirming data types.

Syntax
 LINK_SOURCE ( object_link_table1.column [, object_link_table2.column] ... )
 LINK_TARGET ( object_link_table1.column [, object_link_table2.column] ... )
 LINK_ATTRIBUTES ( mapping_table1.column [, mapping_table2.column] ... )
  • The specified columns need to belong to different Object Link tables or mapping tables.

 LINK_SOURCE( BIND ( object_link_table1, table1.column ) [, BIND ( object_link_table2, table2.column ) ] ...)
 LINK_TARGET( BIND ( object_link_table1, table1.column ) [, BIND ( object_link_table2, table2.column ) ] ...)
  • If a column (e.g. table1.column) does not belong to an Object Link table, it can first be pulled to this table using the BIND operator.

NULL handling
  • NULL values in the OUT and IN columns from the Object Link configuration are ignored.

  • If in a row the value of a specified column is NULL, but the row still has a matching IN or OUT row, the result for this entry will be NULL as well.

Examples
Object_Link_example_graph.png

[1]

This example shows all materials that have an outgoing link, incoming link, and the link description itself. Materials with an outgoing link are specified in the OUT column of the mapping table and are accessed via the LINK_SOURCE operator. Objects with incoming links are accessed via LINK_TARGET as specified in the IN column. Attributes of any link can be acquired via LINK_ATTRIBUTES.

Query

Column1

         LINK_SOURCE ( "MATERIAL"."ID" )
        

Column2

         LINK_TARGET ( "MATERIAL"."ID" )
        

Column3

         LINK_ATTRIBUTES ( "ACTION"."DESCRIPTION" )
        

Input

Output

ACTION

OUT : string

IN : string

DESCRIPTION : string

DURATION : int

'Olive oil'

'Dough'

'mix'

3

'Flour'

'Dough'

'mix'

3

'Egg'

'Dough'

'mix'

3

'Vegetables'

'Veggie pasta'

'steam'

10

'Chicken'

'Chicken pasta'

'roast'

25

'Chicken'

'Egg'

'lay'

null

'Egg'

'Chicken'

'hatch'

null

'Egg'

'Hard boiled eggs'

'boil'

7

'Egg'

'Hard boiled eggs'

'boil'

8

'Dough'

'Dough'

'knead'

5

'Dough'

'Pasta'

'rest & shape'

30

'Pasta'

'Veggie pasta'

'cook'

2

'Pasta'

'Chicken pasta'

'cook'

2

MATERIAL

ID : string

CATEGORY : string

QUANTITY : float

UNIT : string

PRICE : float

'Coal'

null

10.0

'kg'

1.0

'Olive oil'

'raw ingredients'

2.0

'tbsp'

0.08

'Flour'

'raw ingredients'

250.0

'g'

0.1

'Vegetables'

'raw ingredients'

500.0

'g'

2.3

'Chicken'

'raw ingredients'

1.0

'lbs'

6.0

'Egg'

'raw ingredients'

1.0

null

0.5

'Dough'

'intermediate goods'

400.0

'g'

1.0

'Pasta'

'intermediate goods'

400.0

'g'

3.5

'Veggie pasta'

'finished meals'

800.0

'g'

8.5

'Chicken pasta'

'finished meals'

900.0

'g'

9.5

'Hard boiled eggs'

'finished meals'

2.0

null

2.0

'Salad'

'finished meals'

500.0

'g'

6.5

Result

Column1 : string

Column2 : string

Column3 : string

'Olive oil'

'Dough'

'mix'

'Flour'

'Dough'

'mix'

'Egg'

'Dough'

'mix'

'Vegetables'

'Veggie pasta'

'steam'

'Chicken'

'Chicken pasta'

'roast'

'Chicken'

'Egg'

'lay'

'Egg'

'Chicken'

'hatch'

'Egg'

'Hard boiled eggs'

'boil'

'Egg'

'Hard boiled eggs'

'boil'

'Dough'

'Dough'

'knead'

'Dough'

'Pasta'

'rest & shape'

'Pasta'

'Veggie pasta'

'cook'

'Pasta'

'Chicken pasta'

'cook'

[2]

This example illustrates that links can exist within different mapping tables. Table "ACTION2" contains an additional link to produce a 'Salad' by cutting up 'Vegetables'.

Query

Column1

         LINK_SOURCE ( "MATERIAL"."ID" )
        

Column2

         LINK_TARGET ( "MATERIAL"."ID" )
        

Column3

         LINK_ATTRIBUTES ( "ACTION"."DESCRIPTION" , "ACTION2"."DESCRIPTION" )
        

Input

Output

ACTION

OUT : string

IN : string

DESCRIPTION : string

DURATION : int

'Olive oil'

'Dough'

'mix'

3

'Flour'

'Dough'

'mix'

3

'Egg'

'Dough'

'mix'

3

'Vegetables'

'Veggie pasta'

'steam'

10

'Chicken'

'Chicken pasta'

'roast'

25

'Chicken'

'Egg'

'lay'

null

'Egg'

'Chicken'

'hatch'

null

'Egg'

'Hard boiled eggs'

'boil'

7

'Egg'

'Hard boiled eggs'

'boil'

8

'Dough'

'Dough'

'knead'

5

'Dough'

'Pasta'

'rest & shape'

30

'Pasta'

'Veggie pasta'

'cook'

2

'Pasta'

'Chicken pasta'

'cook'

2

ACTION2

OUT : string

IN : string

DESCRIPTION : string

DURATION : int

'Vegetables'

'Salad'

'cut'

6

MATERIAL

ID : string

CATEGORY : string

QUANTITY : float

UNIT : string

PRICE : float

'Coal'

null

10.0

'kg'

1.0

'Olive oil'

'raw ingredients'

2.0

'tbsp'

0.08

'Flour'

'raw ingredients'

250.0

'g'

0.1

'Vegetables'

'raw ingredients'

500.0

'g'

2.3

'Chicken'

'raw ingredients'

1.0

'lbs'

6.0

'Egg'

'raw ingredients'

1.0

null

0.5

'Dough'

'intermediate goods'

400.0

'g'

1.0

'Pasta'

'intermediate goods'

400.0

'g'

3.5

'Veggie pasta'

'finished meals'

800.0

'g'

8.5

'Chicken pasta'

'finished meals'

900.0

'g'

9.5

'Hard boiled eggs'

'finished meals'

2.0

null

2.0

'Salad'

'finished meals'

500.0

'g'

6.5

Result

Column1 : string

Column2 : string

Column3 : string

'Olive oil'

'Dough'

'mix'

'Flour'

'Dough'

'mix'

'Egg'

'Dough'

'mix'

'Vegetables'

'Veggie pasta'

'steam'

'Chicken'

'Chicken pasta'

'roast'

'Chicken'

'Egg'

'lay'

'Egg'

'Chicken'

'hatch'

'Egg'

'Hard boiled eggs'

'boil'

'Egg'

'Hard boiled eggs'

'boil'

'Dough'

'Dough'

'knead'

'Dough'

'Pasta'

'rest & shape'

'Pasta'

'Veggie pasta'

'cook'

'Pasta'

'Chicken pasta'

'cook'

'Vegetables'

'Salad'

'cut'

[3]

If any attribute does not exist in the required object table itself, we can utilize the BIND operator to have it on the desired table. Here we access all links from materials to customers and acquire the continent in which each customer resides.

Query

Column1

         LINK_SOURCE ( "MATERIAL"."ID" )
        

Column2

         LINK_TARGET ( BIND ( "CUSTOMER" , "CITY"."CONTINENT" ) )
        

Input

Output

ACTION

OUT : string

IN : string

DESCRIPTION : string

DURATION : int

'Olive oil'

'Dough'

'mix'

3

'Flour'

'Dough'

'mix'

3

'Egg'

'Dough'

'mix'

3

'Vegetables'

'Veggie pasta'

'steam'

10

'Chicken'

'Chicken pasta'

'roast'

25

'Chicken'

'Egg'

'lay'

null

'Egg'

'Chicken'

'hatch'

null

'Egg'

'Hard boiled eggs'

'boil'

7

'Egg'

'Hard boiled eggs'

'boil'

8

'Dough'

'Dough'

'knead'

5

'Dough'

'Pasta'

'rest & shape'

30

'Pasta'

'Veggie pasta'

'cook'

2

'Pasta'

'Chicken pasta'

'cook'

2

CITY

NAME : string

CONTINENT : string

'New York'

'North America'

'Amsterdam'

'Europe'

'Munich'

'Europe'

CUSTOMER

ID : string

LOCATION : string

'Alice'

'Munich'

'Bob'

'Amsterdam'

'Charlie'

'New York'

DELIVERY

OUT : string

IN : string

MODE : string

'Veggie pasta'

'Alice'

'standard'

'Chicken pasta'

'Bob'

'premium'

'Veggie pasta'

'Bob'

'premium'

'Hard boiled eggs'

'Charlie'

'standard'

MATERIAL

ID : string

CATEGORY : string

QUANTITY : float

UNIT : string

PRICE : float

'Coal'

null

10.0

'kg'

1.0

'Olive oil'

'raw ingredients'

2.0

'tbsp'

0.08

'Flour'

'raw ingredients'

250.0

'g'

0.1

'Vegetables'

'raw ingredients'

500.0

'g'

2.3

'Chicken'

'raw ingredients'

1.0

'lbs'

6.0

'Egg'

'raw ingredients'

1.0

null

0.5

'Dough'

'intermediate goods'

400.0

'g'

1.0

'Pasta'

'intermediate goods'

400.0

'g'

3.5

'Veggie pasta'

'finished meals'

800.0

'g'

8.5

'Chicken pasta'

'finished meals'

900.0

'g'

9.5

'Hard boiled eggs'

'finished meals'

2.0

null

2.0

'Salad'

'finished meals'

500.0

'g'

6.5

Foreign Keys

CITY.NAME

CUSTOMER.LOCATION

Result

Column1 : string

Column2 : string

'Veggie pasta'

'Europe'

'Chicken pasta'

'Europe'

'Veggie pasta'

'Europe'

'Hard boiled eggs'

'North America'

Signal Link (Deprecated)

Warning

The legacy Signal Link configuration is deprecated and no longer actively supported.

LINK_ATTRIBUTES returns values defined in the mapping table, links defined via signals will contain NULL values.

[4]

Query

Column1

         LINK_SOURCE ( "Activities"."ACTIVITY" )
        

Column2

         LINK_TARGET ( "Activities"."ACTIVITY" )
        

Input

Output

Activities

CASE_ID : string

ACTIVITY : string

TIMESTAMP : date

OUT : string

IN : string

'1'

'A'

Thu Dec 01 2016 13:00:00.000

null

null

'1'

'B'

Thu Dec 01 2016 13:01:00.000

'a'

null

'2'

'C'

Thu Dec 01 2016 13:02:00.000

null

'a'

'2'

'D'

Thu Dec 01 2016 13:03:00.000

null

null

Result

Column1 : string

Column2 : string

'B'

'C'

[5]

This example shows how cases can be connected via Object Link. This scenario has two configurations:

  • 1. The outgoing column "OUT" of "Case_Table_A" connects to the incoming column "IN" of "Case_Table_B".

  • 2. The outgoing column "OUT" of "Case_Table_B" connects to the incoming column "IN" of "Case_Table_A".

Since we are querying all links whose source object is in either "Case_Table_A" or "Case_Table_B" and whose destination object is in either "Case_Table_A" or "Case_Table_B", all links will be returned as the result.

Query

Column1

         LINK_SOURCE ( "Case_Table_A"."CASE_ID" , "Case_Table_B"."CASE_ID" )
        

Column2

         LINK_TARGET ( "Case_Table_A"."CASE_ID" , "Case_Table_B"."CASE_ID" )
        

Input

Output

Activity_Table_A

CASE_ID : string

ACTIVITY : string

TIMESTAMP : date

ID : string

'1'

'Send Purchase Order'

Wed Jan 01 2020 05:00:00.000

'1a'

'2'

'Clear Invoice 1'

Wed Jan 01 2020 06:00:00.000

'1b'

Activity_Table_B

CASE_ID : string

ACTIVITY : string

TIMESTAMP : date

ID : string

'A'

'Vendor creates Invoice'

Wed Jan 01 2020 05:00:00.000

'2a'

'B'

'Enter in SAP'

Wed Jan 01 2020 06:00:00.000

'2b'

Case_Table_A

CASE_ID : string

OUT : string

IN : string

'1'

'a'

null

'2'

'b'

'c'

Case_Table_B

CASE_ID : string

OUT : string

IN : string

'A'

'c'

'a'

'B'

null

'b'

Foreign Keys

Case_Table_A.CASE_ID

Activity_Table_A.CASE_ID

Case_Table_B.CASE_ID

Activity_Table_B.CASE_ID

Result

Column1 : string

Column2 : string

'1'

'A'

'2'

'B'

'A'

'2'

See also: