This document will show how to create new hiersel, hierload and new factories to table rootcause (rc).
On this example I'm using the rootcause categorys to request and incidents on detail_in.htmpl.
1º) Create 2 new columns on table rootcause (z_cr_flag and z_in_flag - INTEGER);
2º) Create 2 new factorys with .mod files just like below: <After install this files, you must restart the CA SDM services>
File: rc_cr.mod
OBJECT rc {
FACTORY rc_cr{
RESTRICT "z_cr_flag = 1 " { z_cr_flag=1};
STANDARD_LISTS {
MLIST OFF;
RLIST OFF;
SORT_BY "sym";
};
REL_ATTR persistent_id;
COMMON_NAME sym;
};
};
File: rc_in.mod
OBJECT rc {
FACTORY rc_cr{
RESTRICT "z_in_flag = 1 " { z_in_flag=1};
STANDARD_LISTS {
MLIST OFF;
RLIST OFF;
SORT_BY "sym";
};
REL_ATTR persistent_id;
COMMON_NAME sym;
};
};
3º) Create new files: hiersel_rc_cr.htmpl and hierload_rc_cr.htmpl ||| hiersel_rc_in.htmpl and hierload_rc_in.htmpl
<You can copy the default files of rc -- hiersel_rc.htmpl and hierload_rc.htmpl -- this files could be located at $NXROOT\bopcfg\www\htmpl\default >
After copy the files and rename them, put the new files at $NXROOT\site\mods\www\htmpl\default
You must change the factory on each one of them, effectly the change must be applied on this part of the code:
hiersel_rc_cr.htmpl and hierload_rc_cr.htmpl
<PDM_LIST PREFIX=list FACTORY=rc_cr WHERE="${args.KEEP.HierWc:}"
hiersel_rc_in.htmpl and hierload_rc_in.htmpl
<PDM_LIST PREFIX=list FACTORY=rc_in WHERE="${args.KEEP.HierWc:}"
4º) On detail_in.htmpl you must add the follow code to separate each factories:
<PDM_IF "$args.zType2" == "I">
<PDM_MACRO name=dtlHier hdr="Categoria de fechamento" attr=rootcause factory=rc_in autofill="no">
<PDM_ELIF "$args.zType2" == "R">
<PDM_MACRO name=dtlHier hdr="Categoria de fechamento" attr=rootcause factory=rc_cr autofill="no">
</PDM_IF>
zType2 is the attribute that controls the type of the ticket (Incident or Request).