com.highdeal.iec.action
Class JavaTask

java.lang.Object
  extended by com.highdeal.iec.action.JavaTask
All Implemented Interfaces:
XMLExportable

public abstract class JavaTask
extends java.lang.Object
implements XMLExportable

This is an 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:

  1. setProperties(Properties) to initialize the JavaTask implementation.
  2. 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:

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:

Your customized jar file must be accessible by the IEC application.

See Also:
CannotInitializeException, ExecException

Constructor Summary
JavaTask()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaTask

public JavaTask()
Method Detail

execute

public abstract DataCollection execute(DataCollection collection)
                                throws ExecException
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.

Notes

Error Handling: When an error occurred in this method, it has to be wrapped by a ExecException.

Parameters:
collection - The data collection containing the parameters of execution
Returns:
The data collection modified if it does
Throws:
ExecException
See Also:
JavaTaskInitializable

setProperties

public abstract void setProperties(java.util.Properties props)
                            throws CannotInitializeException
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.

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.

Parameters:
props - The properties set by the running IEC application
Throws:
CannotInitializeException - is thrown when something from the Properties is not expected

initialize

public final void initialize(com.highdeal.hci.XMLMarshallable model)
                      throws CannotInitializeException
Description copied from interface: XMLExportable
Initializes from the XML-marshallable model.

Specified by:
initialize in interface XMLExportable
Parameters:
model - The model used for initializing
Throws:
CannotInitializeException - if the initialization fails

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)