In previous versions of CAST, links to external objects stored in the Analysis Service (i.e. objects that have resulted from another analysis) were created by specifying the numerical identifiers of objects in the CAST Analysis Service (using the properties "externalCaller" and/or "externalCallee" from the "link" category).

In addition to this, there are two further methods:

  • Creating a reference that represents an object in the Analysis Service
  • Calling one or more customer developed stored procedures to retrieve the called or calling object's identifier

Creating a reference that represents an object in the Analysis Service

This method involves creating a reference that represents an object in the database: the appropriate type is "uaxDBRef". Then to create a link with this reference, you need to define the reference as a caller or callee, exactly as if the object was an object created in the current Universal Importer job. The conversion to the Analysis Service identifier is automatic.

In order to identify the object in the Analysis Service, you can specify the following information:

  • The object's name (using the "name" property in the "identification" category)
  • The object's full name (using the "fullName" property in the "identification" category)
  • The object's type (using the "objectType" property for the "uaxDBRef" type)

This information allows the object to be identified in the Analysis Service – all information is not necessarily mandatory, but it is cumulative – the more information you specify, the less chance there is that the wrong object will be identified.

Objects with similar names

If the object's "name" property contains the * character at the end, this will cause links to be created to all objects that match this name. Note, however, that this is NOT a wildcard, so if there is a link to a reference f and there are two objects called f in the Analysis Service (f2 and f33), links will only be created to the objects called f.

If the object's "name" property does NOT contain the * character at the end, and if several objects are found in the Analysis Service according to the information provided, no link will be created and a warning will be issued instead.

For example, if you want to create a call type link between an object with the ID "object1" resulting from a .UAX file and an object in the Analysis Service (name = "f", fullName = "C:\eiffel\test\file.php.phpFunction.f", type = "phpFunction"), you need to specify the following in the .UAX file:

<instance id="" instanceOf="callLink">
   <link caller="object1" callee="dbref-f" />
</instance>
<instance id="dbref-f" instanceOf="uaxDBRef" objectType="phpFunction">
   <identification name="f" fullName="C:\eiffel\test\file.php.phpFunction.f" />
</instance>

Calling one or more custom stored procedures/functions to retrieve the called or calling object's identifier

"Stored Procedure" refers to Microsoft SQL Server, "Function" refers to Oracle/CAST Storage Service environments. It is also possible to call one or more custom stored procedures/functions to retrieve the called or calling object's identifier. In order to do this, you must use the "externalCallerSP" and/or "externalCalleeSP" properties in the "link" category. The format of the call is as follows:

procedure_name(argument_1, argument_2, ..., argument_n)

The values of the arguments are thus written in a special table in the Analysis Service:

UAX_SP_IN

 

 

CALL_ID

Int

ID of the call to the procedure

PARAM_ORDER

Int

Order of the parameter

VALUE

Varchar(100)

Value of the parameter

PROCEDURE_NAME

Varchar(100)

Name of the procedure

For each call:

  • A new CALL_ID is automatically generated
  • For each argument in the call, a line is added to this table indicating the value of the parameter and its order number, as well as the name of the stored procedure/function.

The stored procedure/function contract must be as follows:

  • It reads all the data in the table UAX_SP_IN that it needs to (i.e. all the lines where PROCEDURE_NAME = the name of the procedure/function)
  • For each different call (CALL_ID), the procedure retrieves the parameters in order, it then calculates the corresponding Analysis Service object identifier.
  • The result for each different call is then placed into the following table:

UAX_SP_OUT

 

 

CALL_ID

Int

ID of the call to the procedure/function

RESULT

Int

Result of the call to the procedure/function = the ID of the external caller or callee

For example, if you want to create links to a GUI created object called f in your .UAX file:

<instance id="" instanceOf="callLink">
   <link caller="f" externalCalleeSP="my_proc(test,2,function)" />
</instance>
<instance id="" instanceOf="callLink">
   <link externalCallerSP="my_proc(hello,11,member)" callee="f" />
</instance>
<instance id="" instanceOf="callLink">
   <link caller="f" externalCalleeSP="my_proc2(10,53)" />
</instance>

This will be transferred to the "in" table:

UAX_SP_IN

 

 

 

CALL_ID

PARAM_ORDER

VALUE

PROCEDURE_NAME

0

1

hello

my_proc

0

2

11

my_proc

0

3

member

my_proc

1

1

test

my_proc

1

2

2

my_proc

1

3

function

my_proc

2

1

10

my_proc2

2

2

53

my_proc2

Only one call to "my_proc" and one to "my_proc2" must populate the "out" table, as shown in this example:

UAX_SP_OUT

 

CALL_ID

RESULT

0

1247

1

6214

2

1748


As a result, object f will have:

  • A calling link to the object with ID 6214
  • A called link from the object with ID 1247
  • A calling link to the object with ID 1748
  • If a call fails or if no object is retrieved, a warning will be issued.
  • The stored procedure/function must compile and it must be possible to execute it.
  • If you are using a function, the code must contain a "return 0".

Links with projects (Job names)

For all higher level objects, i.e. those directly linked to the project, it is possible to create a parent (Belongs To) link with a virtual reference "%ProjectRoot%": this would, in effect, replace this reference with the name of the project (that corresponds to the name of the Job). By using this method, it is no longer necessary to include the name of the Job in the .UAX file.

For example, if the object "fileA" is located directly underneath the project, you only need to include the following:

<instance id="fileA" instanceOf="sourceFile">
   <identification name="fileA" fullName="C:\a.php" />
</instance>
<instance id="" instanceOf="parentLink">
   <link caller="fileA" callee="%ProjectRoot%" />
</instance>