ServiceGrid Article - XSL Templates

From DocWiki

Jump to: navigation, search

Contents

Overview

Templates are used for transforming internal (call) data to an external form and external (call)-data to internal SD namespace. Templates are written in XSLT (XSL transformation).

Three types of outbound templates are available:

  • Text templates: Change the internal SD XML structure to a text structure.
  • XML templates: Change the internal SD XML structure to a different XML structure
  • HTML templates: Change the internal SD XML structure to a HTML document.

Inbound templates change an external XML structure to an internal SD XML structure (inbound namespace).

Templates can be self created and individually or copied from the standard-templates (and individually adapted). Templates are created and saved as XSL transformations. The template can use all the fields of a call. Templates are used in SD for:

  • Definition of content of outbound messages
  • Definition of translation of inbound XML messages C
  • reation of templates to view Call Data
  • Creation of templates for sending emails manually out from a call

Elements of an XSL Template are:

<XSL:STYLESHEET  version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<XSL:TEMPLATE  match="Setups">
<SD.CALL>
<XSL:CALL-TEMPLATE name="My_Main-Template">
</XSL:CALL-TEMPLATE>
</SD.CALL>
</XSL:TEMPLATE>
<XSL:TEMPLATE name="My_Main-Template">
<XSL:TEXT>Here ends the first part of the Main-Template. </XSL:TEXT>
<!-- The next line will start the Include Template -->
<XSL:CALL-TEMPLATE name="My_Include-Template">
<!-- A parameter is handed over to the Include Template. -->
<XSL:WITH-PARAM name="My_Parameter">HELLO WORLD</XSL:WITH-PARAM>
</XSL:CALL-TEMPLATE>
<!-- End of the Conclude Template -->
<XSL:TEXT> End of the Main Template.</XSL:TEXT>
</XSL:TEMPLATE>
</XSL:STYLESHEET> 

Include Template

<XSL:TEMPLATE name="My_Include-Template">
<!-- Initilalsation of the parameters -->
<XSL:PARAM name="My_Parameter"></XSL:PARAM>
<XSL:TEXT>This is the parameter for my Incluce-Template: </XSL:TEXT>
<!-- The parameter is used as a varaible -->
<XSL:VALUE-OF select="$My_Parameter"></XSL:VALUE-OF>
<XSL:TEXT>.</XSL:TEXT>
</XSL:TEMPLATE>


Result:

Here ends the first part of the Main Template.
This is the parameter for my Include Template: HELLO WORLD.
End of the Main Template.


Control Tags

Control tags are used to control B2B messages based on user-defined functions.

Control Tags Template

<span style="display: none;" id="1430995406497S"> </span><?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> 
<CALL> <xsl:attribute name="Valid">No</xsl:attribute> <!-- Attribute specifying if the message will be processed to create or update a call; 
set to "No" to suppress the message --> <!-- ATTENTION Order of attributes and controlls MUST be first ATTRIBUTES then CONTROLS --> 
<!-- Control Tags BEGIN --> 
<Control.ForwardAfterClose><xsl:value-of select="/SD.call/Control/ForwardAfterClose" /></Control.ForwardAfterClose> 
<!-- Control Tag if set to """"N"""" Partner-Outbound-MessageTrigger will not be fired if call was closed before update with actual record. 
Possible Values: """"Y/N""""--><br><Control.MakePreSelection><xsl:value-of select="/SD.call/Control/MakePreSelection" /></Control.MakePreSelection> 
<!-- If set to ""Y"", converter tries to find an open Call only using SPCallID or CustCallID (Without ContractInformation). 
Possible Values: ""Y""/""N"" --><br><Control.SetCurrentCallState>
<xsl:value-of select="/SD.call/Control/SetCurrentCallState" /></Control.SetCurrentCallState> 
<!-- Inbound ControlTag - Values: """"Y/N"""" - If set to yes, current CallState will be set explicit, if no CallState is sent. 
(Activates Mapping-Rules) --><br><Control.UpdateAfterCloseAllowed><xsl:value-of select="/SD.call/Control/UpdateAfterCloseAllowed" />
</Control.UpdateAfterCloseAllowed> <!-- Inbound ControlTag Values: """"Y/N"""" - 
If set to yes, the customer can update an existing Call after close if no Calls.ID is given. --><br>
<Control.UseCodeDefaults><xsl:value-of select="/SD.call/Control/UseCodeDefaults" /></Control.UseCodeDefaults> <!-- If it is set to ""N"" 
no default-code (e.g. Priority) will be set, if value is not given by inbound interface. --><br>
<Control.UseSuccessors><xsl:value-of select="/SD.call/Control/UseSuccessors" />
</Control.UseSuccessors> <!-- Control Tag If set to ""N"" only Partner-Successors are valid. Own Successors will be ignored. Values: Y/N -->
<br><Control.UseIndependentDeviceRef><xsl:value-of select="/SD.call/Control/UseIndependentDeviceRef" /></Control.UseIndependentDeviceRef> 
<!-- If yet to ""Y"", the call is searched for without device data and the device used for the call-device relationship is searched for independently
--><br><Control.MergeDefaultsOnContractOrContractElementChange>
<xsl:value-of select="/SD.call/Control/MergeDefaultsOnContractOrContractElementChange"/>
</Control.MergeDefaultsOnContractOrContractElementChange> <!-- If set to ""Y"" and the message cheanges the Contract/ContractElement of the call,
the defaults are re-merged from Con/CEl to Call --><br>
<!-- Control Tags END -->


New Control Tags Fields in Cisco ServiceGrid Release 7.1

Control.DeactivateOutboundTriggers

A new inbound control field Control.DeactivateOutboundTriggers has been implemented. This inbound message control field has several value selections that allow specific message trigger behaviors.

The possible values are as follows:

  • OfPartner—prevents my partner's message triggers from being activated.
  • MyOwn—prevents my message triggers from being activated.
  • BothSides—prevents both my message triggers as well as those of my partner’s from being activated.
  • No—allows all message triggers to be activated. This is the default value of this message control field.

The field description is available in the CommonContent > Dictionary > Fields document.

For more information, refer to the Common Content document.

Control.UsePartnerSideSuccessors

A new inbound control field Control.UsePartnerSideSuccessors has been implemented. With field control field, it can be defined if the successor rules of my partner should be deactivated.

The possible values are as follows:

  • Y: Successor rules on partner side will be validated and the update will only be processed if the successor rules is not violated.
  • N: Successor rules on partner side will not be checked. Deactivation of successor allows the ticket to be set to the state that was sent in the inbound message whether it is allowed or not.

For more information on Control Tags, refer to the XSL Template document.

Related Articles

Common Content

For a complete list of Cisco ServiceGrid Articles, go to the List of Articles page.



Rating: 0.0/5 (0 votes cast)

Personal tools