Class JavaTask
- All Implemented Interfaces:
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.
Implementation in Your IEC Application
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.
Customizing Sequence
Design and develop the following methods depending on your business requirements:
setProperties(Properties)to initialize theJavaTaskimplementation.execute(DataCollection)to perform theJavaTaskimplementation (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:
JavaTaskInitializableto enrich your classJavaTaskIteratorJavaTaskStateListenerUserLoggerif you want to customize the behavior of an IEC application that executes a Log Action component configured in the processed scenario
Error Handling
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).
Application Configuration
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:
- Java Action component
- Scenarios for IEC applications
Your customized jar file must be accessible by the IEC application.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract DataCollectionexecute(DataCollection collection) Invoked by the running IEC application to process aJavaTaskusing thedata collectionspecified as parameters.
The parameters from the parent nodes are in thedata collection.final voidinitialize(com.highdeal.hci.XMLMarshallable model) Initializes from the XML-marshallable model.abstract voidsetProperties(Properties props) Invoked by the running IEC application to initialize your customized Java class (extending theJavaTaskabstract class); This initialization creates theJava propertiesconfigured in the Java Action component.
-
Constructor Details
-
JavaTask
public JavaTask()
-
-
Method Details
-
execute
Invoked by the running IEC application to process aJavaTaskusing thedata collectionspecified as parameters.
The parameters from the parent nodes are in thedata collection.Notes
- When your customized Java class modifies the received
data collection, it must return the data collection. For example, your class can add some properties in thedata collection). - Consider the
JavaTaskInitializable interfacethat adds methods invoked before and after thisexecute(..) method.
Error Handling: When an error occurred in this method, it has to be wrapped by a
ExecException.- Parameters:
collection- Thedata collectioncontaining the parameters of execution- Returns:
- The
data collectionmodified if it does - Throws:
ExecException- See Also:
- When your customized Java class modifies the received
-
setProperties
Invoked by the running IEC application to initialize your customized Java class (extending theJavaTaskabstract class); This initialization creates theJava propertiesconfigured in the Java Action component.Use the
getProperty(..) methodto retrieve a key and its value.The
Propertiesare built from thepropertyXML nodes of theJavaActionModel.
Error Handling:When the initialization cannot be done (a property is missing for instance or has a bad value, etc...), a
CannotInitializeExceptioncan be thrown.- Parameters:
props- The properties set by the running IEC application- Throws:
CannotInitializeException- is thrown when something from thePropertiesis not expected
-
initialize
public final void initialize(com.highdeal.hci.XMLMarshallable model) throws CannotInitializeException Description copied from interface:XMLExportableInitializes from the XML-marshallable model.- Specified by:
initializein interfaceXMLExportable- Parameters:
model- The model used for initializing- Throws:
CannotInitializeException- if the initialization fails
-