How MForms Automation Builder works
MForms Automation Builder allows users to start M3 programs and run predefined steps automatically through the M3 UI Adapter (MUA). The automation sequence simulates user actions and returns control to the user when the sequence is complete.
Users define automation data as an XML document that contains the sequence of steps to run.
Automation sequences
An automation sequence represents a set of actions that a user normally performs manually in an M3 BE program.
This is an example of a user flow:
- Start a program (MMS001).
- Set sorting order and press .
- Specify field values and navigate panels.
- Select list options.
Each action becomes an automation step in the sequence.
Automation steps
Each automation consists of one or more steps.
The steps can include:
- Command
- Value
- Optional fields (0 to n)
This table shows the list of supported commands:
| Command | Value | Description |
|---|---|---|
| RUN | M3 BE Program Name | The RUN command starts an M3 BE program. Use the short program name as the value, for example, MMS001.
The RUN command cannot set field values. It ignores fields that users add to it. |
| KEY | ENTER, F1 - F24 | Press a key. The next button is the same as ENTER and the back button is the same as F12. |
| LSTOPT | 1 - 99, -1 | Performs a list of option. By default, the command sets the option on the first visible list row unless users specify selected rows with the SELROWS parameter.
Note: Use -1 to create an option, and use 1 to select an option.
|
| AUTOSET | Not applicable | This command can set field values but does not make a request to the server. Users can use the command to specify data on the last panel. |
Automation fields
Use fields to pass values into panels or control behavior. Each field has:
- Name
- Value
Use these special fields:
- FCS (Focus)
Sets the focus on a specific field. For example,
FCS=WWITNO. - SELROWS (Selected Rows)
Specifies the rows to which the list option is applied. For example,
SELROWS=R1,R2,R3.
Automation XML structure
A small XML document describes an automation sequence. Users can generate the XML document at runtime or create it from XML templates.
This example shows an automation XML with values:
<?xml version="1.0" encoding="utf-8"?>
<sequence>
<step command="RUN" value="MMS001" />
<step command="KEY" value="ENTER">
<field name="WWQTTP">1</field>
</step>
<step command="KEY" value="ENTER">
<field name="W1ITNO">TESTITEM</field>
<field name="WWPSEQ">E</field>
</step>
<step command="LSTOPT" value="2" />
</sequence>
This example shows an empty automation XML:
<?xml version="1.0" encoding="utf-8"?>
<sequence>
<step command="" value="" />
<step command="" value="">
<field name=""></field>
</step>
<step command="" value="">
<field name=""></field>
<field name=""></field>
<field name=""></field>
</step>
</sequence>