We have defined navigation to the complete.htm page in the OnInputProcessingevent handler of the start page. It occurs when the user chooses the Complete button on tutorial.htm.
The purpose of our completion page is to notify the underlying Enterprise Portal of the task completion, and to trigger the retrieval of the output data by the Application Server (AS) Java. The data must be already stored before you send the notification, and once retrieved, it is deleted from the data store.
...
1. Add a new BSP page to application EUP_BSP_CO. Define the following values for the page parameters:
Parameter |
Value |
Name |
complete.htm |
Page type |
Page with Flow Logic |
2. On the Layout tab, edit the source of the page as follows:
<%@page language="abap"%> <%@extension name="htmlb" prefix="htmlb"%> <SCRIPT>
var lnDotPos = document.domain.indexOf( "." ); if (lnDotPos >= 0) document.domain = document.domain.substr( lnDotPos + 1 );
function raiseEvent() { parent.EPCM.raiseEvent("urn:com.sap.eu.gp.co.bsp", "Complete", ""); }
raiseEvent();
</SCRIPT> |
The following table describes the JavaScript elements:
Code |
Description |
var lnDotPos = document.domain.indexOf( "." ); if (lnDotPos >= 0) document.domain = document.domain.substr( lnDotPos + 1 ); |
This code implements the principle of domain relaxing, which enables the communication between the Enterprise Portal, the BSP, and the Guided Procedures framework even if they reside on different hosts. |
function raiseEvent() { parent.EPCM.raiseEvent("urn:com.sap.eu.gp.co.bsp", "Complete", ""); }
|
With this code we fire a completion event to the AS Java using Enterprise Portal server-side scripting.
In case of an exception, we can also notify the AS Java using the following script: parent.EPCM.raiseEvent("urn:com.sap.eu.gp.co.bsp", "ProcessException"); |
3. Activate the BSP and the BSP application.
The BSP application as well as the elements required to expose it as a callable object are implemented.
You now can expose the BSP application as a callable object in Guided Procedures.