A SA-KPI is composed of: a META-INF folder which will contain jbi.xml file and the su-kpi.zip.
example of a jbi.xml file from a sa-kpi.zip :
{code:lang=xml}
<jbi version="1.0" xmlns="http://java.sun.com/xml/ns/jbi">
<service-assembly>
<identification>
<name>sa-in</name>
<description>SA in.</description>
</identification>
<service-unit>
<identification>
<name>su-notif-in</name>
<description>su in description.</description>
</identification>
<target>
<artifacts-zip>su-notif-in.zip</artifacts-zip>
<component-name>petals-se-kpi</component-name>
</target>
</service-unit>
</service-assembly>
</jbi>
{code}
A SU-KPI is composed of: a META-INF folder containing SU's jbi.xml file and a special file, modelNotification.xls
example of jbi.xml file of a SU:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<!--JBI descriptor for the PEtALS' "petals-se-kpi" component (WS-Notification).
Originally created for the version 1.0-SNAPSHOT of the component. -->
<jbi:jbi version="1.0" xmlns:notification="http://petals.ow2.org/petals-se-notification"
xmlns:wsn-br="http://docs.oasis-open.org/wsn/br-2"
xmlns:kpi="http://petals.ow2.org/petals-se-kpi"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:st="http://www.ebmwebsourcing.com/wsnotification/specificTypes">
<!-- Import a Service into PEtALS or Expose a PEtALS Service => use a BC. -->
<jbi:services binding-component="false">
<!-- Expose a PEtALS Service => consumes a Service. -->
<jbi:consumes
interface-name="wsn-br:NotificationBroker"
service-name="notification:NotificationBrokerService"
endpoint-name="NotificationBrokerServiceEndpoint">
<!-- CDK specific fields -->
<petalsCDK:operation>Subscribe</petalsCDK:operation>
<petalsCDK:mep>InOut</petalsCDK:mep>
<!-- Component specific elements -->
<!-- Subscription to process on init : -->
<kpi:TopicExpressionDialect>http://docs.oasis-open.org/wsn/t1/TopicExpression/Full</kpi:TopicExpressionDialect>
<kpi:TopicExpressionNamespace>http://petals.ow2.org/topic</kpi:TopicExpressionNamespace>
<kpi:TopicExpressionPrefix>petals</kpi:TopicExpressionPrefix>
<kpi:TopicExpressionContent>petals:component/cdk/producer/in[@wstop:topic='true']</kpi:TopicExpressionContent>
<kpi:MessageContentXpath>boolean(/*[local-name()='publishBusinessEntity'])</kpi:MessageContentXpath>
<kpi:MessageContentXpathDialect>http://www.w3.org/TR/1999/REC-xpath-19991116</kpi:MessageContentXpathDialect>
<kpi:MessageContentSOADialect>http://www.ebmwebsourcing.com/wsnotification/soaparameter</kpi:MessageContentSOADialect>
<kpi:MessageContentSOAInterfaceNamespace>http://org.ow2.petals/demo/travelagency/agency/</kpi:MessageContentSOAInterfaceNamespace>
<kpi:MessageContentSOAInterfaceName>travelAgency</kpi:MessageContentSOAInterfaceName>
<kpi:MessageContentSOAServiceNamespace>http://org.ow2.petals/demo/travelagency/agency/</kpi:MessageContentSOAServiceNamespace>
<kpi:MessageContentSOAServiceName>travelAgencyService</kpi:MessageContentSOAServiceName>
<kpi:TransformPolicy>/modelNotification.xsl</kpi:TransformPolicy>
<kpi:ContextPolicyCorrelationId>true</kpi:ContextPolicyCorrelationId>
<kpi:ContextPolicyInterface>true</kpi:ContextPolicyInterface>
<kpi:ContextPolicyEndpoint>true</kpi:ContextPolicyEndpoint>
<kpi:ContextPolicyMeuuid>true</kpi:ContextPolicyMeuuid>
<kpi:ContextPolicyNotifDate>true</kpi:ContextPolicyNotifDate>
<kpi:ContextPolicyService>true</kpi:ContextPolicyService>
<kpi:ContextPolicyStatus>true</kpi:ContextPolicyStatus>
<kpi:ProcessPolicyAction>create</kpi:ProcessPolicyAction>
</jbi:consumes>
</jbi:services>
</jbi:jbi>{code}
* The text in red defines for which state you configure the present SU: in -- out -- status \--fault.
* Texts in blue define the filtering you want to apply to notifications:
<kpi:MessageContentXpath>boolean(/*\[local-name()={color:#23b8dc}'{color}{color:#0084d1}publishBusinessEntity'{color}\])</kpi:MessageContentXpath> :
** here you can apply filtering criteria on content fields, as long as they are present in the messages. If you don't want any content filtering, set the value to "true".
Example : <kpi:MessageContentXpath>boolean({color:#0084d1}true(){color})</kpi:MessageContentXpath>
** You can filter directly on service's endpoint or interface (these fields are not mandatory). You can also filter on endpoint:
<kpi:MessageContentSOAInterfaceNamespace>{color:#0084d1}[http://org.ow2.petals/demo/travelagency/agency/]{color}</kpi:MessageContentSOAInterfaceNamespace>
<kpi:MessageContentSOAInterfaceName>{color:#0084d1}travelAgency{color}</kpi:MessageContentSOAInterfaceName>
<kpi:MessageContentSOAServiceNamespace>{color:#0084d1}[http://org.ow2.petals/demo/travelagency/agency/]{color}</kpi:MessageContentSOAServiceNamespace>
<kpi:MessageContentSOAServiceName>{color:#0084d1}travelAgencyService{color}</kpi:MessageContentSOAServiceName>
<kpi:MessageContentSOAEndpoint>{color:#0084d1}travelAgencyEndpoint{color}</kpi:MessageContentSOAEndpoint>
* Text in orange defines the name of the file which will be used as a model for the notifications.
example of the modelNotification.xls file:
{code}
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<wsnebm:NotifyContent xmlns:wsnebm="http://www.ebmwebsourcing.com/WS-BaseNotification/NotifyContent"
processType="1" xmlns:age="[http://org.ow2.petals/demo/travelagency/agency/">
<wsnebm:params>
<wsnebm:param><xsl:value-of select="//age:lastname/text()"/></wsnebm:param>
<wsnebm:param><xsl:value-of select="//email/text()"/></wsnebm:param>
</wsnebm:params>
</wsnebm:NotifyContent>
</xsl:template>
</xsl:stylesheet>
{code}
processType: here you have to type the same integer value as in Petals View's referential for this type of flows.
xmlns:age="[http://org.ow2.petals/demo/travelagency/agency/|http://org.ow2.petals/demo/travelagency/agency/]": here, you define a parameter
{code}
<wsnebm:params>
<wsnebm:param><xsl:value-of select="//age:lastname/text()"/></wsnebm:param>
<wsnebm:param><xsl:value-of select="//email/text()"/></wsnebm:param>
</wsnebm:params>
{code}