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;*/ /*********************************************************************/