SXI Forum

A place to collect usefull tips, tricks and implementation strategies.

You are not logged in.

#1 09-02-2020 11:48:00

StephanB
Member
Registered: 21-11-2018
Posts: 39

Configuring a Trigger in ServiceBroker Schedule

There is 2 file that you will need to edit.
The ServiceBrokerTrigger.xml in the \SXI\X-ServiceBroker\xml\tasks and the ServiceBroker Initialisation.xml in the \SXI\X-ServiceBroker\xml folder.

Take note of the Arguments. The <EntryPoint name="X-AssetClient"> in the ServiceBrokerTrigger.xml must be the same as the <Arguments>X-AssetClient</Arguments> in the Schedule. if it is not configured correctly no ServiceBroker trigger will be generated.

In the ServiceBrokerTrigger.xml you need to add a new EntryPoint in the EntryPoints.
Example:

<EntryPoint name="X-AssetClient">
            <Format>
                <sxi:Transmission xsi:type="sxi:XmlTransmission">
                    <sxi:Destination>127.0.0.1</sxi:Destination>
                    <sxi:OutputMethod>
                        <sxi:TransmitMethod>Local</sxi:TransmitMethod>
                    </sxi:OutputMethod>
                </sxi:Transmission>
                
                <Action>GetKeyData</Action>
                <Provider>X-AssetClient</Provider>
                
                <AdditionalElements>
                    <Element>Element1</Element> 
                </AdditionalElements>
            </Format>
</EntryPoint>

In the ServiceBroker Initialisation.xml you need to add a new Schedule in the Schedules like below.
Example:

<Schedule name="X-AssetClient">
        <!-- The trigger file X-AssetClient will be triggered every Friday at 1:00 -->
        <AT>00 1 * * 5</AT>
        <Action>
            <Path>C:\SXI\X-ServiceBroker\tasks</Path>
            <Command>ServiceBrokerTrigger.class</Command>
          <Arguments>X-AssetClient</Arguments> 
        </Action>
</Schedule>

Here is a example of the file that was generate from the config above in the XmlOut folder.

<?xml version="1.0" encoding="iso-8859-1"?>
<XServiceBroker xmlns="http://www.sxi.co.za/XMLSchema">
  <XHeader>
    <XPress>
      <Destination>127.0.0.1</Destination>
    </XPress>
    <XServiceBroker>
      <ActionName>GetKeyData</ActionName>
      <Provider>X-AssetClient</Provider>
    </XServiceBroker>
  </XHeader>
  <Element>Element1</Element>
  <TimeTriggerGenerated>1581237480</TimeTriggerGenerated>
</XServiceBroker>

Last edited by StephanB (09-02-2020 11:48:58)

Offline

Board footer

Powered by FluxBB