Specific How-tos

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (6)

View Page History
@org.oasisopen.sca.annotation.Service(value=MyExtendedActivity.class,names="service")
@PolicySets("frascati:scaEasyPrimitive")

public class MyExtendedActivityImpl extends DebugPackageExtendedActivityImpl<TMyExtendedActivity> implements MyExtendedActivity {

}

@Override
protected TMyExtendedActivity convertElementToModel(Element elmt)
throws BPELException {
TMyExtendedActivity res = null;
try {
JAXBElement<TMyExtendedActivity> jaxb = this.getJaxbContext().createUnmarshaller().unmarshal(elmt, TMyExtendedActivity.class);
res = jaxb.getValue();
} catch (JAXBException e) {
throw new BPELException(e);
} catch(SchemaException e){
throw new BPELException(e);
}
return res;
}

}
{code}

You have to fill the constructor (at least with a {{super()}} method), the {{convertElementToModel()}}, {{validate()}} and {{generate()}} methods.
The {{validate}} method SHOULD be filled whereas the {{generate}} method MUST be filled. It consists basically in instantiating the extended behavior developed at EasyVIPER level. Here is an example of {{generate}} method:
{code:title=MyExtendedActivityImpl.java excerpt|borderStyle=solid}
@Override
public Node generate(Scope scope) throws CoreException {

MyExtendedBehavior myExtendedBehavior = new MyExtendedBehaviorImpl();
// myExtendedBehavior.foo()
Node behaviourNode = scope.createNode(this.model.getName(), myExtendedBehavior);
}
{code}


Your extended activity is completed. You only needs to add it in dependency of your BPEL engine and to set or create an ExtendedActivityInitialization.xml file
{code:xml|title=ExtendedActivityInitialization.xml|borderStyle=solid}
<?xml version="1.0" encoding="UTF-8"?>

<tns:ExtendedActivitiesInitialization xmlns:tns="http://com.ebmwebsourcing.easybpel/ExtendedActivityInitialization" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://com.ebmwebsourcing.easybpel/ExtendedActivityInitialization ../../main/resources/ExtendedActivityInitialization.xsd ">

<tns:extendedActivityInitialization>

<tns:definition>DebugActivitiesPackageConfiguration.xml</tns:definition>

<tns:implementation>easybpel.extended.activities.package.debug-1.2-SNAPSHOT.jar</tns:implementation>

</tns:extendedActivityInitialization>

</tns:ExtendedActivitiesInitialization>
{code}