Predefined Methods
This section describes the pre-defined methods available per object. These pre-defined methods can be divided into two categories: methods that are available on all or many objects, called generic methods, and methods that are only available on particular objects, called specific methods.
Generic Methods
This section describes generic methods
addDynamicRecord
Adds a new dynamic record to an object.
If the record’s usage is configured as time-valid, then the record supports two additional attributes. They are startDate
and endDate
, of which the former is mandatory.
- Availability
-
This method is available for all objects that support dynamic records. It is available for functions, but not for conditions.
In or Out | Type | Description |
---|---|---|
In |
String |
The usage name |
In |
Map |
The attributes of the record, structured as name and value pairs |
- Example: Add a Non-Time-Valid Record
-
The following logic adds a non-time-valid record:
person.addDynamicRecord( "occurrence" , [ code : "06" , description : "Crime victim" ] )
- Example: Add A Time-Valid Record
-
Add a time-valid record in the same manner, except the map contains two extra attributes:
person.addDynamicRecord( "dynRecord1" , [ code : "06" , description : "dynRecord 1 value 6" , startDate : person.dateOfBirth , endDate : person.endDate ] )
deleteDynamicRecord
Deletes an existing dynamic record. If a key attribute is configured on the record’s definition, then the second input argument can delete a dynamic record with a specific key value. If no record with a matching key value is found, nothing is deleted. If multiple records match with the input key value, only one record is deleted. If the input key is NULL, or if no key attribute is configured at all, then all associated dynamic records are deleted.
- Availability
-
This method is available for all objects that support dynamic records. It is available for functions, but not for conditions.
In or Out | Type | Description |
---|---|---|
In |
String |
The usage name |
In |
String |
The record’s key attribute value, or |
- Examples
-
Assume an existing person has the following three values for the
dynRecord1
record. This dynamic record has two attributes:code
anddescription
, wherecode
is configured as the key.
Code | Description |
---|---|
01 |
dynRecord1 value 1 |
02 |
dynRecord1 value 2 |
03 |
dynRecord1 value 3 |
The following logic deletes the record with code 02
while leaving the other two records intact.
person.deleteDynamicRecord("dynRecord1", "02")
The following logic deletes all three occurrences in records.
person.deleteDynamicRecord("dynRecord1", null)
getSystemProperty
Returns the value of the property with the passed key as input.
- Availability
-
This method is available in the dynamic logic (Groovy script).
In or Out | Type | Description |
---|---|---|
In |
String |
Key of the property |
Out |
String |
Value of the property |
lookUpFlexCode
Returns the flex code object that matches the input character string.
- Availability
-
This method can be called without a base object.
In / Out | Type | Description |
---|---|---|
In |
String |
Key value of the flexCode |
In |
String |
Definition code of the flexCode |
Out |
flexCode |
The flex code |
- Example
person.dynamicFieldYesNoIndicator = lookUpFlexCode("YES", "YES_NO")
lookUpPerson
Looks up the Person in the system on the input parameters passed.
- Availability
-
This method is available in the Dynamic Logic (Groovy script).
In or Out | Type | Description |
---|---|---|
In |
String |
Code of the Person |
Out |
Person |
Person |
test
A method that tests a dynamic logic:
-
Follows the security restrictions of the unit under test (UUT).
-
The application sets the transaction to rollback only. Any data changes to the database are temporary.
- Availability
-
This method is available for a Dynamic Logic (Groovy script).
In or Out | Type | Description |
---|---|---|
In |
|
Dynamic logic Code of the UUT |
In |
|
Map with the input parameters of the UUT |
Out |
|
Contains the result of the test and the exception class if the test encounters any errors. Attributes of this object are:
|
- Example
def result = test("SPECIAL_BENEFIT_SELECT", [
"claim" : claim
])
updateDynamicRecord
Updates the attributes of an existing dynamic record. To find the correct record to update, match on the record’s key attribute value. If none of the existing records have a matching key value, nothing is updated. If multiple records match with the key value, only one of them is updated. If no key is configured at all, executing this method results in adding a record. This applies to both non-time-valid and time-valid dynamic records, so time-validity does not play a role in finding the record to update.
Only the attributes that are present in the input map are updated. Attributes that are not mentioned are left untouched.
- Availability
-
This method is available for all objects that support dynamic records. It is available for functions, but not for conditions.
In / Out | Type | Description |
---|---|---|
In |
String |
A usage name. |
In |
Map |
The attributes of the record, that can have a structure of name or value pairs. |
- Example, Update a Multi-Value Record
-
Assume an existing person has the following three values for the
dynRecord1
record. This dynamic record has three attributes:code
,description
, andlevel
, wherecode
is configured as the key.
Code | Description | Level |
---|---|---|
01 |
dynRecord1 value 1 |
3 |
02 |
dynRecord1 value 2 |
7 |
03 |
dynRecord1 value 3 |
12 |
The following logic updates the level
of the record with code 02
from 7
to 6
. Its description
is retained.
person.updateDynamicRecord( "dynRecord1" , [ code : "02" , level : 6 ] )
- Example: Update a Time-Valid Record
-
Update a record’s start and end date attribute in the same way as other attributes. Assume an existing person has the following two values for the
dynRecord1
record. Besides,startDate
andendDate
, this time-valid dynamic record has two attributes:code
,description
, wherecode
is configured as the key.
Code | Description | StartDate | EndDate |
---|---|---|---|
01 |
dynRecord1 value 1 |
2015-01-01 |
2015-12-31 |
02 |
dynRecord1 value 2 |
2016-01-01 |
The following logic sets the endDate
of the second record to the person’s end date. Its other attributes are retained.
person.updateDynamicRecord("dynRecord1" , [ code : "02" , endDate : person.endDate ] )
Please refer to the Claims Developer Guide for the list of other available generic methods.
Object Methods
In this section, the methods are described that are only available on specific objects. For each method, the following information is given:
-
The purpose of the method.
-
On which object(s) the method can be called.
-
Description of the parameters.
-
An example of the usage.
addBasket
Adds a basket to an authorization.
- Availability
-
This method is available for Authorization. Its purpose is to have the possibility to add a basket through function dynamic logic:
Parameters:
In or Out | Type | Description |
---|---|---|
In |
String |
Basket code. Mandatory |
In |
Date |
Authorization basket start date. Mandatory |
In |
Date |
Authorization basket end date. Optional |
- Example
authorization.addBasket("NAPPI_BASKET", authorization.startDate)
addMessage
Adds a message to an authorization.
- Availability
-
This method is available for Authorization. Its purpose is to have the possibility to add a message through function dynamic logic:
Parameters
In / Out | Type | Description |
---|---|---|
In |
String |
Message code. Mandatory |
In |
Object[] |
Message arguments. Optional |
- Example
def enrollmentResponseMessage = enrollmentResonseMessageList[0]authorization.addMessage(enrollmentResponseMessage.message.code, enrollmentResponseMessage.value0, enrollmentResponseMessage.value1)
getAttachedData
This method returns the data attached to the authorization in context; this is necessary because no relationship between attached authorization data and the authorization exists.
- Availability
-
This method is available for object authorization.
Parameters
In or Out | Type | Description |
---|---|---|
Out |
AttachedAuthorizationData |
The data attached to the authorization |
setDynamicField
The method sets the dynamic field to an object.
- Availability
-
This method is available for all objects that support dynamic fields.
Parameters
In or Out | Type | Description |
---|---|---|
In |
String |
A usage name |
In |
Object |
Structure of the dynamic field |
- Example
-
The following logic sets a time-valid field usage:
policy.setDynamicField("policyCoverage", new DynamicFieldPeriod(polCovRef.policyCoverage,polCovRef.startDate,polCovRef.endDate))
The recommended way to use the dynamic field is mentioned in the Writing section. |