aitools: the batch command tool for AI Suite Studio

aitools is the main batch command tool for AI Suite Studio. Using this tool, you can import configuration files from the Rule Engine, generate or import samples.

To start the console use the following:

  • In Windows environment:
    [install directory]\AISuiteStudio\extra\tools\startConsole.bat
  • In Unix environments:
    [install directory]\AISuiteStudio\extra\tools\startConsole.sh

After opening the console, you can use the following commands:

importMvt

Use the importMvt command from aitools to import the mvt.xml file with the configuration from the Rule Engine. This will create in AI Suite Studio all business events, accounting methods and parameters observed in your business flow.

Syntax

importMvt

  • -d, --domain
    If the domain does not exist, it is created.
    If the domain already exists, the imported data is merged with the existing objects of the domain.
  • -f, --file
    path of the mvt.xml file containing configuration information.
  • -w, --workspace
    workspace
  • -l, --language
    language to use for parsing data. Not mandatory, default: english. Must be in the format english, french and not en, fr.
  • -n, --application-name
    application name (where formats were deployed by Designer). Not mandatory, default: default
  • -r --replicateFolderStructure
    • Imports a configuration from Composer, replicating Composer's folder tree into a domain tree in AI Suite Studio..
    • If set in conjunction with the --domain option, the structure will be replicated inside the specified domain. Otherwise the target folder in AI Suite Studio will be the root folder.
    • Note : if you wish to maintain an identical domain structure in AI Suite Studio as in Composer, avoid using the -replicateStructure option in combination with the --domain option.

Recommendation: - create a new application to deploy the formats to use in AI Suite Studio, or use the default application. Use repository console to create a new application. Be careful not to use the reserved application name aistudio.

Note   When re-importing a .mvt file, it may occur that some parameters from the existing configuration are no longer in use. In this case, AI Suite Studio does not delete them, but marks them as unused. A specific color is attributed to such parameters.

Example

importMvt -d mydomain -f C:\Axway\AccountingIntegrator\RuleEngineFile\runtimes\demo\dat\mvt.xml -w myworkspace -n myapplication

generateSamples

Use the generateSamples command from aitools to generate a file with real data for your business flow. The file will be in json format. The generateSamples command uses input and output trails from the Rule Engine runtime.

Syntax

generateSamples

  • -a, --action-file
    path of the action file, meaning the file to be sampled for the action part of the accounting method, serving as the output.
  • --action-collection
    the name of the action collection, default: AUDIT_COLLECTION. Not mandatory.
  • --action-collection-version
    version of the action collection. Not mandatory, default: the latest version.
  • -c, --condition-file
    path of the condition file, this is the file to be sampled for the condition part of the accounting method, representing the inputs of the accounting method. Not mandatory - if not provided, the condition part will not be generated.
  • --condition-collection
    condition collection. Not mandatory, default AUDIT_COLLECTION
  • --condition-collection-version
    version of the condition collection. Not mandatory, default: the latest version
  • -l, --language
    language to use for parsing data. Not mandatory, default: english. Must be in the format english, french and not en, fr.
  • -n, --application-name
    application name. Not mandatory, default: default
  • -o, --output-file
    the output file where the sampled data will be saved. Not mandatory; by default, the file is saved in the RuleEngine's runtime bres directory (C:\Axway\AccountingIntegrator\RuleEngineFile\runtimes\demo\bres) with the name ap.OSegt_Trace.sample. This is the name of the action file with sample as the suffix.

Example

generateSamples –a C:\Axway\AccountingIntegrator\RuleEngineFile\runtimes\demo\bres\ ap.OSegt_Trace –c C:\Axway\AccountingIntegrator\RuleEngineFile\runtimes\demo\bres\ ap.IEvent_Trace -l french –n myapplication

importSamples

Use the importSamples command from aitools to import the previously generated sample file. This import will add real data to the previously created technical part of your business flow. If some objects used by the samples are not found in your previously created configuration, then all these objects will be created now.

Syntax

importSamples

  • -d,--domain
  • -f,--file
    path of the data file containing the samples (such as ap.OSegt_Trace.sample)
  • -w,--workspace
    AI Suite Studio workspace into which the samples will be imported
Note   You can run the generateSamples and importSamples commands as often as new transformations are performed on the Rule Engine. If the same samples are re-generated, they are not imported into AI Suite Studio.
Note   If you imported the Rule Engine configuration using the -replicateStructure option inside a domain, then you should use as a target domain for the samples import, the root domain where the objects were imported.
Example:
* if you import using this command
importMvt –d test –f path_to_mvt_file –r –w Default
* and if inside the mvt.xml file, the root folder is rootComposer
then:
* inside AI Suite Studio you will obtain the following domain structure: test/rootComposer
* In this case, you should import the samples into the rootComposer domain.

Example

importSamples -d mydomain -f C:\Axway\AccountingIntegrator\RuleEngineFile\runtimes\demo\bres\ ap.OSegt_Trace.sample -w myworkspace

registerUser

This command registers a user to the aitools session. Registered users can launch any aitools commands for which they have permission. If a user is not registered for the aitools session, then before the first command is executed, the user will be asked for credentials. (This rule does not apply to the generateSamples command, that does not require credentials.)

Example:

> importSamples -d myDomain -f C:\Axway\AccountingIntegrator\RuleEngineFile\runtimes\demoKT\bres\ap.OSegt_Trace.sample -w Default

17:54:42: START running command importSamples with arguments: workspace=Default;

file=C:\Axway\AccountingIntegrator\RuleEngineFile\runtimes\demoKT\bres\ap.OSegt

_Trace.sample; domain=myDomain;

User:

At this point the user has to provide credentials. If not, the command will not be executed. Or if the user does not have the relevant rights, an Access denied error will appear.

cleanSamples

The cleanSamples tool deletes accounting method sample files. It is located in <AISuiteStudioInstallLocation>/extra/tools directory.

Syntax

cleanSamples

  • -d, --domain <myDomain>
    domain of the sample to delete
    <myDomain> can also by a subdomain, in this case you will have to specify all its ancestors like this DOMAIN1/SUBDOMAIN1/SUBSUBDOMAIN1
  • -w, --workspace
    workspace of the sample to delete
  • -a, --all
    deletes all samples

Examples

cleanSamples –d MYDOMAIN –w MYWORKSPACE
deletes the samples in the MYDOMAIN domain of the MYWORKSPACE workspace, and all the subdomains of MYDOMAIN

cleanSamples –a –w MYWORKSPACE
deletes the samples in all the domains of MYWORKSPACE

ImportCsv

Use the importCsv command from aitools to import a .csv file into an existing Data table in AI Suite Studio.

Syntax

ImportCsv

  • -c, --cleanup
    Purge existing data from the table. This argument is optional.
  • -d , --date-format
    Date format ex. dd-MM-yyyy . This argument is optional, the default value is dd-MM-yyyy. Use souble quotes (") if the date format contains spaces
  • -e, --encoding
    Encoding (charset). This argument is optional, the default value is utf-8
  • -f, --file <CSV_FILE>
    The path for the csv file. This argument is mandatory. Use double quotes (") if the file path contains spaces
  • -s, --separator <SEPARATOR>
    Separator used in csv file
  • -t, --table <TABLE>
    Data table path
  • -w, --workspace <WORKSPACE>
    Workspace

Example

importCsv -c -d "MM/dd/yy HH:mm" -e utf-8 -f “C:\WORK\datatableFiles\SalesJan 2009.csv” -s , -t domain1/dataTable1 -w Default

 

 

Related Links