globalcontext: URL Protocol
The globalcontext:
URL protocol allows you to access existing context keys from XSL mappings during runtime of a Technical Process. Context keys can be defined with the Global Context Manipulation Adapter. The documents stored in the context can be included using the document()
function.
Global context
With a globally defined context, the X4 BPMS can buffer any document from a Technical Process in a global hash table, similar to Technical Process context variables. This enables other Technical Processes to have access to this context. The documents in the global context will be stored with a key, and remain accessible during the total runtime of the X4 Server.
URL structure
The URL must follow the pattern:
globalcontext:KeyName
An XSL mapping using this URL protocol cannot be executed in the transformation preview oft the Mapping Editor.
Example
A sample XSL mapping retrieves a context key X4Experience.GlobalContext.Sample
that has already been defined using the Global Context Manipulation Adapter component. This context entry contains an XML document that will be retrieved from the XSL mapping using the document()
function, and will be buffered in an XSL variable DocVar
. Its nodes can be selected via XPath without limitation.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="UTF-8" method="xml" version="1.0"/>
<xsl:template match="/">
<result>
<xsl:variable
select="document('globalcontext:X4Experience.GlobalContext.Sample')" name="DocVar"/>
<xsl:value-of select="$DocVar/child::Data"/>
</result>
</xsl:template>
</xsl:stylesheet>