if (!checkListItems.containsKey(currentStateName)
&& (node.getAttributeValue(new QName("name")).equals("checkItems"))) {
List<CheckItemBean> items = new ArrayList<CheckItemBean>();
Iterator checkItemIterator = node.getChildElements();
while (checkItemIterator.hasNext()) {
CheckItemBean checkItemBean = new CheckItemBean();
OMElement childElement = (OMElement) checkItemIterator.next();
//setting the check item name
checkItemBean.setName(childElement.getAttributeValue(new QName("name")));
//setting the transactionList
if ((childElement.getAttributeValue(new QName("forEvent"))) != null) {
checkItemBean.setEvents(Arrays.asList((childElement
.getAttributeValue(new QName("forEvent"))).split(",")));
}
Iterator permissionElementIterator = childElement
.getChildrenWithName(new QName("permissions"));
while (permissionElementIterator.hasNext()) {
OMElement permissionElement = (OMElement) permissionElementIterator.next();
Iterator permissions = permissionElement.getChildElements();
List<PermissionsBean> premBeanList = new ArrayList<PermissionsBean>();
while (permissions.hasNext()) {
OMElement premChild = (OMElement) permissions.next();
premBeanList.add(createPermissionBean(premChild));
}
checkItemBean.setPermissionsBeans(premBeanList);
}
Iterator validationsElementIterator = childElement.getChildrenWithName(new QName("validations"));
while (validationsElementIterator.hasNext()) {
//setting the validation bean
OMElement validationElement = (OMElement) validationsElementIterator.next();
Iterator validations = validationElement.getChildElements();
List<ValidationsBean> validationsBeanList = new ArrayList<ValidationsBean>();
while (validations.hasNext()) {
//this loop is to iterate the validation elements
OMElement valiChild = (OMElement) validations.next();
validationsBeanList.add(createValidationsBean(valiChild));
}
checkItemBean.setValidationBeans(validationsBeanList);
}
items.add(checkItemBean);
}
if (items.size() > 0) {
checkListItems.put(currentStateName, items);