Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Due to this restriction and limited error handling and recovery capabilities, the activity is intended only for relatively simple LANSA Integrator service command sequences.

Info

The combination of the JSM_BINDSCRIPT activity with a JSM Binding Script Configuration provides a more fully-functional JSM scripting solution for more demanding applications.


As soon as this activity begins to execute the JSM command script, the restartable flag is set OFF.  It is not possible to restart a processing sequence that ends in error in this activity after it begins to execute the JSM command script.

INPUT Parameters:

JSMSERVICE: Optional

This parameter can contain the name of the JSM service to be loaded.  If specified, the activity will load the JSM service at the beginning of execution and unload it when complete.  If a single service is being used, this is the preferred technique because it allows the activity to respect and exploit applicable LANSA Composer settings and functionality, such as LANSA Composer features supporting LANSA Integrator tracing.  If not specified, then the JSM script must contain the necessary SERVICE_LOAD and SERVICE_UNLOAD commands to load and unload the required JSM service.

JSMSCRIPTFILE: Optional

This parameter is optional, but if it is not provided, then you must provide the JSM command script through the JSMSCRIPTLIST parameter.  If this parameter is provided, then it must specify the full path to a text file that contains the JSM command script to be executed.  See JSM command Script below for more information.

JSMSCRIPTLIST: Optional

This parameter is optional, but if it is not provided, then you must provide the JSM command script through the JSMSCRIPTFILE parameter.  If this parameter is provided, then it must contain a list of the JSM commands to be executed.  See JSM command Script below for more information.

JSMERRORACTION: Optional

This parameter specifies the action the activity should take if any command in the specified JSM command script results in an error.  You can specify one of the following values:

...

If not specified (or if an unrecognised value is specified), the activity assumes a default value of *CONTINUE.

OUTPUT Parameters:

JSMSTATUS:

Upon completion, this parameter will contain a list of the JSM status codes (eg: 'OK' 'ERROR' ...) resulting from executing the JSM script commands.  Only status codes resulting from script commands are included - the list does NOT include status codes resulting from opening or closing the JSM connection or from loading or unloading the service (unless the service load or unload results from commands in the JSM script).  Therefore the sequence of the status codes in the list corresponds directly to the sequence of the JSM commands executed.

JSMMESSAGE:

Upon completion, this parameter will contain a list of the JSM messages resulting from executing the JSM script commands.  Only messages resulting from script commands are included - the list does NOT include messages resulting from opening or closing the JSM connection or from loading or unloading the service (unless the service load or unload results from commands in the JSM script).  Therefore the sequence of the JSM messages in the list corresponds directly to the sequence of the JSM commands executed.

JSMERRORCOUNT:

Upon completion, this parameter will contain a count of the JSM command script commands that ended in error.  If *ERROR is specified for the JSMERRORACTION parameter, this count will always be either zero or 1 because the first error terminates the JSM command script execution.

JSM Command Script

Whether you specify your JSM command script through the JSMSCRIPTFILE or JSMSCRIPTLIST parameters, you should compose your script according to the following guidelines:

...

Refer to the LANSA Integrator documentation for information about the supported JSM services and service commands.

Substituting Processing Sequence Variables in the JSM command script

The activity supports substitution variables in the JSM command script.  When found, they will be replaced by the value of the named variable in the Processing Sequence variable pool.

...

Typically, you could circumvent these limitations, if necessary, by assigning the desired compound or indexed variables to a simple variable name before executing the script.

Example JSM Command Script

This is a sample JSM command script that is intended to delete records from the LANSA Composer tutorial orders database tables TUTORDH and TUTORDL using the LANSA Integrator SQLService.  It uses substitution variables for the database user and password and for the BCHNUM database field value that identifies the records to be deleted.  It is the responsibility of the solution designer to ensure that corresponding processing sequence variables exist with appropriate values before executing this script using the JSM_SCRIPT activity.

****************************************************************

* This is a sample JSM command script

****************************************************************

CONNECT DRIVER(TUT) DATABASE(TUT) USER(%%var.USER%%) PASSWORD(%%var.PASSWORD%%)

SET AUTOCOMMIT(*YES)

EXECUTE UPDATE("DELETE FROM TUTORDL WHERE BCHNUM = '%%var.BCHNUM%%'")

EXECUTE UPDATE("DELETE FROM TUTORDH WHERE BCHNUM = '%%var.BCHNUM%%'")

DISCONNECT

************************************


Note that the example above would require entries similar to the following to be added to LANSA Integrator's SQLService.properties file in order to operate successfully.  This is a requirement of the particular JSM service and service commands being used - it does not apply to the JSM_SCRIPT activity in general.  You should refer to the LANSA Integrator documentation for information about requirements and considerations that apply to the JSM service and service commands that you are using.

#

driver.tut=com.ibm.as400.access.AS400JDBCDriver

database.tut=jdbc:as400://SYSTEM/LICLICLIB;naming=sql;errors=full;date format=iso;translate binary=true

#