| # To configure an attached action script To create an action script for a trigger: Start the Triggers (datrg1100m000) session and change the trigger's Action Template to 'Attached Script'. Run the Configure Action command. The text editor is started. Enter the required Baan C code. When you leave the text editor and return to the Triggers (datrg1100m000) session, the trigger program is regenerated automatically, if the text was changed. When you change the Action Template from 'Attached Script' to another setting, the text content is not deleted. So when you switch back to the 'Attached Script'Action Template, the existing text is used. The first time you run the Configure Action command, for a trigger with Action Template = 'Attached Script', the system generates a default template with the following content:
    function extern long process.event(ref long io.event)
    | IMPORTANT: do not change the interface (function name, parameter,
    | and return value)
    {
    DLLUSAGE
    Desc            This function processes a trigger event.
    Input           io.event: event
    Output          return value: 0 (OK) or < 0 (an error value)
                    io.event: the event may (but need not) be updated
                    within this function
    Precondition:   io.event contains an event that is formatted according
                    to library datrgevent and must be read using that
                    library.
    ENDDLLUSAGE

            | < Add implementation here > |

            return(0) | OK
    }
TO CUSTOMIZE A GENERATED PROGRAM Instead of writing an action function from scratch, you can customize a generated script. This is useful if you want to define actions that are not supported by the Triggers (datrg1100m000) session. Currently this session supports the following standard action templates: Attached Script Fan Out Create XML File You can use a customized program if you want to take another type of action, such as invoking an LN program, an operating system script, or a Java method. Assume you configured an XML File Action for a trigger. In that case a generated program is available in the Path for Program that is specified for the trigger; the file name is <path>/<trigger>.src. Take the following steps to copy code from the generated script to a new action script: Open the generated script and copy the process.event() function from that source to the Windows clipboard. Start the Triggers (datrg1100m000) session, change the trigger's Action Template to 'Attached Script', and run The Configure Action command. The Text Editor is started. Paste the copied contents from the clipboard into the standard action template that is displayed in the Text Editor. Adapt the script until it meets your requirements. Note The system does not perform an automatic merge of the attached action script and a configured 'Fan Out' or 'Create XML File' action. For example, you change the Action Template to 'Create XML File'. Subsequently you update the action in the Configure XML File Action (datrg1225m000) session, and finally you switch back to 'Attached Script' mode. The attached script is NOT updated automatically. |