This tip explains how to add a Custom Event and how to trigger it. In the Event rule editor there is one Custom Event called Generic event that comes with the product. We are going to add another event here called Tip event. Open up the event rule editor throught the Dynamic Workload Console to see the Custom event list. Login to the TDWC then open the Tivoli Workload Scheduler > Workload Definition > Event Management and finally click on New Event Rule.

TWSCustomEvent

First export the Generic Event Plugin settings into a file with the xml extension. Login to the MDM and run the following command:

# evtdef dumpdef /tmp/GenericEventPlugIn.xml

Edit the GenericEventPlugIn.xml file.

# vi /tmp/GenericEventPlugIn.xml


Add the following code to the XML file:

,

<event baseAliasName="genericEvt" scope="Generic">
<complexName displayName="Tip event" name="Tip"></complexName>
<displayDescription>The event is sent when the specified expression is matched.</displayDescription>
<property type="string" required="true" wildcardAllowed="true" multipleFilters="true" minlength="1">
<complexName displayName="Tip Parameter" name="TipParam" />
<displayDescription>The value of parameter 1</displayDescription>
</property>
<property type="string" required="true" wildcardAllowed="false" multipleFilters="false" minlength="1">
<complexName displayName="Workstation" name="Workstation" />
<displayDescription>The workstation for which the event is generated.</displayDescription>
</property>
</event>

,

Find </event> and insert the new code after this line. The complete code should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<eventDefinitions xmlns="http://www.ibm.com/xmlns/prod/tws/1.0/event-management/plugins/events"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ibm.com/xmlns/prod/tws/1.0/event-management/plugins/events eventDefinitions.xsd">
<eventPlugin>
<complexName displayName="Custom event" name="GenericEventPlugIn"></complexName>
<scopes>
<scope name="Generic">
<scopedef text="{Param1} on {Workstation}" />
</scope>
</scopes>
<!-- Generic Event -->
<event baseAliasName="genericEvt" scope="Generic">
<complexName displayName="Generic event" name="Event1"></complexName>
<displayDescription>The event is sent when the specified expression is matched.</displayDescription>
<property type="string" required="true" wildcardAllowed="true" multipleFilters="true" minlength="1">
<complexName displayName="Parameter 1" name="Param1" />
<displayDescription>The value of parameter 1</displayDescription>
</property>
<property type="string" required="true" wildcardAllowed="false" multipleFilters="false" minlength="1">
<complexName displayName="Workstation" name="Workstation" />
<displayDescription>The workstation for which the event is generated.</displayDescription>
</property>
</event>
<event baseAliasName="genericEvt" scope="Generic">
<complexName displayName="Tip event" name="Tip"></complexName>
<displayDescription>The event is sent when the specified expression is matched.</displayDescription>
<property type="string" required="true" wildcardAllowed="true" multipleFilters="true" minlength="1">
<complexName displayName="Tip Parameter" name="TipParam" />
<displayDescription>The value of parameter 1</displayDescription>
</property>
<property type="string" required="true" wildcardAllowed="false" multipleFilters="false" minlength="1">
<complexName displayName="Workstation" name="Workstation" />
<displayDescription>The workstation for which the event is generated.</displayDescription>
</property>
</event>
</eventPlugin>
</eventDefinitions>

,

Save the changes and import the event definition changes.

# evtdef loaddef /tmp/GenericEventPlugIn.xml

Open the Event Rule Editor again and click on Custom Event. There should now be another custom event called Tip Event in the list.

TWSTipEvent

To test this custom event create an event rule with an action to send a message. In the event rule editor name the rule TIPEVENTRULE and select Tip event. A Tip event box appears click on it. Within the Properties window type in * in the Tip paramater field and "MALIN" in the workstation field.

TipEventRule

Add an action to send a message to the message logger. In the properties window add some description for instance "Send message to the message logger". In the message field enter: Tip event triggered with parameter %{genericEvt1.TipParam}. Select Severity Information and the Object Key TIP.

TipAction

Send an event with the TWS command sendevent.

# sendevent Tip GenericEventPlugIn TipParam="TipMessageLogger" Workstation="MALIN"

Open up Workload Tracking and click on Operator Messages. Select All Operator Messages and OK on the next page. The Tip message is displayed in the table with the TipParam value sent with the sendevent command.

TipMessage

Twitter Feed

OrbData Is your company ready for #GDPR? https://t.co/fGybdNrlCh
OrbData Setting up Windows PowerShell discoveries with #IBM #TADDM https://t.co/pxMZ2eVPpo

Address

Address:
100 Longwater Avenue, Green Park, Reading, RG2 6GP, U.K.
Tel:
+44 (0) 118 945 0130
E-Mail:
This email address is being protected from spambots. You need JavaScript enabled to view it.

markerFind on Google Maps

About Us

Orb Data brings together People, Process and Technology to deliver the cornerstone of business success: the management of IT infrastructure. At our heart are our people. We have unrivalled experience, helping us to achieve an enviable reputation for excellence in project delivery. Because we’re independent, we identify actual issues and help organisations resolve them –from spec to deployment, and beyond –providing the right solution in terms of best of breed technology and support. We offer a refreshingly simple approach to the way we conduct business. We take pride in our abilities to provide first class solutions to business problems, and to conduct working relationships with honesty and integrity.

Follow Us On:

JoomShaper