Performing Pre-Processing for Action Items

You can define a PeopleCode application class and method to perform pre-processing on an action item before the target transaction is displayed to the user. In addition to performing this pre-processing, the application class and method must redirect to the target transaction. Alternatively, you can implement this functionality in an iScript instead of in an application class.

Important:

During pre-processing, do not attempt component buffer access, use think-time functions such as MessageBox, WinMessage, or others, or use system variables.

To implement pre-processing for an action item in an application class and method:

  1. Define an application class that extends the PT_RCF:ServiceAGInterface.

  2. Define the execute method, which implements and extends the execute method in the base class.

  3. Set the %This.StrRedirectUrl property to redirect to the target transaction.

  4. Append the %This.StrAGQueryParameter property to the end of the generated component URL.

  5. Create a related content service definition for this application class.

  6. In the Action Item Details grid, select App Class URL as the link type and select the related content service definition.

The following example shows the PTAI_AGPKG_UNINAV:TestPreProcessing, which implements and extends the PT_RCF:ServiceAGInterface base class:

import PT_RCF:ServiceAGInterface;
import PTAI_ACTION_ITEMS:*;

class TestPreProcessing extends PT_RCF:ServiceAGInterface
   method execute();
end-class;

method execute
   /+ Extends/implements PT_RCF:ServiceInterface.execute +/
   Local PTAI_ACTION_ITEMS:ActionItem &ObjAItem;
   Local boolean &boolSaved;
   Local string &market;
   &ObjAItem = create PTAI_ACTION_ITEMS:ActionItem();
   &ObjAItem.open(%This.StrActionItemId);
   If &ObjAItem.Status <> "4" Then
      &ObjAItem.Status = "2";
   End-If;
   &boolSaved = &ObjAItem.save();
   &market = %Market;
   If None(&market) Then
      &market = "GBL";
   End-If;
   %This.StrRedirectUrl = GenerateComponentContentURL(%Portal, %Node, MenuName.PTUN_MENU, &market, Component.PTUN_REMOTENODECFG, Page.PTUN_REMOTENODECFG, "") | %This.StrAGQueryParameter;
end-method;