use of org.wso2.carbon.humantask.TLiteral in project carbon-business-process by wso2.
the class LiteralBasedOrgEntityProvider method getOrganizationalEntities.
public List<OrganizationalEntityDAO> getOrganizationalEntities(PeopleQueryEvaluator peopleQueryEvaluator, TFrom tFrom, EvaluationContext evaluationContext) {
TLiteral literal = tFrom.getLiteral();
List<OrganizationalEntityDAO> orgEntityList = new ArrayList<OrganizationalEntityDAO>();
Element domNode = (Element) literal.getDomNode();
if (domNode != null) {
NodeList orgEntityNodes = domNode.getElementsByTagNameNS(HumanTaskConstants.organizationalEntityQname.getNamespaceURI(), HumanTaskConstants.organizationalEntityQname.getLocalPart());
// There should be only one organizational Entity
if (orgEntityNodes.getLength() == 1) {
Node orgEntityNode = orgEntityNodes.item(0);
addOrgEntitiesForOrganizationEntityNode(orgEntityNode, peopleQueryEvaluator, orgEntityList);
} else {
NodeList elements = domNode.getElementsByTagNameNS(HumanTaskConstants.userQname.getNamespaceURI(), HumanTaskConstants.userQname.getLocalPart());
if (elements.getLength() == 1) {
// There should only be one user element
CommonTaskUtil.addOrgEntityForUserNode(elements.item(0), peopleQueryEvaluator, orgEntityList);
}
}
}
return orgEntityList;
}