Functions

Predefined functions

The rule language provides the following predefined functions:

  • Event getEvent(): When the Object is a Result, it returns the original event that triggered the operation; otherwise, returns null.
  • Event getEvent(String extid, String flow, String componentID): Returns an Event stored in the global event storage. If no Event corresponds to the id, it returns null.
  • Flow and componentId are optional arguments.
  • Void store(String extid, Event evt, int duration, String flow): Stores an Event during a given time. Used to correlate Events in the rules.
  • Flow is an optional argument.

ExecuteOperation function

ExecuteOperation is a new type of function included in the Designer.

The following table lists the visible fields in the function editor when the selected type is ExecuteOperation:

Property Type Description
name String The name of the function
implementation String At implementation, only the value Java is available
implementationId String The implementation id of the function
description String Short description of the function

These functions have function arguments defined by a set of properties.The following table lists these properties:

Property Type Description
name String Property name
type String

Type of the property.

Possible values:

  • Integer, Long, String, Date, DateTime, Decimal
  • Event
description String Short description of the property

Operations for all components

The following operations are available for all the components that use the Event Processor:

  • moveFiles
  • deleteFiles
  • sendFileEvent

moveFiles(event, target, deferred)

Description

Move the input files (data, properties, errors) to a target folder.

Arguments

  • event(*): FileEvent – Provides the path for the files.
  • This argument is mandatory
  • target(*): String – Name of the resource that is associated to a folder
  • This argument is mandatory
  • deferred: String – Specifies if the files will be moved after the interaction ends. If the value is y, yes or true, the files will be moved. Any other value will be treated as false.
  • This argument is optional. Default value is false.

Type of the result

MoveFilesResult

Notes

The operation fails if no path is provided, if the file paths are incorrect, if the target folder is null or incorrect, or if the file system raises an error.

deleteFiles(event, deferred)

Description

Delete the input files (data, properties, errors).

Arguments

  • event(*): FileEvent – Provides the path for the files.
  • This argument is mandatory
  • deferred: String – Specifies if the files will be moved after the interaction ends. If the value is y, yes or true, the files will be moved. Any other value will be treated as false.
  • This argument is optional. Default value is false.

Type of the result

DeleteFilesResult

sendFileEvent(service, dataFile, propertyFile, errorFile, flow, interaction, collectionTypeName, collectionTypeVersion, collectionId, applicationName, configurationId, session, operationDate, stamper, insertKey, environmentTransformation)

Description

Send a File event to a service. The target service must push the FileEvent to its Event Processor.

Arguments

  • service(*): String – Target service (Transformation, DataEntry, Storage, Report, Administration)
  • This argument is mandatory.
  • dataFile: String – Data file path
  • propertyFile: String – Property file path
  • errorFile: String – Error file path
  • flow: String – Flow name
  • interaction: String – Interaction name
  • collectionTypeName: String – Name of the collection type that describes the input data file
  • collectionTypeVersion: int – Version of the collection type
  • collectionId: String – Identifier for the collection
  • applicationName: String – Name of the application that is used to find the Rule Engine configuration from the Repository.
  • configurationId: String – Identifier for the AccountingIntegrator configuration. Together with the applicationName is used to find the Rule Engine configuration from the Repository.
  • session: Session – Defines a Rule Engine session. Maps to SESSION in script.fic file. If the value is not provided, the default value is the interaction name.
  • operationDate: Date – Sets the operation date. Maps to DATE_OPERATION in the script.fic file. If the value is not provided, theRule Engine session uses the system date. The expected date format is DD/MM/YYYY; if the date is not provided in this format, the file processing is aborted.
  • stamper: String – Sets the stamping prefix. Maps to STAMPER in the script.fic file. If the value is not provided, the default value is STAMP. The first five characters of this parameter are used in Stamp ID if the audit is enabled.
  • insert: String – Used to embed a custom script and set up rarely-used properties. Fill the {INSERT} placeholder in the script.fic file.
  • environmentTransformation: The domain to activate. The default value is Batch.

Type of the result

SendEventResult

Operations for Administration

The following operation is available for Administration: importAIConfiguration(event)

importAIConfiguration(event)

Description

Import the AI configuration (mvt and ctx files) from Composer into the Repository.

Arguments

  • event(*): Mandatory argument. It has the following properties:
    • ctxFile – the path to the ctx.mvt file
    • mvtFile – the path to the mvt.mvt file

Type of the result

ImportAIConfigurationResult

Notes

The pair of ctx.mvt and mvt.mvt files must be stored in a folder under the next hierarchy, the same way as they are deployed from Composer: <GenerationFolder>\<ApplicationName>\aiConfiguration\<ConfigurationIdentifier>\

The operation fails if:

  • the path for both ctx.mvt and mvt.mvt files is not provided by the event.
  • the application name contains other characters than letters and numbers.

purgeEvents(interaction, startDate, endDate)

Description

Clean the events stored in the Repository for an interaction name and/or for a creation date range.

Arguments

  • interaction: Interaction name
  • startDate: Events start date
  • endDate: Events end date

Type of the result

PurgeEventsResult

Notes

The date format is yyyy-MM-dd HH:mm:ss.

Operations for Report Server

The following operation is available for Report Server:

purgeReports(service, startDate, endDate, creationAuthor, templateName, reportType)

Description

Purge the filtered reports.

Arguments

  • service: String – Service name of the component whose reports were generated for
  • startDate: DateTime – Report creation start date
  • endDate: DateTime – Report creation end date
  • creationAuthor: String – The report creation author
  • templateName: String – The name of the report template
  • reportType: String – The report type

Type of the result

PurgeReportsResult

Operations for InterPlay

When using the Event Processor to orchestrate InterPlay, the following operations are available for the data entry service:

  • importDocument
  • exportDocuments
  • partialExportDocuments
  • purgeCollections
  • changeCollectionsStatus

importDocument(event, mode, status, author, language, state, hasErrors)

Description

Import the document that is specified in the File Event.

Arguments

  • mode: String – Value that defines the import mode.
  • Possible values: reset, reject, child, new, merge, updateErrors
  • Default value: new
  • status(*): String – Value of the lifecycle status of the imported collection. If not defined, the first status defined is used.
  • language: String – Defines the default decimal separator.
  • Possible values: english and french
  • Default value: english
  • author: String – Author of the status change during import
  • state: String – Value for modification state
  • Possible values: Added and Untouched
  • Default value: Untouched
  • hasErrors: String – Flag used to overwrite the CollectionType error flag.
  • Possible values: true or false.
  • Default value: false

Type of the result

ImportResult

Notes

The operation fails if the event is not a File Event, if no combination is possible, if paths are incorrect or if the file system raises an error.

The functions arguments, except event, may also be provided in the property file.

If collectionTypeName is not null then use the importDocumentByCollectionType, otherwise use importDocument. If collectionTypeVersion is null, then collectionTypeVersion=1.

exportDocuments(target, filter, status, language)

Description

Export the filtered collections to the given folder.

Arguments

  • target(*): String – Name of the resource that references a folder
  • This argument is mandatory.
  • filter(*): String – Selection of the collections.
  • This argument is mandatory.
  • status: String – Target status for the exported collections.
  • language: String – Defines the default decimal separator.
  • Possible values: english and french
  • Default value: english

Type of the result

ExportResult

Notes

If the operation was executed with success, an ExportFile event is created for each exported collection.

partialExportDocuments(target, collFilter, objFilter, status, language, export)

Description

Export the collection partially.

Arguments

  • target(*): String – Name of the resource that references a folder
  • This argument is mandatory.
  • collFilter(*): String – Selection of the collections
  • This argument is mandatory.
  • objFilter(*): String – Selection of the objects
  • This argument is mandatory.
  • status: String – Target status for the exported collections.
  • language: String – Defines the default decimal separator.
  • Possible values: english and french
  • Default value: english
  • export: String – If true, performs the export.

Type of the result

ExportResult

purgeCollections

Description

Purge the filtered collections.

Arguments

  • filter(*): String – Selection of the collections.

Type of the result

PurgeResult

changeCollectionsStatus (filter, status)

Description

Change status for a list of business collections.

Arguments

  • filter(*): String – Selection of the collections whose status must be changed.
  • This argument is mandatory.
  • status(*): String – The new status of the collection(s).
  • This argument is mandatory.

Type of the result

ChangeCollectionsStatusResult

Operations for Designer

When using the Event Processor to orchestrate Designer, the following operations are available for the data entry service:

  • importDocument
  • exportDocuments
  • purgeCollections
  • transformAIConfiguration

importDocument(event, mode, status, author, language, state, hasErrors)

Description

Import the document that is specified in the File Event.

Arguments

  • mode: String – Value that defines the import mode.
  • Possible values: reset, reject, child, new, merge, updateErrors
  • Default value: new
  • status(*): String – Value of the lifecycle status of the imported collection. If not defined, the first status defined is used.
  • language: String – Defines the default decimal separator.
  • Possible values: english and french
  • Default value: english
  • author: String – Author of the status change during import
  • state: String – Value for modification state
  • Possible values: Added and Untouched
  • Default value: Untouched
  • hasErrors: String – Flag used to overwrite the CollectionType error flag.
  • Possible values: true or false.
  • Default value: false

Type of the result

ImportResult

Notes

The operation fails if the event is not a File Event, if no combination is possible, if paths are incorrect or if the file system raises an error.

The functions arguments, except event, may also be provided in the property file.

If collectionTypeName is not null then use the importDocumentByCollectionType, otherwise use importDocument. If collectionTypeVersion is null, then collectionTypeVersion=1.

exportDocuments(target, filter, status, language)

Description

Export the filtered collections to the given folder.

Arguments

  • target(*): String – Name of the resource that references a folder
  • This argument is mandatory.
  • filter(*): String – Selection of the collections.
  • This argument is mandatory.
  • status: String – Target status for the exported collections.
  • language: String – Defines the default decimal separator.
  • Possible values: english and french
  • Default value: english

Type of the result

ExportResult

Notes

If the operation was executed with success, an ExportFile event is created for each exported collection.

purgeCollections

Description

Purge the filtered collections.

Arguments

  • filter(*): String – Selection of the collections.

Type of the result

PurgeResult

transformAIConfiguration(event, target)

Description

Transforms the Financial Export from Composer and generates the Designer files into a given folder.

In transformation, the first segment with multiplicity equals to 1 is automatically used as properties for the Object type. This segment will not be added as an Element type.

This is overridden if there is another definition in the property file.

Example: <Object_Type_Name>.properties = <Segment_Name>

For more information about available annotation file options, check the annot.properties.template file from <DesignerInstall>/extra/work/AccInt/financialExport.

Arguments

  • event(*): FileEvent that gives the financial export file path.
  • This argument is mandatory.
  • target(*): String – Name of the resource that references a folder
  • This argument is mandatory.

Type of the result

TranformAIConfigurationResult

Notes

If the operation was executed with success, for each resulted data file a new event named TransformFileResult will be created.

Related Links