This allows additional error reporting by returning an error message.
Add Issue screen
public String ucAddPreInsert ( Problem pProblem, // the problem or case ArrayList pReleases, // the list of releases ArrayList pModules, // the list of modules ArrayList pUdfs, // the list of UDF's SesameSession session, // current session ProblemFormParam pfp) // values of from the form
This is called during the Add process before any updates are performed, and allows a final manipulation of parameters prior to attempting the add operation.
There is a point to explain about the form parameters which are passed into this method, and that you can manipulate these parameters to stop the display of the new issue verification screen. Add the following line into this method:
values.put("ADD_CONFIRM_PAGE", "NO");
This will cause the new issue verification screen to be suppressed.
This example shows how ucAddPreInsert is called before any updates to a record are made. Based upon the customer requirements, if the record is in the "Test Case" or "Test Plan" area and project, the issue is not saved upon the add operation, and an error message is displayed.
public String ucAddPreInsert ( Problem pProblem, // the problem or case ArrayList pReleases, // the list of releases ArrayList pModules, // the list of modules ArrayList pUdfs, // the list of UDF's SesameSession session, // current session ProblemFormParam pfp) // values of from the form { String errText = rules.ucAddPreInsert(item, releases, modules, udfs, session, values); if (errText != null) { return errText; } // If we are in the test case area or test plan project, // do not allow issue to be saved if (A_TEST_CASES.equals(values.get("AREA")) && (A_TEST_CASES + "|" + A_TEST_PLAN_PROJECT_ID).equals(values.get("PROJECT"))) { return Z.m.msg(session, "You cannot save a test plan as an issue. " + "Use this screen to generate a test plan from test cases you select."); } return null; }