Petals-SE-Activity 1.0.0-SNAPSHOT

The page Petals-SE-Activity does not exist.
Contributors
No contributors found for: authors on selected page(s)

Creating a service-unit for a process definition

Creating the service contract

The SE Activity provides a service with several operation for a process definition. A WSDL is associated to this service. This WSDL can be written freely. The user can use its own namespace, its own names, ... It is only constraint by the following rules:

  • the operations of the binding section are annotated to link them to the supported operations (create an instance of the process definition, complete the current task of the process instance, ...)
  • the mandatory parameters of the operation are annotated to retrieve the right values.

Identifying operations

The mapping between operations of the WSDL and operations supported by the SE Activity is declared using a dedicated binding. The binding "Activity" is done adding the element {http://petals.ow2.org/se/activity/1.0}operation to the element operation of the binding. Its attribute activityAction defines the operation that will be executed.

Identifying parameters of operations

In the same way, parameters of operations are mapped through an annotation placed inside the message of the binding operation.

For input parameters, this annotation is done adding the element {http://petals.ow2.org/se/activity/1.0}input-parameter. This annotation takes two attributes:

  • the attribute name defines the variable name used in the process definition,
  • the attribute value defines the value to set to the variable using an XPath expression.

For output parameters, the annotation is done adding the element {http://petals.ow2.org/se/activity/1.0}output-parameter.

What about fault ?

Operations

Create an instance of a process definition

Operation

The operation creating instances of process definition is identified by the value createProcInstOp set on the attribute activityAction:

<wsdl:binding name="Order" xmlns:activity="http://petals.ow2.org/se/activity/1.0">
   <wsdl:operation name="newOrder" type="...">
      <activity:operation activityAction="createProcInstOp" />
      <activity:input-parameter name="customerName" value="/newOrderRequest/customerName" />
      <activity:input-parameter name="address" value="/newOrderRequest/address" />
      <activity:output-parameter name="activity:processInstId" stakeholder="/newOrderResponse/orderId" />
      <wsdl:input/>
      <wsdl:output/>
   </wsdl:operation>
</wsdl:binding>

It is possible to map several operations of the WSDL to the creation of process instances, but its has perhaps no sens.

Input parameters

TODO. Les types ?; les arborescences

Output parameters

*TODO

Complete task of a process instance

Operation

The operation completing a task of a process instance is identified by the value completeTaskOp set on the attribute activityAction:

<wsdl:binding name="Order" xmlns:activity="http://petals.ow2.org/se/activity/1.0" >
   <wsdl:operation name="validOrder" type="...">
      <activity:operation activityAction="completeTaskOp" />
      <wsdl:input/>
      <wsdl:output/>
   </wsdl:operation>
</wsdl:binding>

It is possible to map several operations of the WSDL to complete tasks, for example when a process can have several task in progress concurrently.

Some parameters are expected for this operation:

  • identifier of the process instance,
  • identifier of the task to complete,
  • completion status.

Mapping des parametres à faire

Input parameters

TODO. Les types ?; les arborescences

Output parameters

*TODO

Retrieve process instances

Operation

The operation retrieving process instances is identified by the value retrieveProcInst set on the attribute activityAction:

<wsdl:binding name="Order" xmlns:activity="http://petals.ow2.org/se/activity/1.0">
   <wsdl:operation name="searchOrder" type="...">
      <activity:operation activityAction="retrieveProcInst" />
      <wsdl:input/>
      <wsdl:output/>
   </wsdl:operation>
</wsdl:binding>

It is possible to map several operations of the WSDL to search process instance, for example with different search criteria.

Input parameters

TODO. Les types ?; les arborescences

Output parameters

*TODO

Configuring the component

The component is be configured through the parameters of its JBI descriptor file. These parameters are divided in following groups:

  • JBI parameters that have not to be changed otherwise the component will not work,
  • CDK parameters that are parameters driving the processing of the CDK layer,
  • and *Activity parametrs" that are relative to the engine "Activity".

TODO: Mettre une copie en exemple d'un descripteur JBI du SE

<?xml version="1.0" encoding="UTF-8"?>
<jbi
	version="1.0"
	xmlns='http://java.sun.com/xml/ns/jbi'
	xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
	xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
	xmlns:xslt="http://petals.ow2.org/components/activity/version-1">

	<component type="service-engine">
		<identification>
			<name>petals-se-activity</name>
			<description>An Activity Service Engine</description>
		</identification>

		<component-class-name description="Activity Component class">org.ow2.petals.se.activity.ActivitySe</component-class-name>
		<component-class-path><path-element/></component-class-path>
		<bootstrap-class-name>org.ow2.petals.component.framework.DefaultBootstrap</bootstrap-class-name>
		<bootstrap-class-path><path-element/></bootstrap-class-path>

		<petalsCDK:acceptor-pool-size>3</petalsCDK:acceptor-pool-size>
		<petalsCDK:processor-pool-size>10</petalsCDK:processor-pool-size>
		<petalsCDK:processor-max-pool-size>50</petalsCDK:processor-max-pool-size>
		<petalsCDK:properties-file></petalsCDK:properties-file>
		<petalsCDK:jbi-listener-class-name>org.ow2.petals.se.activity.ActivityJBIListener</petalsCDK:jbi-listener-class-name>
	</component>
</jbi>

CDK parameters

The component configuration includes the configuration of the CDK. The following parameters correspond to the CDK configuration.

Configuration of the component, CDK part

Parameter Description Default Required Scope
acceptor-pool-size The size of the thread pool used to accept Message Exchanges from the NMR. Once a message is accepted, its processing is delegated to the processor pool thread.
3

Yes

Runtime

acceptor-retry-number Number of tries to submit a message exchange to a processor for processing before to declare that it cannot be processed.
40

No

Installation

acceptor-retry-wait Base duration, in milliseconds, to wait between two processing submission tries. At each try, the new duration is the previous one added by this base duration multiplied by the try number plus a random value between 0 and 10.
250

No

Installation

acceptor-stop-max-wait The max duration (in milliseconds) of the stop of an acceptor before to force it to stop.
500

No

Runtime

message-processor-max-pool-size Max size of the object pool containing message exchange processors.
processor-max-pool-size

No

Runtime

processor-pool-size The size of the thread pool used to process Message Exchanges. Once a message is accepted, its processing is delegated to one of the thread of this pool.
10
Yes

Runtime
processor-max-pool-size The maximum size of the thread pool used to process Message Exchanges. The difference between this size and the processor-pool-size represents the dynamic threads that can be created and destroyed during overhead processing time.
50

No
Runtime

processor-keep-alive-time When the number of processors is greater than the core, this is the maximum time that excess idle processors will wait for new tasks before terminating, in seconds.
300

No
Runtime

processor-stop-max-wait The max duration (in milliseconds) of message exchange processing on stop phase.
15000

No
Runtime

time-beetween-async-cleaner-runs The time (in milliseconds) between two runs of the asynchronous message exchange cleaner.
2000

No
Installation

properties-file Name of the file containing properties used as reference by other parameters. Parameters reference the property name in the following pattern ${myPropertyName}. At runtime, the expression is replaced by the value of the property.

The value of this parameter is :
  • an URL
  • a file relative to the PEtALS installation path
  • an empty value to stipulate a non-using file
-
No
Installation
monitoring-sampling-period Period, in seconds, of a sample used by response time probes of the monitoring feature.
300

No
Installation

Definition of CDK parameter scope :

  • Installation: The parameter can be set during the installation of the component, by using the installation MBean (see JBI specifications for details about the installation sequence). If the parameter is optional and has not been defined during the development of the component, it is not available at installation time.
  • Runtime: The paramater can be set during the installation of the component and during runtime. The runtime configuration can be changed using the CDK custom MBean named RuntimeConfiguration. If the parameter is optional and has not been defined during the development of the component, it is not available at installation and runtime times.

Interceptor

Interceptors can be defined to inject some post or pre processing in the component during service processing.

Using interceptor is very sensitive and must be manipulate only by power users. An non properly coded interceptor engaged in a component can lead to uncontrolled behaviors, out of the standard process.

Example of an interceptor configuration:

<?xml version="1.0" encoding="UTF-8"?>
<!--...-->
<petalsCDK:component-interceptors>
  <petalsCDK:interceptor active="true" class="org.ow2.petals.myInterceptor" name="myInterceptorName">
    <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param>
    <petalsCDK:param name="myParamName2">myParamValue2</petalsCDK:param>
  </petalsCDK:interceptor>
</petalsCDK:component-interceptors>
<!--...-->

Interceptors configuration for Component (CDK)

Parameter Description Default Required
interceptor - class Name of the interceptor class to implement. This class must extend the abstract class org.ow2.petals.component.common.interceptor.Interceptor. This class must be loadable from the component classloader, or in a dependent Shared Library classloader. - Yes
interceptor - name Logical name of the interceptor instance. It can be referenced to add extended parameters by a SU Interceptor configuration. - Yes
interceptor - active If true, the Interceptor instance is activated for every SU deployed on the component.
If false, the Interceptor can be activated:
-by the InterceptorManager Mbean at runtime, to activate the interceptor for every deployed SU.
-by a SU configuration
- Yes
param[] - name The name of the parameter to use for the interceptor. - No
param[] The value of the parameter to use for the interceptor. - No

Component specific parameters

These parameters are extracted from parameters available for Activity 5.1.3:

  • database parameters. Your are responsible to provide this database according to your needs. And especially, you must assume that the database is highly available to have a SE Activity highly available.

Database parameters

Configuration of the component, Specific parameter part, Database

Parameter Description Default Required Scope
jdbc-url URL of the database. The default database is an in-memory database
jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000
Yes
Installation
jdbc-driver JDBC driver. Except for the default JDBC driver, it must be provided as shared-library.
org.h2.Driver
Yes
Installation
jdbc-username Username used for the database connection.
sa
Yes
Installation
jdbc-password Passwrd used for the database connection.
""
Yes
Installation
jdbc-max-active-connections The number of idle connections that the database connection pool at maximum at any time can contain.
10
No
Runtime
jdbc-max-idle-connections The number of active connections that the database connection pool at maximum at any time can contain.
-
No
Runtime
jdbc-max-checkout-time The amount of time in milliseconds a connection can be 'checked out' from the connection pool before it is forcefully returned.
20000 (20 seconds)
No
Runtime
jdbc-max-wait-time This is a low level setting that gives the pool a chance to print a log status and re-attempt the acquisition of a connection in the case that it’s taking unusually long (to avoid failing silently forever if the pool is misconfigured).
20000 (20 seconds)
No
Runtime

Logging

To enable traces of the Activity engine, you add in the logging configuration file of Petals ESB the following logger with the right level: xxxx

Monitoring the component

In this documentation, the term "Allocated threads" must be understood as "Active threads", see PETALSDISTRIB-37. This naming error will be fixed in the next version.

Using metrics

Several probes providing metrics are included in the component, and are available through the JMX MBean 'org.ow2.petals:type=custom,name=monitoring_<component-id>', where <component-id> is the unique JBI identifier of the component.

Common metrics

The following metrics are provided through the Petals CDK, and are common to all components:

Metrics, as MBean attribute Description Detail of the value Configurable
MessageExchangeAcceptorThreadPoolMaxSize The maximum number of threads of the message exchange acceptor thread pool integer value, since the last startup of the component yes, through acceptor-pool-size
MessageExchangeAcceptorThreadPoolCurrentSize The current number of threads of the message exchange acceptor thread pool. Should be always equals to MessageExchangeAcceptorThreadPoolMaxSize. instant integer value no
MessageExchangeProcessorObjectPoolBorrowedObjectsCurrent The current number of borrowed object of the message exchange processor object pool instant integer value no
MessageExchangeProcessorObjectPoolBorrowedObjectsMax The maximum number of object of the message exchange processor object pool that was borrowed integer value, since the last startup of the component no
MessageExchangeProcessorObjectPoolIdleObjectsCurrent The current number of idel object of the message exchange processor object pool instant integer value no
MessageExchangeProcessorObjectPoolIdleObjectsMax The maximum number of object of the message exchange processor object pool that was idle integer value, since the last startup of the component no
MessageExchangeProcessorObjectPoolMaxSize The maximum size, in objects, of the message exchange processor object pool instant integer value yes, through processor-max-pool-size
MessageExchangeProcessorObjectPoolMinIdleSize The minimum size, in objects (in state idle), of the message exchange processor object pool instant integer value yes, through processor-pool-size
MessageExchangeProcessorObjectPoolExhaustion The number of message exchange processor object pool exhaustions integer counter value, since the last startup of the component no
MessageExchangeProcessorThreadPoolAllocatedThreadsCurrent The current number of allocated threads of the message exchange processor thread pool instant integer value no
MessageExchangeProcessorThreadPoolAllocatedThreadsMax The maximum number of threads of the message exchange processor thread pool that was allocated integer value, since the last startup of the component no
MessageExchangeProcessorThreadPoolIdleThreadsCurrent The current number of idle threads of the message exchange processor thread pool instant integer value no
MessageExchangeProcessorThreadPoolIdleThreadsMax The maximum number of threads of the message exchange processor thread pool that was idle integer value, since the last startup of the component no
MessageExchangeProcessorThreadPoolMaxSize The maximum size, in threads, of the message exchange processor thread pool instant integer value yes, through http-thread-pool-size-max
MessageExchangeProcessorThreadPoolMinSize The minimum size, in threads, of the message exchange processor thread pool instant integer value yes, through http-thread-pool-size-min
MessageExchangeProcessorThreadPoolQueuedRequestsCurrent The current number of enqueued requests waiting to be processed by the message exchange processor thread pool instant integer value no
MessageExchangeProcessorThreadPoolQueuedRequestsMax The maximum number of enqueued requests waiting to be processed by the message exchange processor thread pool that was allocated since the last startup of the component instant integer value no
ServiceProviderInvokations The number of service provider invokations grouped by:
  • interface name, as QName, the invoked service provider,
  • service name, as QName, the invoked service provider,
  • invoked operation, as QName,
  • message exchange pattern,
  • and execution status (PENDING, ERROR, FAULT, SUCCEEDED).
integer counter value since the last startup of the component no
ServiceProviderInvokationsResponseTimeAbs The aggregated response times of the service provider invokations since the last startup of the component grouped by:
  • interface name, as QName, the invoked service provider,
  • service name, as QName, the invoked service provider,
  • invoked operation, as QName,
  • message exchange pattern,
  • and execution status (PENDING, ERROR, FAULT, SUCCEEDED).
n-tuple value containing, in millisecond:
  • the maximum response time,
  • the average response time,
  • the minimum response time.
no
ServiceProviderInvokationsResponseTimeRel The aggregated response times of the service provider invokations on the last sample, grouped by:
  • interface name, as QName, the invoked service provider,
  • service name, as QName, the invoked service provider,
  • invoked operation, as QName,
  • message exchange pattern,
  • and execution status (PENDING, ERROR, FAULT, SUCCEEDED).
n-tuple value containing, in millisecond:
  • the maximum response time,
  • the average response time,
  • the minimum response time,
  • the 10-percentile response time (10% of the response times are lesser than this value),
  • the 50-percentile response time (50% of the response times are lesser than this value),
  • the 90-percentile response time (90% of the response times are upper than this value).
no

Dedicated metrics

No dedicated metric is available.

Receiving alerts

Several alerts are notified by the component through notification of the JMX MBean 'org.ow2.petals:type=custom,name=monitoring_<component-id>', where <component-id> is the unique JBI identifier of the component.

To integrate these alerts with Nagios, see Receiving Petals ESB defects in Nagios.

Common alerts

Defect JMX Notification
A message exchange acceptor thread is dead
  • type: org.ow2.petals.component.framework.process.message.acceptor.pool.thread.dead
  • no user data
No more thread is available in the message exchange acceptor thread pool
  • type: org.ow2.petals.component.framework.process.message.acceptor.pool.exhausted
  • no user data
No more message exchange processor is available in the message exchange processor pool
  • type: org.ow2.petals.component.framework.process.message.processor.object.pool.exhausted
  • no user data
No more thread is available to run a message exchange processor
  • type: org.ow2.petals.component.framework.process.message.processor.thread.pool.exhausted
  • no user data

Dedicated alerts

No dedicated alert is available.

Annex: Sample WSDL

Abstract part:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns="http://petals.ow2.org/se/activity/sample/order"
	xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	targetNamespace="http://petals.ow2.org/se/activity/sample/order">

	<!-- Type definitions for input- and output parameters for webservice -->
	<wsdl:types>
		<xs:schema targetNamespace="http://petals.ow2.org/se/activity/sample/order">
			<xs:complexType name="ItemType">
				<xs:sequence>
					<xs:element name="reference" type="xs:string" />
					<xs:element name="quantity" type="xs:int" />
				</xs:sequence>
			</xs:complexType>
			<xs:element name="newOrderRequest">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="customerName" type="xs:string" />
						<xs:element name="address" type="xs:string" />
						<xs:element name="items">
							<xs:complexType>
								<xs:sequence>
									<xs:element name="item" type="tns:ItemType"
										maxOccurs="unbounded" />
								</xs:sequence>
							</xs:complexType>
						</xs:element>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="newOrderResponse">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="orderId" type="xs:string" />
					</xs:sequence>
				</xs:complexType>
			</xs:element>

		</xs:schema>
	</wsdl:types>

	<!-- Message definitions for input and output -->
	<wsdl:message name="newOrderRequest">
		<wsdl:part name="newOrderRequest" element="tns:newOrderRequest" />
	</wsdl:message>
	<wsdl:message name="newOrderResponse">
		<wsdl:part name="newOrderResponse" element="tns:newOrderResponse" />
	</wsdl:message>

	<!-- Port (interface) definitions -->
	<wsdl:portType name="Order">
		<wsdl:operation name="newOrder">
			<wsdl:input message="tns:newOrderRequest" />
			<wsdl:output message="tns:newOrderResponse" />
		</wsdl:operation>
		<wsdl:operation name="validOrder">
			<wsdl:input message="tns:validOrderRequest" />
			<wsdl:output message="tns:validOrderResponse" />
		</wsdl:operation>
		<wsdl:operation name="searchOrder">
			<wsdl:input message="tns:searchOrderRequest" />
			<wsdl:output message="tns:searchOrderResponse" />
		</wsdl:operation>
	</wsdl:portType>

</wsdl:definitions>

Implementation part

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns="http://petals.ow2.org/se/activity/sample/order"
	xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	xmlns:activity="http://petals.ow2.org/se/activity/1.0" targetNamespace="http://petals.ow2.org/se/activity/sample/order">

	<wsdl:import location="OrderAbstract.wsdl"
		namespace="http://petals.ow2.org/se/activity/sample/order" />

	<!-- Port bindings to transports and encoding - HTTP, document literal encoding 
		is used -->
	<wsdl:binding name="OrderBinding" type="tns:Order">
		<wsdl:operation name="newOrder">
			<activity:operation activityAction="createProcInstOp" />
			<activity:input-parameter name="customerName" value="/newOrderRequest/customerName" />
			<activity:input-parameter name="address" value="/newOrderRequest/address" />
			<activity:output-parameter name="activity:processInstId" stakeholder="/newOrderResponse/orderId" />
			<wsdl:input />
			<wsdl:output />
		</wsdl:operation>
		<wsdl:operation name="validOrder">
			<activity:operation activityAction="completeTaskOp" />
			<wsdl:input />
			<wsdl:output />
		</wsdl:operation>
		<wsdl:operation name="searchOrder">
			<activity:operation activityAction="retrieveProcInst" />
			<wsdl:input />
			<wsdl:output />
		</wsdl:operation>
	</wsdl:binding>

</wsdl:definitions>
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.