LSPS documentation logo
LSPS Documentation
Command-Line Console

The Command Line Console is a command-line client that enables you to perform administrative action on the LSPS Server from command line. It is provided as batch and bash file lsps-cli in the $LSPS_RUNTIME_HOME/cli-tools folder of the LSPS Runtime package.

Note: Before using the Command Line Console, make sure you have installed a supported JDK and set up the environment variable JAVA_HOME since the batch and shell scripts are wrapper scripts that run the respective java method with the LSPS libraries on the classpath and forward it the call parameters.

To send a call using the Command Line Console, do the following:

  1. Open your command line interface.
  2. On the prompt, run the lsps-cli script with the respective parameters. The supported parameters are described in Command Line Console Commands.

Note that --properties and --filterProps are defined as pairs of values, for example, property1 value property2 value2. If the properties use whitespaces, use the quotes for the given property or value, for example, "property 1" value property2 "value 2"

The lsps-cli tool provides the following commands:

Model Management

modelList lists the models in the model repository on the LSPS Server;

Long Option Short OptionDescription
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--name -n model name (supports wildcards)
--version -v model version (supports wildcards)
~/lsps-runtime/cli-tools$ ./lsps-cli.sh modelList --host http://localhost:8080/lsps-ws --username admin --password admin
Found 5 model(s).
Id Model name Model version
2003 15224 1.0
18000 15224 1.0
2002 ui 2.8
2000 core 2.8
2001 human 2.8

modelUpload uploads a model;

Important: You can upload only Modules exported with the GO-BPMN export.

Long Option Short OptionDescription
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--model -m list of model filenames or directories
--dbUpdateStrategystrategy for database handling (required);possible values: nothing, update, validate, drop
lsps-cli modelUpload -host http://localhost:8080/lsps-ws -model "C:/models/TestUploadInvalidModel-1.0.zip" -user admin -password admin
~/lsps-runtime/cli-tools$ ./lsps-cli.sh modelUpload --host http://localhost:8080/lsps-ws --username admin --password admin --model /home/eko/lsps-workspace/Queries/ --dbUpdateStrategy validate
Info: Uploading files from /home/eko/lsps-workspace/Queries
Uploading files from /home/eko/lsps-workspace/Queries has finished.

modelUnload removed the module from the server; note that roles and role assignment remain unchanged.

Long Option Short OptionDescription
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--name -n model name (supports wilcards)
--force do not prompt on unload
~/lsps-runtime/cli-tools$ ./lsps-cli.sh modelUnload --host http://localhost:8080/lsps-ws --username admin --password admin --name 15224
Found more models:
Are you sure to remove model '15224 (1.0)' from repository? (Y/N)y
Model 15224 (1.0) successfully unloaded.
Are you sure to remove model '15224 (1.0)' from repository? (Y/N)y
Model 15224 (1.0) successfully unloaded.
Unloading models from repository has finished.

Model Instance Management

When calling any of the management commands, make sure to define the model instances you perform the command on. If you want to work with one model instance with a particular id, define its id using the --modelInstance parameter. If you want to perform the command over multiple instances, use one of the filter parameters:

  • --modelInstanceFile parameter with a file with the IDs
  • filter parameters, --filterStatus, filterFrom and filterTo, --filterProps, etc. for multiple model instances based on their properties.

modelInstanceList returns possibly filtered list of model instances;

Long Option Short OptionDescription
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--modelInstance model instance ids
--modelInstanceFile file containing the base model
--filterModelId IDs of the base models
--filterModelName model name patern (wildcards supported)
--filterModelVersionmodel version (wildcards supported)
--filterStatus models in the defined execution status (CREATED, RUNNING, SUSPENDED, FINISHED)
--filterFrom model instance(s) initiated after TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterTo model instance(s) initiated before TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterProps model instance properties defined as key1 value1 key2 value2
--filterExpression boolean expression; Only the model instances for which the expression evaluates to true are returned.
./lsps-cli.sh modelInstanceList --host http://localhost:8080/lsps-ws --username admin --password admin --filterProps "my property" value "another property" "another value" --filterFrom "2017-10-31 12:14:00"

export exports a model instance as an XML file;

Long Option Short OptionDescription
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--modelInstance model instance IDs
--modelInstanceFile file with model instance IDs
--location output location and file prefix (model instance IDs are appended to the prefix)

suspend suspends model instances;

Long Option Short OptionDescription
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--modelInstance model instance IDs
--modelInstanceFile file with model instance IDs to be requested
--filterModelId IDs of the base models
--filterModelName model name patern (wildcards supported)
--filterModelVersion model version (wildcards supported)
--filterFrom model instance(s) initiated after TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterTo model instance(s) initiated before TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterProps model instance properties defined as key1 value1 key2 value2
--filterExpression boolean expression; Only the model instances for which the expression evaluates to true are returned.
--testFilter boolean expression; displays the model instances affected by the command (the command is not executed)
./lsps-cli.sh suspend --testFilter --host http://localhost:8080/lsps-ws --username admin --password admin --filterProps myProperty "value" --filterFrom "2017-10-31 12:14:00"

resume resumes model instances;

Long Option Short OptionDescription
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--modelInstance model instance IDs
--modelInstanceFile file with model instance IDs to be resumed
--filterModelId IDs of the base models
--filterModelName model name pattern (wildcards supported)
--filterModelVersionmodel version (wildcards supported)
--filterFrom model instance(s) initiated after TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterTo model instance(s) initiated before TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterProps model instance properties defined as key1 value1 key2 value2
--filterExpression boolean expression; Only the model instances for which the expression evaluates to true are returned.
--testFilter boolean expression; displays the model instances affected by the command (the command is not executed)

finish finishes model instances

Long Option Short OptionDescription
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--modelInstance model instance IDs
--modelInstanceFile file with model instance IDs to be resumed
--filterModelId IDs of the base models
--filterModelName model name patern (wildcards supported)
--filterModelVersion model version (wildcards supported)
--filterFrom model instance(s) initiated after TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterTo model instance(s) initiated before TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterProps model instance properties defined as key1 value1 key2 value2
--filterExpression boolean expression; Only the model instances for which the expression evaluates to true are returned.
--testFilter boolean expression; displays the model instances affected by the command (the command is not executed)

Model Update

When calling any of the model update commands, the commands will be executed on all model instances of the model as defined in the provided muc file.

If you want to work only with one model instance with a particular id, define its id using the --modelInstance parameter. If you want to perform the command over multiple instances, use one of the filter parameters:

  • --modelInstanceFile parameter with a file with the IDs (each ID on a new line)
  • filter parameters, --filterStatus, filterFrom and filterTo, --filterProps, etc. for multiple model instances based on their properties.

Consider using the --testFilter parameter to trigger a dryrun and check the resulting set of model instances.

Note: To acquire the model update command, you can set up a test model update and use the Show command line script feature in PDS.

Example model update command

lsps-cli modelUpdate --host http://localhost:8080/lsps-ws --username admin --password admin --muc "D:/my_workspaces/my.muc" --filterStatus RUNNING SUSPENDED UPDATED

modelUpdate updates models instances based on the provided muc file

Long Option Short OptionDescription
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--muc muc file (required)
--datamapping data mapping definition
--modelInstance model instance IDs
--modelInstanceFile file with model instance IDs to be updated
--filterStatus only model instances in the defined execution status are updated (RUNNING, SUSPENDED, UPDATED, UPDATE_ABORTED)
--filterFrom model instance(s) initiated after TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterTo model instance(s) initiated before TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterProps model instance properties defined as key1 value1 key2 value2
--filterExpression boolean expression; Only the model instances for which the expression evaluates to true are returned.
--testFilter boolean expression; displays the model instances affected by the command (the command is not executed)

continueTransform triggers the transformation phase of update on the model instances;

Long Option Short OptionDescription
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--modelInstance model instance ids
--modelInstanceFile file containing the base model
--filterModelId IDs of the base models
--filterModelName model name patern (wildcards supported)
--filterModelVersionmodel version (wildcards supported)
--filterFrom model instance(s) initiated after TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterTo model instance(s) initiated before TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterProps model instance properties defined as key1 value1 key2 value2
--filterExpression boolean expression; Only the model instances for which the expression evaluates to true are returned.
--testFilter boolean expression; displays the model instances affected by the command (the command is not executed)

continuePostprocess triggers the postprocess phase of model update;

Long Option Short Option Description
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--modelInstance model insance ids
--modelInstanceFile file containing the base model
--filterModelId IDs of the base models
--filterModelName model name patern (wildcards supported)
--filterModelVersionmodel version (wildcards supported)
--filterFrom model instance(s) initiated after TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterTo model instance(s) initiated before TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterProps model instance properties defined as key1 value1 key2 value2
--filterExpression boolean expression; Only the model instances for which the expression evaluates to true are returned.
--testFilter boolean expression; displays the model instances affected by the command (the command is not executed)

abortModelUpdate aborts update of model instances;

Long Option Short Option Description
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--modelInstance model instance ids
--modelInstanceFile file containing the base model
--filterModelId IDs of the base models
--filterModelName model name patern (wildcards supported)
--filterModelVersionmodel version (wildcards supported)
--filterFrom model instance(s) initiated after TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterTo model instance(s) initiated before TIMESTAMP, format: yyyy-MM-dd HH:mm:ss
--filterProps model instance properties defined as key1 value1 key2 value2
--filterExpression boolean expression; Only the model instances for which the expression evaluates to true are returned.
--testFilter boolean expression; displays the model instances affected by the command (the command is not executed)

startModelInstance instantiates and starts a model instance

Long Option Short OptionDescription
--host -h host URL (required)
--username -u user name (required)
--password -p password (required)
--modelName base model name
--modelVersion base model version
--modelId base model ID
--properties model instance properties defined a list of key-value pairs
./lsps-cli.sh startModelInstance --host http://localhost:8080/lsps-ws --username admin --password admin --modelName orderModule --properties customerType enterprises compliant yes
# alternatively:
./lsps-cli.sh startModelInstance --host http://localhost:8080/lsps-ws --username admin --password admin --modelName orderModule --properties "customer type" "enterprises" "compliant" "yes"

Invoking Command-Line Console from Java

To use the command-line tool from a Java program, do the following:

  1. Include the mconsolecl dependency in your pom.xml:
    <dependency>
        <groupId>com.whitestein.lsps.mconsolecl</groupId>
        <artifactId>lsps-mconsole-cl</artifactId>
        <version>${project.version}</version>
    </dependency>
    
  2. Call the main method with the cli command as its String[] argument.
    com.whitestein.lsps.mconsolecl.Main.main(new String[]{"arg 1", "arg 2"});