You can use the getPresentation() method to generate the interface presentation for a custom dataslot. When a custom dataslot is passed as an input, you must only call the getPresentation() method. To ensure compatibility with previous code, the custom object base class (BSObject) implements this function as follows:
/**
* get DS presentation. Present it as input if inout = false
* or output (editable) if inout = true
*/
public String getPresentation(boolean inout, Hashtable presAttrs)
{
if(inout == false)
return getHTML();
else
return setHTML();
}
Retrieving data from custom dataslots passed as outputs
In the previous section, it was necessary to only call the getPresentation() method of the custom dataslot that is passed as an input.
1. To retrieve data from a custom dataslot passed as output, Business Process Server runtime automatically performs the following:
2. Calls the getPresentation() method to get and display the presentation for that custom dataslot.
3. After submitting the form that contains the custom dataslot, calls the doReqProcessing() method of the custom dataslot.
4. The doReqProcessing() method updates the data that the user entered in the form generated by getPresentation() back into the custom dataslot object, which in turn Business Process Server stores into a data storage mechanism (currently the BPM Workflow bean).
See the following example:
public BSObject doReqProcessing(HttpServletRequest request)
{
String name = null;
String addr = null;
name = request.getParameter("name");
addr = request.getParameter("address");
setName(name);
setAddress(addr);
return this;
}