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 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.

Operations for Datastore

When using the Event Processor to orchestrate Datastore, the following operations are available for the storage service:

  • importDocument
  • exportDocuments
  • executeReconciliation

importDocument(event, date, timezone, service)

Description

Import the document that is specified in the File Event.

Arguments

  • event(*): File Event that provides the path for the files
  • This argument is mandatory.
  • applicationDate: DateTime value that defines the date of the injection. The format for the date is yyyymmdd.
  • If it is not specified, the current date is used.
  • timezone: String – Value that overrides the JVM timezone so that all datetime properties are considered to be in this timezone.
  • The value must be a full time zone name such as America/Los_Angeles
  • If it is not specified, the JVM timezone is used.
  • service: String – Value that defines the name of the service

Type of the result

ImportResult

exportDocument(queryFullName, fileName, startDate, endDate, target, format, arguments, context, language, timezone, encoding, String force)

Description

Export the result of the query to the given file path.

Arguments

  • queryFullName(*): String – Value that defines the full name of the query that will be executed
  • This argument is mandatory.
  • fileName: String – Value that defines the name of the file that will concatenate with the resource folder.
  • startDate: Value that represents the start date for the search.
  • The format is yyyymmdd
  • endDate: Value that represents the end date for the search.
  • The format is yyyymmdd
  • target: String – Value that defines the key used to find the folder among the resources that are registered on the Component. The folder is expressed as a path relative to the working directory.
  • format: String – Value that defines the format of the output file.
  • Possible values: VariableFlatFile, FixedFlatFile
  • Default value: FixedFlatFile
  • arguments: String – Value that defines the list of values that replace the missing values in the query. The order of the list is the order of the missing arguments.
  • context: String – Value that replaces the values given by variables
  • language: String – Value that defines the language used for getting the extraction parameters from the dictionary defined in the repository.
  • If it is not specified, the default value is English
  • timezone: String – Value that overrides the JVM timezone so that all datetime properties will be considered in this timezone.
  • The value must be a full time zone name such as America/Los_Angeles
  • If it is not specified, the JVM timezone is used.
  • encoding: String – Value that defines the encoding to use in the output file.
  • Default value: iso-8859-1
  • force: String – Value that specifies to override or not the output file if the file exists.
  • Possible values: yes and no
  • Default value: yes

Type of the result

ExportResult

executeReconciliation(reconciliationFunctionName, reconciliationId, startDate1, endDate1, startDate2, endDate2, ignoreComments)

Description

Executes a reconciliation based on a reconciliation function name.

Arguments

  • reconciliationFunctionName: Full path of the reconciliation function. This argument is mandatory.
  • reconciliationId: Reconciliation identifier. String, number or date [yyyyMMdd]. This argument is mandatory.
  • startDate1: Source1 collection start date [yyyyMMdd]. This argument is optional. If it is omitted, the value set in the reconciliation function will be used.
  • endDate1: Source1 collection end date [yyyyMMdd]. This argument is optional. If it is omitted, the value set in the reconciliation function will be used.
  • startDate2: Source2 collection start date [yyyyMMdd]. This argument is optional. If it is omitted, the value set in the reconciliation function will be used.
  • endDate2: Source2 collection end date [yyyyMMdd]. This argument is optional. If it is omitted, the value set in the reconciliation function will be used.
  • ignoreComments: Flag used to indicate if commented records are excluded from the reconciliation sources. This argument is optional. Default value is true.

Type of the result

ReconciliationResult

Related Links