JSON structure for creating a business object
The JSON used to create a complex business object is as follows:
{
The name of the business object. Each business object must have a unique name
"logicalObjectName":"cookbook_complex_account_object",
The main SCHEMA.TABLE that the Object is build on.
"tableName": "CFFACT.ACCOUNT",
The primary key for the table. This column is used when the Business Object Engine is asked for objects with id=x
"tableKeyId": "ACCOUNT_ID",
The stereotype of the base Counter Fraud object the Business Object represents. This value must exist in the CFFACT.OBJECT_TYPE table
"cfObjectStereoType": "account",
The definition object contains the linked tables and columns
"definition": {
The initial column array specifies a set of column objects for the database columns in "tableName". Each column specifies the logical Field name, the physical database column name, whether the column is required and it's prominence.
"columns": [
{
"logicalField": "Policy Number",
"physicalField": "ACCOUNT_ID",
"required": true, "prominence":1
},
{
"logicalField": "OBJECT_ID",
"physicalField": "ACCOUNT_ID",
"required": true, "prominence":1
},
{
"logicalField": "Account Name",
"physicalField": "NAME",
"required": true, "prominence":1
}],
The JoinedTables array specifies a set of tables to join together when building a Business Object.
"joinedTables": [
Each Table reference includes the table name, and the set of keys used to link the tables together:
{
"tableName": "CFFACT.ACCOUNT_TYPE",
"tableKeyId": "ACCOUNT_TYPE_ID",
"focalKeyId": "ACCOUNT_TYPE_ID",
The columns array specifies the columns to include from the linked table. Each column object defines the logical field name, the database field name, whether the column is required and it's prominence level:
"columns": [{
"logicalField": "Account Type ID",
"physicalField": "ACCOUNT_TYPE_ID",
"required": true, "prominence":1
},
{
"logicalField": "Account Type Stereotype",
"physicalField": "STEREOTYPE",
"required": true, "prominence":1
}]
},
{
"tableName": "CFFACT.ACCT_BALANCE",
"tableKeyId": "ACCOUNT_ID",
"focalKeyId": "ACCOUNT_ID",
"columns": [{
"logicalField": "Average Balance",
"physicalField": "BALANCE",
"required": true, "prominence":1,
A column can be linked to a column in another table. The selector fields define the column to match against the match criteria. Note that the selectorOperator can be any valid SQL comparision operator, and the selectorClaus can be an appropriate constant. For example, to specify a constant value as a selectorClause, use an SQL construct, such as:
"(SELECT 1 FROM SYSIBM.SYSDUMMY1)"
The selectorClaus could also be SQL that results in an appropriate constant:
"selectorColumnId": "ACCT_BAL_TYPE_ID",
"selectorOperator": "=",
"selectorClause": "(SELECT ACCT_BAL_TYPE_ID FROM CFFACT.ACCOUNT_BALANCE_TYPE WHERE STEREOTYPE = 'avg_daily_balance')",
The linked column details are specified in a nested 'columns' structure. Note this is an object, not an array, despite the name being 'columns', only a single column object is supported here. The details include the standard column fields (logicalField,physicalField,required,prominence); as well as fields to link the column (tableName,tableKeyId,focalKeyId).
"columns": {
"logicalField": "Average Balance Stereotype",
"physicalField": "STEREOTYPE",
"required": true, "prominence":1,
"tableName": "CFFACT.ACCOUNT_BALANCE_TYPE",
"tableKeyId": "ACCT_BAL_TYPE_ID",
"focalKeyId": "ACCT_BAL_TYPE_ID"
}
}]
}]
}
}
Output
The OBJECT_ID output field contains a unique identifier for the object. Typically, this value is the Primary Key value for the base table. For example, the LogicalObject definition for ACCOUNT assigns ACCOUNT_ID to OBJECT_ID' while the LogicalObject definition for EVENT assigns EVENT_ID to OBJECT_ID, and so on.
The business object engine does not enforce OBJECT_ID.