Exporting User-Defined Methods

If you want a user-defined component interface to be exportable, meaning used by code that instantiates the component interface, the method PeopleCode definition must include a Doc statement. It is in the form of:

Doc <documentation for method>

where <documentation for method> describes what the method does

For example, the following method returns true if foo is positive; otherwise, it returns false.

Function MyFooBar(&foo as number) returns boolean
Doc "GET"
if (&foo > 0) then
return True;
else
return False;
end-if;
end-function;

If a component interface method is to be exposed in a web service, the Doc statement should describe the standard method after which it will be called and show an indication of each type of input parameter it requires. In the following example, the SetPassword method on the USER_PROFILE component interface has been exposed to a web service. The Doc statement in this case has a string following the Doc keyword and consists of comma-separated values: the method name Get, a string containing the new password, and another string for the confirmation password.

Function SetPassword(&password As string, &passwordConfirm As string) Returns⇒
 boolean
   Doc "GET, NewPasswd, ConfirmPasswd"