-
Open the Run MQL window:
-
From the compass, select Collaboration and
Approvals.
-
In the navigation pane, click .
To run an MQL command, enter the command in the
MQL Command box and click Run
or press Enter.
- To set the context for the MQL session, run this command:
set context user creator; - To define the events menu, follow these steps:
- To determine if an event menu already exists for an object, run this command:
print type <TYPENAME>; where <TYPENAME> is the name of the object involved in the event. For example: print type Decision; In the list of properties, check if the SubscriptionEventsMenu property has been defined. For a Decision, the property looks like this: property SubscriptionEventsMenu to menu APPDecisionEvents If the menu exists, you do not need to create an events menu. You can add your event command to the existing menu. - To create the events menu, run this command:
add menu <MENUNAME> description <DESCRIPTION>; where: For example: add menu APPDecisionEvents description "Events menu for Decisions";
- To define each event command, follow these steps:
add command <COMMANDNAME> description <DESCRIPTION> setting <SETTINGNAME> <SETTINGVALUE>; where: For example: add command APPDecisionAttachedEvent
description "When Decision is used in a Decision Relationship"
setting "Event Type" "Decision Attached"
setting "Registered Suite" Components; - To connect the event commands to the event menu, run this command:
modify menu <MENUNAME> add command <COMMANDNAME>; where: <MENUNAME> is the name of the menu defined above<COMMANDNAME> is the name of the command defined above
For example: modify menu APPDecisionEvents add command APPDecisionAttachedEvent ; - To map the event menu to the object, run this command:
modify type <NAME> property SubscriptionEventsMenu to menu <MENUNAME>; where:
<NAME> is the admin type
<MENUNAME> is the menu created above
For example: modify type Decision property SubscriptionEventsMenu to menu APPDecisionEvents When a user chooses to subscribe to the object (a Decision), the subscribe dialog box is populated with the commands in the specified menu. - To create the notification, run this command:
add businessobject Notification <NAME> <REVISION>
policy "Business Rule"
vault "eService Administration"
"Body HTML" <HTML Code>
"Body Text" <TEXT>
"From Agent" <PERSON>
"Registered Suite" <SUITE>
"Static To List" emxSubscriptionUtil:getSubscribersList
"Subject Text" <STRING>
"URL Suffix" <SUFFIX>; where: <NAME> is the name of the object. Use the name of the command created above.<REVISION> is the revision level. use the relationship name and event type.
The remainder of the command adds these attributes: Attribute | Description | Example Value |
---|
Body HTML | Property in the string resources file that contains the message in HTML format. | emxVPMCentral.Notification.PLMInstanceModify.Body.HTML | Body Text | Property in the string resources file that contains the message in text format. | emxVPMCentral.Notification.PLMInstanceModify.Body | From Agent | The Person to show in the From field of the email message. If you use &USER , the notification is sent from the context user. | $<person_UserAgent> &USER | Registered Suite | The app's suite name. | VPMCentral | Static To List | The program:function that retrieves the notification's "to" list (the list of subscribers). | JPO emxSubscriptionUtil:getSubscribersList | Subject Text | Property in the string resources file that contains the text for the Subject line of the email message. | emxVPMCentral.Notification. PLMInstanceModify.Subject | URL Suffix | URL parameter/values to add to the URL string in the email message. | &mode=tree |
For example: add businessobject Notification APPDecisionAttachedEvent -
policy "Business Rule"
vault "eService Administration"
"Body HTML" emxCommonUtil:getNotificationHTML
"Body Text" emxCommonUtil:getNotificationText
"From Agent" ${USER}
"Registered Suite" Components
"Static To List" emxSubscriptionUtil:getSubscribersList
"Subject Text" emxComponents.Notification.Event.Decision_Attached; You also need to define the string resources used by the notification. In the above example, the Subject Text defines a string resource. For more information, see Changing Onscreen Text and Other Strings. - To define the trigger (eServices Trigger Program Parameters object), run this command:
add businessobject "eService Trigger Program Parameters" <NAME> <REVISION>
vault "eService Administration"
"eService Method Name" <METHOD>
"eService Program Name" <PROGRAM>
"eService Sequence Number" <INTEGER>
"eService Program Argument 1" ${RELID}
"eService Program Argument 2" <EVENT>; where: <NAME> use the same name as assigned to the command<REVISION use the same revision assigned to the command- The remainder of the command adds these attributes:
Attribute | Value |
---|
eService Method Name | When defining a trigger for an object, use objectNotification . When defining a trigger for a relationship, use relationshipNotification . | eService Program Name | emxNotificationUtil | eService Sequence Number | 101 (or any high number to ensure the notification follows
any other actions defined for the event) | eService Program Argument 1 | For an object-related event, use ${OBJECTID} . For an event for an object caused by a relationship, use $[FROMOBJECTID} or ${TOOBJECTID} , depending on which side of the relationship that triggered the event the object is attached to.For a relationship trigger, use ${RELID} .
| eService Program Argument 2 | Event Type, where the value is the Event Type defined
when you created the command |
For example: add businessobject "eService Trigger Program Parameters" APPDecisionAttachedNotificationAction APPDecisionAttachedEvent
vault "eService Administration"
"eService Method Name" objectNotification
"eService Program Name" emxNotificationUtil
"eService Sequence Number" 101
"eService Program Argument 1" ${FROMOBJECTID}
"eService Program Argument 2" APPDecisionAttachedEvent; - To define an action trigger for the event, follow these steps:
- Print the details of the object or relationship to determine if an action trigger already exists. The sample in this task is an event that occurs when a Decision is attached to an object. The action trigger for the subscription needs to be on the relationship used to make that connection. For this example, you would run this command:
print relationship Decision; Look for the line defining triggers. In this example: trigger CreateAction:emxTriggerManager(APPDecisionAttachedNotificationAction
APPAttachedToDecisionNotificationAction DomainAccessRelationshipToCreateAction
RelationshipAllCopyChildPOVCreateAction),
DeleteAction:emxTriggerManager(DomainAccessRelationshipDeleteAction) This relationship includes several action triggers that run when the relationship is created (CreateAction), and one delete action trigger. - To add the action trigger, run this command:
modify <TYPE_OR_REL> <TYPENAME_OR_RELNAME> add trigger <EVENT_TYPE> action
eTriggerManager <TRIGGERNAME>; where: <TYPE_OR_REL> is either type or relationship , depending on where you are adding the trigger<TYPENAME_OR_RELNAME> is the name of type or relationship<EVENT_TYPE> is the type of event that the user wants to be notified of. For a list of events, see MQL
Command Reference: type Command.<TRIGGERNAME> is the name of the eServices Trigger Program Parameters object that you created above.
For example: modify relationship Decision add trigger connect action
eTriggerManager APPDecisionAttachedNotificationAction;
- To activate the notification and trigger objects, run these commands:
modify businessobject Notification <NAME> <REVISION> current Active;
modify businessobject "eService Trigger Program Parameters" <NAME> <REVISION> current Active; Use the exact names and revisions for these objects as defined above. For example: modify businessobject Notification APPDecisionAttachedEvent - current Active;
modify businessobjects "eService Trigger Program Parameters" APPDecisionAttachedNotificationAction APPDecisionAttachedEvent
current Active;
|