} else {
description.clearFacts();
description.clearResults();
}
NameSpacesFactory nameSpacesFactory = NameSpacesFactory.getInstance();
String factCountParameter = request.getParameter("factCount");
if (factCountParameter != null && !"".equals(factCountParameter)) {
int factCount = 0;
try {
factCount = Integer.parseInt(factCountParameter.trim());
for (int i = 0; i < factCount; i++) {
String name = request.getParameter("factName" + i);
String type = request.getParameter("factType" + i);
if (type != null && !"".equals(type)) {
ResourceDescription resourceDescription = new ResourceDescription();
description.addFactDescription(resourceDescription);
resourceDescription.addNameSpaces(
nameSpacesFactory.createNameSpaces("factValue" + i,
operationName, request.getSession()));
resourceDescription.setType(type.trim());
if (name != null && !"".equals(name)) {
resourceDescription.setName(name.trim());
}
}
}
} catch (NumberFormatException ignored) {
}
}
String wrapperName = request.getParameter("wrapperName");
if (wrapperName == null || "".equals(wrapperName)) {
wrapperName = RuleConstants.DEFAULT_WRAPPER_NAME;
}
ResourceDescription wrapperDescription = new ResourceDescription();
wrapperDescription.setType(OMElementResourceAdapter.TYPE);
wrapperDescription.setName(wrapperName);
String resultCountParameter = request.getParameter("resultCount");
if (resultCountParameter != null && !"".equals(resultCountParameter)) {
int resultCount = 0;
try {
resultCount = Integer.parseInt(resultCountParameter.trim());
for (int i = 0; i < resultCount; i++) {
String name = request.getParameter("resultName" + i);
String type = request.getParameter("resultType" + i);
if (type != null && !"".equals(type)) {
ResourceDescription resourceDescription = new ResourceDescription();
wrapperDescription.addChildResource(resourceDescription);
resourceDescription.addNameSpaces(
nameSpacesFactory.createNameSpaces("resultValue" + i,
operationName, request.getSession()));
resourceDescription.setType(type.trim());
if (name != null && !"".equals(name)) {
resourceDescription.setName(name.trim());
}