Skip to Main Content
Return to Navigation

Considerations for Creating a New Action Type

When creating a new action type, consider:

Configuring the Action Type

If your action type requires a configuration page:

  • Create record definitions, keyed by EOCF_ACTION_ID, to capture design time configuration data.

  • Create an action configuration component and page.

  • Insert EOCF_ACTN_CFG_SBPG in the configuration page.

    This displays the action type and action name on the configuration page.

  • Insert the policy information subpage, EOCF_RULEINFO_SBP, on the page.

    This displays policy information, including the policy name and condition text.

  • If you need to access terms, put a clone of EOCF_SRCH_DSP_AL as a secondary page on your action configuration page, and add the following code in the page's activate code.

    See the display alert action configuration page, EOCF_DSPL_ALRT_CFG, as an example of a configuration page.

    import EOCF_CLF_RB:Definition:Rule:Rule;
    import EOCF_CLF_RB:UI:*;
    
    Component SearchBuilder &cobjSearchBuilder;
    Component SearchConfig &cobjSearchConfig;
    Global Rule &gobjRule;
    Local RuleBuilder &objRuleBuilder = create RuleBuilder();
     &cobjSearchConfig = create EOCF_CLF_RB:UI:SearchConfig();
    
    /*** Build Search page display **/
    /*** Add where clause to filter terms by scalar **/
    &cobjSearchConfig.AddCustomWhereClause(FetchSQL(SQL.EOCF_WHERECL_TMSCALAR), 0,
       "");
    &cobjSearchBuilder = create SearchBuilder(EOCF_ACTION_WRK.EOCF_CONTEXT_ID,
       &cobj SearchConfig);
    &cobjSearchBuilder.BuildDisplay();
    /*** Populate Rule info **/
    &objRuleBuilder.PopulateRuleInfo(&gobjRule); 
  • Insert a push button on the configuration page to transfer to this secondary page (for the purpose of choosing a term).

    Some of the terms on your configuration page may be configurable. Therefore, you must paste another subpage, EOCF_TERMCFG_SBP, on the configuration page for this purpose.

  • Insert the following page activate code on your action configuration page to initialize the term configuration subpage:

    import EOCF_CLF_RB:Definition:Rule:Rule
    import EOCF_CLF_RB:UI:*;
    import EOCF_CLF_RB:UI:ConfigBuilder;
    import EOCF_CLF_RB:Definition:RuleTermConfig;
    import EOCF_CLF_DL:Factory:DataLibraryFactory;
    import EOCF_CLF_DL:Definition:Term:TermDefn;
    import EOCF_CLF_DL:Utility:DLConstants;
    Local Rowset &rs_level0, &rsActionTypeDefn;
    Local number &bundleId, &actionId;
    Local number &actionTypeId;
    Local string &isTerminal, &isCombinable, &isConfigurable;
    Local string &aeTriggered, &appMsgTriggered, &ciTriggered, &piaTriggered;
    Local string &commit, &path, &id, &dtAppClassId, &appClsPath, &dtAppClsPath,
       &rtApp ClassId, &rtAppClsPath, &actTypeName, &actionName;
    Global EOCF_CLF_RB:Definition:Rule:Rule &gobjRule;
    Local EOCF_CLF_RB:UI:RuleBuilder &objRuleBuilder = create EOCF_CLF_RB:UI:
       Rule Builder();
    Local EOCF_CLF_RB:Definition:RuleTermConfig &objRuleTermConfig = create
       EOCF_CLF_RB: Definition:RuleTermConfig();
    Local EOCF_CLF_DL:Factory:DataLibraryFactory &objDlFactory = create
       EOCF_CLF_DL: Factory:DataLibraryFactory();
    Local EOCF_CLF_DL:Definition:Term:TermDefn &objTermDefn = create
       EOCF_CLF_DL: Definition:Term:TermDefn();
    Local EOCF_CLF_DL:Utility:DLConstants &objDLConstants = create EOCF_CLF_DL:
       Utility: DLConstants();
    /*********************************************************************/
    /* CREATE A CONFIG BUILDER TO CREATE UI ELEMENTS THAT ENABLE TERM    */
    /* CONFIGURATION-TO BE DONE ONLY BY ACTIONS THAT NEED TO ACCESS DATA */
    /* LIBRARY TERMS, AND THUS HAVE THE TERM-PICKER SCROLL AND THE TERM  */
    /* CONFIGURATION SUBPAGE ON THE PAGE */
    
    Local ConfigBuilder &objConfigBuilder;
    Local Rowset &rs1 = GetLevel0()(1).GetRowset(Scroll.EOCF_DS_ALT_TRM);
    &objConfigBuilder = create ConfigBuilder();
    &objConfigBuilder.InitDisplay();
    For &i = 1 To &rs1.ActiveRowCount
       &termId = &rs1(&i).EOCF_DS_ALT_TRM.EOCF_LIB_TERM_ID.Value;
       If All(&termId) Then
          If All(&rs1(&i).EOCF_DS_ALT_TRM.EOCF_CONFIG_ID.Value) Then
             /*******************************/
             &objRuleTermConfig = create EOCF_CLF_RB:Definition:RuleTermConfig();
             /*******************************/
             &objRuleTermConfig.EOCF_CONFIG_ID = &rs1(&i).EOCF_DS_ALT_TRM.
                EOCF_CONFIG_ ID.Value;
             &objRuleTermConfig.getConfiguredTerm( True);
             &rs1(&i).EOCF_DS_AL2_WRK.EOCF_GOTO_BTN.Label = &objRuleTermConfig.
                Get ConfigTermLabel(EOCF_ACTION_WRK.SETID.Value);
             &rs1(&i).EOCF_DS_AL2_WRK.EOCF_GOTO_BTN.Enabled = True;
          Else
             &objTermDefn = &objDlFactory.getTermDefn(&termId, False,
                &obj DLConstants.ALLOCATIONTYPE_READONLY);
             &rs1(&i).EOCF_DS_AL2_WRK.EOCF_GOTO_BTN.Label = &objTermDefn.
                EOCF_TERM_ LABEL;
             &rs1(&i).EOCF_DS_AL2_WRK.EOCF_GOTO_BTN.Enabled = False;
          End-If;
       Else
    /*************/
    &rs1(&i).EOCF_DS_AL2_WRK.EOCF_GOTO_BTN.Label = " ";
     &rs1(&i).EOCF_DS_AL2_WRK.EOCF_GOTO_BTN.Enabled = False;
       End-If;
    End-For;
    
    Local Grid &TERMGRID;
    Local GridColumn &TERMCOLUMN, &LOOKUPCOLUMN;
    
    &TERMGRID = GetGrid(Page.EOCF_DSPL_ALRT_CFG, "EOCF_DS_ALT_TRM");
    &TERMCOLUMN = &TERMGRID.GetColumn("EOCF_GOTO_BTN");
    &TERMCOLUMN.Label = " ";
    &LOOKUPCOLUMN = &TERMGRID.GetColumn("EOCF_CONFIGURE");
    &LOOKUPCOLUMN.Label = MsgGetText(18112, 2541, "Message not found - Get Term");
    /*********************************************************************/
    /*POPULATE RULE INFO - NEEDS TO BE DONE BY ALL CLF ACTIONS, i.e.,    */
    /*ACTIONS WHOSE CONFIG PAGES HAVE BEEN NAVIGATED TO VIA RULE BUILDER */
    
    &objRuleBuilder.PopulateRuleInfo(&gobjRule);
    /*********************************************************************/
    /* GET THIS ACTION'S ACTION TYPE NAME - TO BE DONE BY ALL ACTIONS */
    
    &rs_level0 = GetLevel0();
    &actionId = &rs_level0(1).EOCF_ACTION_WRK.EOCF_ACTION_ID.Value;
    &actionTypeId = &rs_level0(1).EOCF_ACTION_WRK.EOCF_ACTION_TYP_ID.Value;
    &actionName = &rs_level0(1).EOCF_ACTION_WRK.EOCF_ACTION_NAME.Value;
    
    /* Get details of Action Type */
    rem SQLExec(SQL.EOCF_ACTTYP_DTLS2_SEL, &actionTypeId, &actTypeName,
       &dtAppClassId, &dtAppClsPath, &rtAppClassId, &rtAppClsPath, &isTerminal,
       &isConfigurable, &is Combinable, &aeTriggered, &appMsgTriggered,
       &ciTriggered, &piaTriggered, &Commit Flag, &dtCommit, &descr);
    
    /***** Get details of Action Type ***/
    /**** Modified by SB to enable rel. language processing for action type name ***/
    
    &rsActionTypeDefn = CreateRowset(Record.EOCF_ACTN_TYPE);
    &numrows = &rsActionTypeDefn.Fill("WHERE EOCF_ACTION_TYP_ID = :1",
       &actionTypeId);
    
    If &numrows > 0 Then
       &actTypeName = &rsActionTypeDefn(1).GetRecord(1).EOCF_ACT_TYP_NAME.Value;
       &dtAppClassId = &rsActionTypeDefn(1).GetRecord(1).EOCF_DT_APPCLASSID.Value;
       &dtAppClsPath = &rsActionTypeDefn(1).GetRecord(1).EOCF_DT_APPCLSPATH.Value;
       &rtAppClassId = &rsActionTypeDefn(1).GetRecord(1).EOCF_RT_APPCLASSID.Value;
       &rtAppClsPath = &rsActionTypeDefn(1).GetRecord(1).EOCF_RT_APPCLSPATH.Value;
       &isTerminal = &rsActionTypeDefn(1).GetRecord(1).EOCF_IS_TERMINAL.Value;
       &isConfigurable = &rsActionTypeDefn(1).GetRecord(1).EOCF_IS_CFG_FLAG.Value;
       &isCombinable = &rsActionTypeDefn(1).GetRecord(1).EOCF_IS_CMBIN_FLAG.Value;
       &aeTriggered = &rsActionTypeDefn(1).GetRecord(1).EOCF_AE_TRIGGERED.Value;
       &appMsgTriggered = &rsActionTypeDefn(1).GetRecord(1).EOCF_APPMSG_TRIGGR.Value;
       &ciTriggered = &rsActionTypeDefn(1).GetRecord(1).EOCF_CI_TRIGGERED.Value;
       &piaTriggered = &rsActionTypeDefn(1).GetRecord(1).EOCF_PIA_TRIGGERED.Value;
       &CommitFlag = &rsActionTypeDefn(1).GetRecord(1).EOCF_COMMIT_FLAG.Value;
       &dtCommit = &rsActionTypeDefn(1).GetRecord(1).EOCF_DT_COMMIT.Value;
       &descr = &rsActionTypeDefn(1).GetRecord(1).DESCR.Value;
    End-If;
    
    /* Populate the ActionTypeName field for display */
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_ACT_TYP_NAME.Value = &actTypeName;
    
    /*********************************************************************/
    /* PLEASE DO THE FOLOWING IF YOU NEED THE DETAILS OF THE ACTION TYPE */
    /* THAT WERE ENTERED AT THE TIME OF ACTION TYPE Registration*/
    /*  This Display Alert action Does not need these details*/
    /*
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_DT_APPCLASSID.Value = &dtAppClassId;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_DT_APPCLSPATH.Value = &dtAppClsPath;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_RT_APPCLASSID.Value = &rtAppClassId;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_RT_APPCLSPATH.Value = &rtAppClsPath;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_IS_CFG_FLAG.Value = &isConfigurable;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_IS_CMBIN_FLAG.Value = &isCombinable;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_IS_TERMINAL.Value = &isTerminal;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_APPMSG_TRIGGR.Value = &appMsgTriggered;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_CI_TRIGGERED.Value = &ciTriggered;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_AE_TRIGGERED.Value = &aeTriggered;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_PIA_TRIGGERED.Value = &piaTriggered;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_COMMIT_FLAG.Value = &CommitFlag;
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_DT_COMMIT.Value = &dtCommit;
    &rs_level0(1).EOCF_DSTIME_WRK.DESCR.Value = &descr;
    */
    /*********************************************************************/
    /* PLEASE DO THE FOLLOWING IF  THE ACTION IS A COMBINABLE ONE AND YOU */
    /* NEED THE INFO REGARDING THE ACTION BUNDLE OF WHICH IT IS A PART    */
    /* This Display Alert Action , though combinable, does not need this  */
    /*
    SQLExec(SQL.EOCF_ACT_BUNDLE_SEL, &actionTypeId, &ActnBundleId);
    &rs_level0(1).EOCF_DSTIME_WRK.EOCF_ACT_BUNDLE_ID.Value = &ActnBundleId;*/
    /*********************************************************************/

Creating Design and Runtime Application Class Code

To create the design-time and runtime application class code:

  1. Create an application package named <your product code>_AAF_ACTIONS.

  2. Create a class in the package to be your design-time action application class.

    It must extend the EOCF_CLF_AF: ActionCfgBase and must implement the designAction() method.

    This class is responsible for transferring from the policy builder page to the action configuration page previously created.

    All relevant information regarding the rule and the context will be available to the configuration page.

    (See the EOCF_CLF_ACTIONS: DisplayAlertCfg as an example.)

  3. Create another class in the package to be your runtime application class.

    This class must extend EOCF_CLF_AF:ActionBase and must implement the runAction() method.

    This class is responsible for launching the action.

    In order to perform the action, all of the relevant information will be available.

    (See the EOCF_CLF_ACTIONS: DisplayAlert as an example.)

  4. Register the action type in the Register Action Type page.

    Specify the name of your new action type, the names of your design-time and runtime application classes, and other action type characteristics.

    Specify the trigger types and trigger points that may have policies using this action type.

    For example, you may want an action to be triggered during ComponentPostBuild trigger types, specifically the trigger point “When a Defect is Presented, in Quality Management.” After you complete these configuration steps, the action type is available for use.

  5. If an action type is combinable with other action types, register it in an action type bundle in addition to the other combinable action types.

    All display action types must be included in a single action type bundle.

  6. If your new action is configurable, click Configure on the page.

    This transfers you to the action configuration page for more specifications.

  7. Insert the subpage EOCF_DISPLAY_SUBPG in Level 0 on all pages that you want display-enabled.

    Note: This display subpage must not overlap any other field and no pop-up blockers should be running.