Petals-SE-KPI 1.0.x

This document is an excerpt from Petals View's User Guide. For further information, please refer to the full Petals View's User Guide.

Stage 2: Configuring Petals View

  • Download the KPI component (petals-se-kip.zip)
  • Browse to petals-se-kip.zip/META-INF
  • Open the jbi.xml file.
  • On the line <petals-se-kpi:hibernateURL>: fill in the path of the file petals-view.properties (that you created in Stage 1).

example:

<petals-se-kpi:hibernateURL xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petals-se-kpi="http://petals.ow2.org/components
/petals-se-kpi/version-1.0-SNAPSHOT" xmlns:kpi-config="http://petals.ow2.org/components/petals\-
se-kpi/specific" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-x">[file:///home/user/Bureau/petals-view.properties]
</petals-se-kpi:hibernateURL>

If you use MySQL or Oracle database, You need to copy mysql-connector-java-5.1.x.jar or oracle-jdbc-10g.jar in your petals-se-kpi component with the others dependencies.

Save the changes.

  • Download Petals View (petalsview.war)
  • Browse to petalsview.war/WEB-INF/spring
  • Open the file petals-view-annotation.xml
  • Fill in the path to petals-view.properties file:
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="file:////home/strino/Bureau/petals-view.properties"/>
</bean>

Save the changes.

If you use MySQL database or Oracle database, You need to copy mysql-connector-java-5.1.x.jar or oracle-jdbc-10g.jar in PetalsView/ WEB-INF/lib.

Stage 4: Creating your SA-KPI.zip and corresponding SU-KPI.zip

You can use Petals Studio to create the SA-KPI needed for notification configuration. For this guide, we'll use an example of SA/SU batch to show you how to create them.
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 :

<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>

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:

<?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\[\]</kpi:TopicExpressionContent>

<kpi:MessageContentXpath>boolean(/\*[local-name()='publishBusinessEntity'|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>
  • 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()='publishBusinessEntity'])</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(true())</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>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:MessageContentSOAEndpoint>travelAgencyEndpoint</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:

<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>

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/": here, you define a parameter

<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>

Here you define the parameters you want to attach to your step. Notice that for now, the parameters attached to an «out» state will not be taken in account.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.