Objectives: The result of an MBean call should be transferred for further use.
Objects used: Job, Workflow and Variable
Script elements used: :ENDPROCESS, GET_PROCESS_LINE, GET_VAR, JMX_INVOKE, PREP_PROCESS_REPORT, :PROCESS, :PUT_VAR, R3_ACTIVATE_REPORT and R3_MODIFY_VARIANT
The JMX agentA program that enables the de-centralized execution of processes (such as deployments) on target systems (computers or business solutions) or a service that provides connectivity to a target system (such as for databases or middleware). An agent is also an object type in the Automation Engine. [Formerly called "Executor."] See also: host and the functions made available in AE can be used to establish a connection to MBean Servers and access their MBeans. This example illustrates how an MBean can be called. The result will then be transferred to an SAP variant which is finally used to process a reportA report provides more detailed information about a task's execution or a component..
Variable
First a variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. is required which stores the result of the MBean call. Create a static Variable objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task with the following attributes in a first step:
Enter a key which will later contain the value of the MBean.
Jobs
Now create a JMX jobAn Automation Engine object type for a process that runs on a target system.. Select the connection to the MBean Server in the Host tab and use the Form tab in order to enter the scriptA particular Automation Engine object type. functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… for calling the MBean. The example below shows the content of the Process tab which contains the same information as the Form tab:
JMX_INVOKE OPERATIONNAME=conversionRate, MBEAN=UC4:type=CurrencyConverter, SIGNATURE="java.lang.String,java.lang.String", PARAMS="USD,EUR"
The MBean "UC4:type=CurrencyConverter" of the above example calculates the currency exchange rate Dollar vs. Euro and writes it to the job report. The value can be read using the script function PREP_PROCESS_REPORT. Use this script element in the Post Process tab of the JMX job. Example:
:SET &HND# = PREP_PROCESS_REPORT("JOBS",, "REP",,"COL=DELIMITER", "DELIMITER=*:*")
:PROCESS &HND#
: SET &RET# = GET_PROCESS_LINE(&HND#,2)
: PUT_VAR VARA.CURRENCY_RATE,"RATE",&RET#
:ENDPROCESS
In the next step, create a SAP job that reads the currency exchange rate from the Variable object, modifies a variant and starts a report. Create a SAP job and enter the processing statements either using the Form tab or directly in the Process tab. Example:
:SET &RATE# = GET_VAR(VARA.CURRENCY_RATE,"RATE")
R3_MODIFY_VARIANT REPORT='Z_CURRENCY_ABAP',VARIANT='VARIANT1',SELNAME='RATE',KIND='P',LOW='&RATE#'
R3_ACTIVATE_REPORT REPORT='Z_CURRENCY_ABAP',VARIANT='VARIANT1'
Note that the value for the parameter LOW is read from the Variable object.
Workflow
In a last step, create a workflowAn object of the Automation Engine that can include several executable objects and which runs them in a specified order. [Formerly called "ProcessFlow" and "JobPlan."] and add the two jobs above to it.
To execute the workflow, you must ensure that the MBean that you use has been registeredThis is the status of a task that runs within a group and is waiting for its start. for the MBean Server. Register it once using the script function JMX_CREATE_MBEAN. Vice versa, JMX_UNREGISTER_MBEAN removes an MBean that has already been registered.
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |