|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (3)
View Page History
An extended activity implementation must be composed of a JAVA interface extending the {{ExtendedActivity}} interface:
First of all, an XSD schema must be created, corresponding to the extended activity. In particular, you must create a type that extends the Extended activity type defined in the BPEL 2.0 specification.
{code:xml|title=Excerpt of the extended activity schema.|borderStyle=solid}
<xsd:complexType name="tMyExtendedActivity">
<xsd:complexContent>
<xsd:extension base="bpel:tExtentedActivity">
<xsd:sequence>
<xsd:element ref="tns:myExtendedActivityElement" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="myExtendedActivityElement" type="..." />
{code}
This schema must be able to generate Java source code. The following excerpt is a way to do that thanks to a maven plugin:
{code:xml}
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<configuration>
<schemaDirectory>
${basedir}/src/main/resources
</schemaDirectory>
<schemaIncludes>
<include>MyExtendedActivity.xsd</include>
</schemaIncludes>
<bindingIncludes>
<include>binding.xjb</include>
</bindingIncludes>
</configuration>
</plugin>
{code}
Here is an example of binding.xjb:
{code:xml|title=binding.xjb|borderStyle=solid}
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jaxb:bindings schemaLocation="InvokeAddressingActivity.xsd"
node="/xs:schema">
<jaxb:schemaBindings>
<jaxb:package name="mypackage.myextendedactivity..." />
</jaxb:schemaBindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="schema/bpel/2_0/ws-bpel_executable.xsd"
node="/xs:schema">
<jaxb:schemaBindings>
<jaxb:package name="com.ebmwebsourcing.easybpel.model.bpel.executable" />
</jaxb:schemaBindings>
</jaxb:bindings>
</jaxb:bindings>
{code}
An extended activity implementation must then be composed of a JAVA interface extending the {{ExtendedActivity}} interface:
<xsd:complexType name="tMyExtendedActivity">
<xsd:complexContent>
<xsd:extension base="bpel:tExtentedActivity">
<xsd:sequence>
<xsd:element ref="tns:myExtendedActivityElement" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="myExtendedActivityElement" type="..." />
{code}
This schema must be able to generate Java source code. The following excerpt is a way to do that thanks to a maven plugin:
{code:xml}
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<configuration>
<schemaDirectory>
${basedir}/src/main/resources
</schemaDirectory>
<schemaIncludes>
<include>MyExtendedActivity.xsd</include>
</schemaIncludes>
<bindingIncludes>
<include>binding.xjb</include>
</bindingIncludes>
</configuration>
</plugin>
{code}
Here is an example of binding.xjb:
{code:xml|title=binding.xjb|borderStyle=solid}
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jaxb:bindings schemaLocation="InvokeAddressingActivity.xsd"
node="/xs:schema">
<jaxb:schemaBindings>
<jaxb:package name="mypackage.myextendedactivity..." />
</jaxb:schemaBindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="schema/bpel/2_0/ws-bpel_executable.xsd"
node="/xs:schema">
<jaxb:schemaBindings>
<jaxb:package name="com.ebmwebsourcing.easybpel.model.bpel.executable" />
</jaxb:schemaBindings>
</jaxb:bindings>
</jaxb:bindings>
{code}
An extended activity implementation must then be composed of a JAVA interface extending the {{ExtendedActivity}} interface:
{code:title=MyExtendedActivity.java|borderStyle=solid}
import com.ebmwebsourcing.easybpel.model.bpel.api.activity.extension.ExtendedActivity;
import com.ebmwebsourcing.easybpel.model.bpel.api.activity.extension.ExtendedActivity;
