Versions Compared

Key

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

...

For more information about developing applications that use LANSA Integrator services, refer to the LANSA Integrator Guide.

ExecuteJSMOpen

Opens a connection to the Java Service Manager for executing LANSA Integrator services. The result is True if successful. Performs exception handling and logging as required. Sets the Activity return code to error if the open fails.

...

Executes a specified service command through the Java Service Manager. Performs exception handling and logging as required. By default, this sets the Activity return code to error if the command fails. However, if the iRecoverable parameter is set to True, the warning level will be set instead.NOTE

Note
Note:

...

If the service command you are using requires your activity processor to exchange fields and/or working lists with the JSM, then you cannot call the ExecuteJSMCommand or ExecuteJSMCommandEx methods.

...

You must use the JSMX_COMMAND built-in-function instead, directly in your activity processor, otherwise the exchange of fields and/or working lists defined in your activity processor cannot work.

For example, this code does NOT (and cannot) exchange fields and/or working lists):

#lResult := #com_owner.ExecuteJSMCommand( #mycommand 'My log message for this step' )

If you need to exchange fields and/or working lists, you could use code like this instead:

use builtin(jsmx_command) with_args(#com_owner.JSMHandle #mycommand) to_get(#com_owner.JSMStatus #com_owner.JSMMessage #mylist)
#lResult := #com_owner.JSMCheckStatus( #mycommand 'My log message for this step' )

Refer below for a description of the JSMCheckStatus method.

...

Instead of using the ExecuteJSMCommand or ExecuteJSMCommandEx methods, you may execute a JSM service command directly in your activity processor using the JSMX_COMMAND built-in-function.   If the service command you are using requires your activity processor to exchange fields and/or working lists with the JSM, then you must use that method.

In that case, you may still use the exception handling and logging of the ancestor class by calling the JSMCheckStatus method after the JSMX_COMMAND built-in-function.   By default, this sets the Activity return code to error if the command fails. However, if the iRecoverable parameter is set to True, the warning level will be set instead.

Note

...

Note: For this to work correctly you must specify the #com_owner.JSMStatus and #com_owner.JSMMessage properties of the ancestor class on the JSMX_COMMAND built-in function.

Refer above for an example of using JSMX_COMMAND and the JSMCheckStatus method.