Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Jython sample scripts

Jython sample scripts are supplied with the Management Console. These scripts output the existing objects of the corresponding type together with their properties. It is also possible to create, modify or delete new test objects. The names of the test objects begin with "test" or "TEST". Actions (status query, start, stop) are started depending on the configuration.

When the Management Console has been installed, the following scripts are available in the subdirectory cli-sample of the Management Console installation directory:

  • startBcAdmin.cmd (for Windows platforms) or startBcAdmin.sh (for Solaris/Linux platforms) – start script.

    startBcAdmin.cmd or startBcAdmin.sh calls the script sampleMccliStart.py.

  • sampleMccliStart.py – Start Jython script from which the required sample scripts are called depending on the specified options.

  • sampleAdminCommService.py – Jython script with functions for the module BcAdminCommunicationService.

  • sampleAdminEisPartner.py – Jython script with functions for the module BcAdminEisPartner.

  • sampleAdminInbound.py – Jython script with functions for the modules BcAdminInboundUser, BcAdminInboundService, BcAdminInboundMsgEndpoint.

  • sampleAdminLu62Gateway.py – Jython script with functions for the module BcAdminLu62Gateway.

  • sampleAdminMain.py – Jython script with functions for the modules BcAdminMain and BcAdminTodo.

  • sampleAdminProxy.py – Jython script with functions for the module BcAdminProxy.

  • sampleAdminProxyCluster.py – Jython script with functions for the module BcAdminProxyCluster.

  • sampleAdminRa.py – Jython script with functions for the module BcAdminRA.

  • sampleAdminOutbound.py – Jython script with functions for the modules BcAdminOutboundService, BcAdminOutboundCommEndpoint.

  • sampleInitConfig.template.py – Template for adapting the configuration data and the required scope of the samples.

Using the Jython sample scripts

Perform the sequence of steps described below:

  • In the start script startBcAdmin.cmd or startBcAdmin.sh, set the environment variable JYTHONPATH.

  • Create an overwritable copy of sampleInitConfig.template.py with the name sampleInitConfig.py. This file must always be located in the directory containing the scripts (default after installation: cli-sample). It is used by all the Jython sample scripts.

  • Adapt the configuration file sampleInitConfig.py, see section " Editing the configuration file".

  • Call the start script StartBcAdmin.cmd/sh, see section " Calling the start script". When you do this, use the call options to specify which scripts and functions are to be executed.

You can also start any of the Jython sample scripts as a main program. However, if you do this you must manually specify the parameters that are supplied in the start script. It is therefore recommended to start the scripts via the central start script with the corresponding options.

Editing the configuration file

The configuration file sampleInitConfig.py contains specifications relating to the objects that are to be read by the sample scripts. Runtime parameters are also defined in this file.

Proceed as follows:

  • In sampleInitConfig.py, replace the "****" placeholders in the individual object parameters for the proxy, EIS partner, resource adapter etc. with the actual values. The following object parameters apply to all scripts:

    console_home

    Installation directory of the Management Console. Alternatively, the information can also be read via the environment variable BEANCONNECT_USERCONS.

    proxy_name

    Name of the proxy for which the functions are to be executed (not necessary in the case of sampleAdminMain.py).

    admin_pw

    Password of the proxy for which the functions are to be executed (not necessary in the case of sampleAdminMain.py).

    For details of the other parameters, see the inline description in sampleInitConfig.py.

  • In sampleInitConfig.py, change the predefined runtime parameters (create, modify, save, delete, start/stop proxy) if you wish. There are the following runtime parameters:

    • bCreDelObjs=True/False
      Generate and remove test objects (the object names start with "test" or "TEST")

    • bModObjs=True/False
      Modify test objects.

    • bSaveMod=True/False
      Save changes to configuration.

    • Other script-specific switches (see also the comments in sampleInitConfig.py).

    In most cases, bCreDelObjs=bModObjs=bSaveMod=True creates and modifies a test object in a first pass through the scripts. This object is then removed in a second pass. The sequence of the functions is usually controlled by the value of the property desc ("created" -> "modified" -> remove object):

    • If a test object does not exist then it is created with desc="created".

    • If a test object exists and desc="created", then the object is modified (desc="modified").

    • If a test object exists and desc="modified", then the object is removed from the configuration.

Calling the start script

Open the Windows prompt or a Solaris or Linux shell and enter the following command in the directory cli-sample:

startBcAdmin.cmd [options] (Windows systems)

startBcAdmin.sh [options] (Solaris and Linux systems)

You control the function scope using options. The following values are possible:

-help
or -h

Help function. Simply outputs the possible parameters together with an explanation.
Default value if no option has been specified.

-all

Starts all the sample scripts sampleAdminXxx.

-cs

Starts sampleAdminCommService.py.

-ei

Starts sampleAdminEisPartner.py.

-gw

Starts sampleAdminLu62Gateway.py.

-in

Starts sampleAdminInbound.py.

-main

Starts sampleAdminMain.py.

-out

Starts sampleAdminOutbound.py.

-proxy

Starts sampleAdminProxy.py.

-proxy-cl

Starts sampleAdminProxyCluster.py.

-ra

Starts sampleAdminRa.py.

-log

Logging function, i.e. detailed output of the information that is read
(list elements, properties of the read objects). This can be specified in addition to all the other options listed above.