Schedule condition hooks

Creation of useful soccer event-report hooks for general use, e.g. in relation to Schedules as a hook source for conditions

You will need the 'post-event' Lookup.


You will need the 'PL_18_19_Fixture_Abbreviated' Lookup.


Schema


Using Ignition Post Win Client as a Template Editor.


  1. From the main tabs select: DATA

  2. From the sub-tabs select: SCHEMAS & HOOKS


There are three main panes:

  • SCHEMAS with SCHEMA below it

  • HOOKS with WORKING SET and HOOK PROPERTIES below it

  • HOOK EVALUATION


  1. Within SCHEMA make the following selections:

    1. Data Provider: XMLTeam

    2. Target: Production

    3. Schema: soccer event-report


    4. There may not be any sample data pre-loaded

    5. Click the button' Upload sample data from file'


Schedule condition hooks


  • Navigate to and select 'Southampton v Leicester City.xml'


  • You will have noticed three greyed out buttons adjacent to 'Upload sample data from file'

    • Validate Sample Data against Schema

    • Open schema in browser

    • Open sample data in browser


    Hook Creation


    You will use eight nodes to create one parent hook which has eleven sub-hooks. Some nodes will obviously be used more than once (i.e. differently named with 'Value Transforms' and 'Lookups' applied). You will then create three composite hooks. The image below depicts all the hooks you will now create.


    Schedule condition hooks


    1. Within the sub-pane SCHEMA, expand 'sports-content', 'sports-event', 'event-metadata', 'event-metadata-soccer' and 'time-adjustment'

    2. Highlight the node: sports-content.sports-event - Click 'Create a new hook into this element'

      1. Rename: Schedule Condition Hooks

    3. Highlight the node: sports-event.event-metadata.result-status - Click 'Create a new hook into this element'

    4. Within the WORKING SET pane, expand the parent hook: Schedule Condition Hooks

    5. Within the sub-pane SCHEMA, highlight the node: sports-event.event-metadata.event-name - Click 'Create a new hook into this element'

    6. Highlight the node: sports-event.event-metadata.event-status - Click 'Create a new hook into this element'

      1. Lookup: 'post-event' and 'post-event' column

      2. Rename the sub-hook: Event Status


    For information - You could examine the Lookup file being used above (i.e. main tab DATA sub-tab LOOKUPS). The entry for 'post-event' was created from a CSV file. The purpose of the lookup is to convert a 'postponed' match into a 'post-event' status. Lookups work by match matching data to an entry in the 'Key' column and then returning a corresponding entry from an alternate column (there can be more than one column).


    1. Within the sub-pane SCHEMA, highlight the node: sports-event.event-metadata.start-date-time - Click 'Create a new hook into this element'

      1. Rename: 'Event Date'

      2. Value Transform - Transform Steps (i.e. click the wand next to 'Value Transform' then click the 'Add' button next to 'Transform Steps'):

      3. 'Replace X with Y', where X=':' and Y='-'

      4. 'Take Up To X', where X='T'

    2. Highlight the node: sports-event.event-metadata.start-date-time - Click 'Create a new hook into this element'

      1. Rename: Event Start Time

      2. Value Transform - Transform Steps:

      3. 'Replace X with Y', where X=':' and Y='-'

      4. 'Skip Until After X', where X='T'

      5. 'Take 'N' Chars', where N='5'

    3. Highlight the node: sports-event.event-metadata.event-metadata-soccer.period-value - Click 'Create a new hook into this element'

      1. Rename: Current Period Value

    4. Highlight the node: sports-event.event-metadata.event-metadata-soccer.minutes-elapsed - Click 'Create a new hook into this element'

      1. Rename: Current Minutes Elapsed

    5. Highlight the node: sports-event.event-metadata.event-name - Click 'Create a new hook into this element'

      1. Lookup: 'PL_18_19_Fixture_Abbreviated' and 'Abbr' column

      2. Rename: Event Name Abbr

    6. Highlight the node: sports-event.event-metadata.event-name - Click 'Create a new hook into this element'

      1. Lookup: 'PL_18_19_Fixture_Abbreviated' and 'Abbr' column

      2. Rename: Event Name Home Abbr

      3. Value Transform - Transform Steps:

      4. 'Take Up To X', where X=' v ' (i.e. a space, the letter 'v' and a space)

    7. Highlight the node: sports-event.event-metadata.event-name - Click 'Create a new hook into this element'

      1. Lookup: 'PL_18_19_Fixture_Abbreviated' and 'Abbr' column

      2. Rename: Event Name Away Abbr

      3. Value Transform - Transform Steps:

      4. 'Skip Until After X', where X= ' v ' (i.e. a space, the letter 'v' and a space)


    Now to create the three composite hooks. The below image shows how to add a composite hook:


    Schedule condition hooks


    1. With 'Schedule Conditions Hooks' highlighted

      1. Click 'Add Composite Hook'

      2. Rename: Progress


    In the lower pane of HOOK PROPERTIES there are two sub-tabs:

    • COMPONENT HOOKS

    • LOOKUPS


    To the right-hand side is a 'Search Available Hooks' pane. You can expand hooks within this sub-pane to see available sub-hooks.


    1. Ensure the 'Progress' composite hook is selected:

      1. Change the Composite Mode: Coalesce

      2. Add the Component Hooks:

      3. Current Period Value

      4. Current Minutes Elapsed

    2. With 'Schedule Conditions Hooks' highlighted - Click 'Add Composite Hook'

      1. Rename: Event Date & Start Time

      2. Add the Component Hooks:

      3. Event Date

      4. Event Start Time

    3. With 'Schedule Conditions Hooks' highlighted - Click 'Add Composite Hook'

      1. Rename: Match Date Time

      2. Add the Component Hooks:

      3. Event Name Abbr

      4. Event Date & Start Time


    With 'Schedule Conditions Hooks' selected, the Hook Evaluation should look like the image below:


    Schedule condition hooks