Try OpenEdge Now
skip to main content
BPM Events User's Guide
The rule language : Predefined rule actions : generate(): Generating internal events
 

generate(): Generating internal events

Use the generate() predefined rule action (of type functional statement) to generate events to BPM Events itself. The general syntax is:
generate(
    <list_of_evt_attribute_names_values>,
    event:<evt_var>,)
The arguments are: Values of attributes. These arguments represent a possibly empty list of named values, each of the form: <evt_attribute>:<value>. This list should start with the type of the new event. Each (name:value) pair sets an attribute of the new event. If the event:<evt_var> argument of generate() the reused event is present, then it is used as a basis to generate the new event: the generated event is then initialized as a copy of the reused event. If no reused event is specified (last optional argument), then the list of named values should always include at least the two items: type:... and value:.... The named values contain the following semantics with regard to the reused event:
*If the same attribute name already exists in the reused event, then the named value replaces the value of this attribute in the (context of the) new generated event.
*If no similar attribute exists in the reused event (or if there is no reused event), then the named value initializes a new attribute in the (context of the) generated event.
*"event" argument (optional): "reused event" is an event variable that represents an incoming existing event—captured in the condition part of the rule—to be reused for generating the new event.
Note: These special attributes of the reused event are not automatically reported in the new event: the event ID attribute (normally irrelevant to applications), and the PROCESSINSTANCEID, specific to BP Server events. If the latter requires reporting, then this should be done explicitly in the preceding list of name/value pairs, but under a different name, that is, mypid:EVT1.PROCESSINSTANCEID.
Examples of internal event generation are given below.
generate(type:"ApplicationFailure",
    value:"IO",
    hostName:EVT_13.hostName,
    processId:EVT_13.processId,
    diskId:EVT_12.diskId);
generate(
    type:"Timeout",
    task:EVT_1.taskname,
    event:EVT_2);