Create an Event Definition File

The event definition file that identifies the topic that is published to the PageBus must be created manually.

An example file is provided with the simpleProcessInstancePreview application (which is part of the wccPassThruManagedHub sample application). It can be found here:

StudioHome\wcc\version\Samples\wccPassThruManagedHub\JSXAPPS\simpleProcessInstancePreview\defs\applicationEvents.xml

This example identifies the topic, which includes the event name, that is published if you are using the wccPassThruManagedHub sample application:

<?xml version="1.0"?>
<app model="com.tibco.wcc.wccPassThruManagedHub">
   <prototype model="sampleAppPrototype">
      <component model="workviews">
         <event name="listItemSelect" schemaId="com.tibco.wcc.schema.workviews"/>
      </component>
      <component model="processviews">
         <event name="listItemSelect" schemaId="com.tibco.wcc.schema.processViews"/>
      </component>
   </prototype>
</app>

You can make a copy of this file and modify it to fit your needs. It must be in the form:

<?xml version="1.0"?>
<app model="com.tibco.wcc.appModelName">
   <prototype model="prototypeModelName">
      <component model="componentModelName">
         <event name="listItemSelect" schemaId="com.tibco.wcc.schema.componentModelName"/>
      </component>
   </prototype>
</app>

where:

  • appModelName - This is normally the application model name. It can be any name you want when you are creating your own event definition file.
  • prototypeModelName - This is normally the model name given to the prototype. This can also be any name you want.
  • componentModelName - This is normally the model name of the component. When you are creating an event definition file for the purpose of displaying a work item list or a process instance list, use one of the following for component model name:
  • workviews - Use this if you are displaying a work item list.
  • processviews - Use this if you are displaying a process instance list.

    The reason you are using one of these names is because these are the components whose schema is expecting a listItemSelect event. You can technically use any name you want here, but when you attempt to subscribe to the listItemSelect event, a dialog is displayed telling you that you are subscribing to an event that the component is not expecting; you can continue to subscribe even if this dialog is displayed.

Notice the event name is listItemSelect, which renders the work item list or process instance list, depending on the payload that was passed when the publish method was called.

An example is show below:

<?xml version="1.0"?>
<app model="com.tibco.wcc.MyApp">
   <prototype model="MyAppsPrototype">
      <component model="workviews">
         <event name="listItemSelect" schemaId="com.tibco.wcc.schema.workviews"/>
      </component>
   </prototype>
</app>

This example would require that the topic the non-WCC code publishes to the PageBus be:

com.tibco.wcc.myApp.MyAppsPrototype.workviews.listItemSelect

The WCC client will then import the event definition file using the TIBCO General Interface Builder Event Editor, and subscribe to the event — see Importing the Event Definition File and Subscribing to the Event.

After manually creating the event definition file, save it in the directory structure of your WCC application. The name you give the file is also arbitrary; as long as you can point to it when importing it. A suggested file name/path is:

...\JSXAPPS\YourAppName\defs\applicationEvents.xml