public abstract class JavaTask extends java.lang.Object implements XMLExportable
abstract Java class used when customizing the behavior of an SAP CC Import/Export Connector (IEC) application in your system landscape;
You develop a Java class that is processed by a running IEC application when executing a scenario that includes a Java Action or a Log Action component.
To insert your own Java code in the execution of a scenario by a Import/Export Connector (IEC) application,
you need to add and set up a Java Action component in the scenario and to develop a customized Java class that extends
this abstract class if you want to initialize some properties and to customize the processing of data collections.
Design and develop the following methods depending on your business requirements:
setProperties(Properties) to initialize the JavaTask implementation.execute(DataCollection) to perform the JavaTask implementation (only if the initialization has not thrown an exception).
You can extend your Java class with the following Java interfaces depending on your business requirements:
JavaTaskInitializable to enrich your class
JavaTaskIterator
JavaTaskStateListener
UserLogger if you want to customize the behavior of an IEC application that executes a Log Action component configured in the processed scenario
You develop the handling of exceptions that can be thrown by the IEC application.
Refer to the method details to know which exception you must handle in your Java class (CannotInitializeException,
ExecException).
You must configure a scenario that includes a Java Action component. Set up this component by defining the name of your customized Java class.
Note
Consult the primary help of the CAT Tool user interface for more information about the:
Your customized jar file must be accessible by the IEC application.
CannotInitializeException,
ExecException| Constructor and Description |
|---|
JavaTask() |
| Modifier and Type | Method and Description |
|---|---|
abstract DataCollection |
execute(DataCollection collection)
Invoked by the running IEC application to process a
JavaTask using the data collection specified as parameters.The parameters from the parent nodes are in the data collection. |
void |
initialize(com.highdeal.hci.XMLMarshallable model)
Initializes from the XML-marshallable model.
|
abstract void |
setProperties(java.util.Properties props)
Invoked by the running IEC application to initialize your customized Java class (extending the
JavaTask abstract class);
This initialization creates the Java properties configured in the Java Action component. |
public abstract DataCollection execute(DataCollection collection) throws ExecException
JavaTask using the data collection specified as parameters.data collection.
Notes
data collection, it
must return the data collection. For example, your class can add some properties in the data collection).
JavaTaskInitializable interface that adds methods invoked before and after this execute(..)
method.
Error Handling:
When an error occurred in this method, it has to be wrapped by a ExecException.
collection - The data collection containing the parameters of executiondata collection modified if it doesExecExceptionJavaTaskInitializablepublic abstract void setProperties(java.util.Properties props)
throws CannotInitializeException
JavaTask abstract class);
This initialization creates the Java properties configured in the Java Action component.
Use the getProperty(..) method to retrieve a key and its value.
The Properties are built from the property XML nodes of the JavaActionModel.
Error Handling:When the initialization cannot be done (a property is missing for instance or has a bad value, etc...), a CannotInitializeException can be thrown.
props - The properties set by the running IEC applicationCannotInitializeException - is thrown when something from the Properties is not expectedpublic final void initialize(com.highdeal.hci.XMLMarshallable model)
throws CannotInitializeException
XMLExportableinitialize in interface XMLExportablemodel - The model used for initializingCannotInitializeException - if the initialization fails