Creating Callable Objects for Background
Execution
The Guided Procedures framework allows you to expose a Java class as a callable object that does not necessarily have a user interface. Such callable objects are executed in background mode, but you can map their output to the parameters of another callable object.
To be able to use a Java class as a callable object for background execution:
● The Java class must implement GP interface com.sap.caf.eu.gp.co.api.IBackgroundCallableObject.
● It must be deployed in a library on the SAP Web Application Server (Java).
For more information, see Implementing a Callable Object for Background Execution.
...
1. Open the gallery, and choose Create Callable Object from the contextual menu.
2. From the Type list, select Service → Background Executionand enter the required basic data as follows:
Parameter |
Description |
Name |
Enter an arbitrary name for the callable object. |
Description |
Describe the callable object by entering a brief description of its functions, for example. |
Original Language |
From the dropdown menu select the language in which the translatable texts in the callable object definition are being created. |
Folder |
Select a folder in the gallery where the callable object is stored.
You can either select an existing folder, or create a new one. |
3. Choose Next to open screen Define Object.
Enter the following data:
Parameter |
Description |
Container Type |
You can choose either Library or Service. This refers to the type of the J2EE Engine component that contains the callable object class. |
Container |
From the dropdown menu select the library or service that contains the callable object class.
The available options depend on what you have selected for Container Type. For example, if you have selected Library, only the J2EE Engine libraries available on the server are displayed. |
Implementation Class Name |
Enter the fully qualified Java name of the class that you want to expose as a callable object. |
4. Choose Next to open the Define Input screen.
If the Java class implements input parameters, they are automatically detected and displayed. Otherwise, this screen is skipped.
5. Choose Next to open the Define Output screen.
If the Java class implements output parameters, they are automatically detected and displayed. Otherwise, this screen is skipped.
6. Choose Next to open the Set Configuration screen.
If the Java class implements configuration parameters, they are automatically detected and displayed. You can enter values for the configuration parameters.
Otherwise, this screen is skipped.
7. Choose Next, and then Finish and Open.
The design time for the callable object opens. You can edit its definition, if required.
Optionally, you can grant permissions to other users for viewing or modifying the object. To do that, open the Permissions tab page.
8.
To activate the
object, choose
(Activate).
You can test the procedure using class SystemLogCO from the GP library caf~eu~gp~ actions. It creates log entries in the default trace file of the J2EE Engine.
...
1. Complete steps 1 and 2 as described in the general procedure above.
2. In step 3 enter the following data:
Parameter |
Value |
Container Type |
Library |
Container |
caf~eu~gp~ actions |
Implementation Class Name |
com.sap.caf.eu.gp.callobj.system. |
3. You are not required to enter anything in step 4.
4. Since this class only implements input parameters, step 5 is skipped.
5. In step 6 you choose a severity level for the log messages that are stored, Information message, for example. You can also enter a specific prefix for the log messages that the callable object writes gp, for example.
You can test the callable object and then check the result in the Log Viewer. The default trace file should contain an entry with the prefix gp and the text that you entered in the field Log Text at execution.
In a process you can use this callable object to log the output from other callable objects.