Java 类ims.admin.vo.BusinessRuleVoCollection 实例源码

项目:AvoinApotti    文件:Logic.java   
/**
 * Function used to populate the Business Rules collection from business
 * rules grid on ICP Stage tab
 * 
 * @return
 */
private BusinessRuleVoCollection getICPStageRules()
{
    // Create a new rule collection
    BusinessRuleVoCollection rules = new BusinessRuleVoCollection();

    // Iterate rules grid rows
    for (int i = 0; i < form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().size(); i++)
    {
        BusinessRuleVo rule = form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().get(i).getValue();

        // Skip null rules
        if (rule == null)
            continue;

        // Add rule to collection
        rules.add(rule);
    }

    // Return populated rule collection
    return rules;
}
项目:AvoinApotti    文件:Logic.java   
/**
 * Function used to populate the Business Rules collection from business
 * rules grid on ICP Phase tab
 * 
 * @return
 */
private BusinessRuleVoCollection getICPPhaseRules()
{
    // Create a new rule collection
    BusinessRuleVoCollection rules = new BusinessRuleVoCollection();

    // Iterate rules grid rows
    for (int i = 0; i < form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().size(); i++)
    {
        BusinessRuleVo rule = form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().get(i).getValue();

        // Skip null rules
        if (rule == null)
            continue;

        // Add rule to collection
        rules.add(rule);
    }

    // Return populated rule collection
    return rules;
}
项目:AvoinApotti    文件:Logic.java   
/**
 * 
 */
public void open() throws PresentationLogicException
{
    //WDEV-18211 
    form.dyngrdRules().getRows().clear();

    // Set IsModified to false (local context) WDEV-18211 moved here
    form.getLocalContext().setIsModified(false);

    // Load the rules list
    BusinessRuleVoCollection ruleList = domain.list(form.cmbEntity().getValue());

    if (form.cmbEntity().getValue() != null && (ruleList == null || ruleList.size() == 0))
    {
        engine.showMessage("No rules were found for the selected Data Entity");
        updateContextMenuState();
        return;
    }
    setRuleList(ruleList);

    // Keep previous selection
    form.dyngrdRules().setValue(form.getLocalContext().getSelectedRule());
    //WDEV-18211 
    form.setMode(FormMode.VIEW);
}
项目:AvoinApotti    文件:Logic.java   
/**
 * 
 */
private BusinessRuleVoCollection getRuleList()
{
    if (form.dyngrdRules().getRows().size() == 0)
        return null;

    BusinessRuleVoCollection ruleList = new BusinessRuleVoCollection();

    for (int i = 0; i < form.dyngrdRules().getRows().size(); i++)
    {
        DynamicGridRow row = form.dyngrdRules().getRows().get(i);

        if (row.getValue() instanceof BusinessRuleVo)
        {
            BusinessRuleVo rule = (BusinessRuleVo) row.getValue();
            ruleList.add(rule);
        }
    }

    return ruleList;
}
项目:AvoinApotti    文件:Logic.java   
/**
 * 
 */
private void setRuleList(BusinessRuleVoCollection list)
{
    // Clear the rules list
    form.dyngrdRules().getRows().clear();

    if (list == null)
        return;

    for (int i = 0; i < list.size(); i++)
    {
        BusinessRuleVo rule = list.get(i);

        // Add non nulls elements to the grid
        if (rule != null)
        {
            setRuleListRow(form.dyngrdRules().getRows().newRow(), rule);
        }
    }
}
项目:AvoinApotti    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
    if (entity == null)
        return null;

    DomainFactory factory = getDomainFactory();
    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
    criteria.equal("this.rootEntity", entity.getId());
    criteria.equal("this.active", true);

    List rules = criteria.find();
    Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
项目:AvoinApotti    文件:RulesListImpl.java   
public BusinessRuleVoCollection listRules(Boolean activeOnly, String name, String entityID) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);

    if (activeOnly)
    {
        criteria.equal("this.active", true);
    }

    if (name != null && name.length() > 0)
    {
        criteria.like("this.name", "%" + name + "%");
    }

    if (entityID != null)
    {
        criteria.equal("this.rootEntity", entityID);
    }

    List list = criteria.find();
    Collections.sort(list, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(list);
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Function used to populate the Business Rules collection from business
 * rules grid on ICP Stage tab
 * 
 * @return
 */
private BusinessRuleVoCollection getICPStageRules()
{
    // Create a new rule collection
    BusinessRuleVoCollection rules = new BusinessRuleVoCollection();

    // Iterate rules grid rows
    for (int i = 0; i < form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().size(); i++)
    {
        BusinessRuleVo rule = form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().get(i).getValue();

        // Skip null rules
        if (rule == null)
            continue;

        // Add rule to collection
        rules.add(rule);
    }

    // Return populated rule collection
    return rules;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Function used to populate the Business Rules collection from business
 * rules grid on ICP Phase tab
 * 
 * @return
 */
private BusinessRuleVoCollection getICPPhaseRules()
{
    // Create a new rule collection
    BusinessRuleVoCollection rules = new BusinessRuleVoCollection();

    // Iterate rules grid rows
    for (int i = 0; i < form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().size(); i++)
    {
        BusinessRuleVo rule = form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().get(i).getValue();

        // Skip null rules
        if (rule == null)
            continue;

        // Add rule to collection
        rules.add(rule);
    }

    // Return populated rule collection
    return rules;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * 
 */
public void open() throws PresentationLogicException
{
    //WDEV-18211 
    form.dyngrdRules().getRows().clear();

    // Set IsModified to false (local context) WDEV-18211 moved here
    form.getLocalContext().setIsModified(false);

    // Load the rules list
    BusinessRuleVoCollection ruleList = domain.list(form.cmbEntity().getValue());

    if (form.cmbEntity().getValue() != null && (ruleList == null || ruleList.size() == 0))
    {
        engine.showMessage("No rules were found for the selected Data Entity");
        updateContextMenuState();
        return;
    }
    setRuleList(ruleList);

    // Keep previous selection
    form.dyngrdRules().setValue(form.getLocalContext().getSelectedRule());
    //WDEV-18211 
    form.setMode(FormMode.VIEW);
}
项目:openMAXIMS    文件:Logic.java   
/**
 * 
 */
private BusinessRuleVoCollection getRuleList()
{
    if (form.dyngrdRules().getRows().size() == 0)
        return null;

    BusinessRuleVoCollection ruleList = new BusinessRuleVoCollection();

    for (int i = 0; i < form.dyngrdRules().getRows().size(); i++)
    {
        DynamicGridRow row = form.dyngrdRules().getRows().get(i);

        if (row.getValue() instanceof BusinessRuleVo)
        {
            BusinessRuleVo rule = (BusinessRuleVo) row.getValue();
            ruleList.add(rule);
        }
    }

    return ruleList;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * 
 */
private void setRuleList(BusinessRuleVoCollection list)
{
    // Clear the rules list
    form.dyngrdRules().getRows().clear();

    if (list == null)
        return;

    for (int i = 0; i < list.size(); i++)
    {
        BusinessRuleVo rule = list.get(i);

        // Add non nulls elements to the grid
        if (rule != null)
        {
            setRuleListRow(form.dyngrdRules().getRows().newRow(), rule);
        }
    }
}
项目:openMAXIMS    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
    if (entity == null)
        return null;

    DomainFactory factory = getDomainFactory();
    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
    criteria.equal("this.rootEntity", entity.getId());
    criteria.equal("this.active", true);

    List rules = criteria.find();
    Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
项目:openMAXIMS    文件:RulesListImpl.java   
public BusinessRuleVoCollection listRules(Boolean activeOnly, String name, String entityID) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);

    if (activeOnly)
    {
        criteria.equal("this.active", true);
    }

    if (name != null && name.length() > 0)
    {
        criteria.like("this.name", "%" + name + "%");
    }

    if (entityID != null)
    {
        criteria.equal("this.rootEntity", entityID);
    }

    List list = criteria.find();
    Collections.sort(list, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(list);
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Function used to populate the Business Rules collection from business
 * rules grid on ICP Stage tab
 * 
 * @return
 */
private BusinessRuleVoCollection getICPStageRules()
{
    // Create a new rule collection
    BusinessRuleVoCollection rules = new BusinessRuleVoCollection();

    // Iterate rules grid rows
    for (int i = 0; i < form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().size(); i++)
    {
        BusinessRuleVo rule = form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().get(i).getValue();

        // Skip null rules
        if (rule == null)
            continue;

        // Add rule to collection
        rules.add(rule);
    }

    // Return populated rule collection
    return rules;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Function used to populate the Business Rules collection from business
 * rules grid on ICP Phase tab
 * 
 * @return
 */
private BusinessRuleVoCollection getICPPhaseRules()
{
    // Create a new rule collection
    BusinessRuleVoCollection rules = new BusinessRuleVoCollection();

    // Iterate rules grid rows
    for (int i = 0; i < form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().size(); i++)
    {
        BusinessRuleVo rule = form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().get(i).getValue();

        // Skip null rules
        if (rule == null)
            continue;

        // Add rule to collection
        rules.add(rule);
    }

    // Return populated rule collection
    return rules;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * 
 */
public void open() throws PresentationLogicException
{
    //WDEV-18211 
    form.dyngrdRules().getRows().clear();

    // Set IsModified to false (local context) WDEV-18211 moved here
    form.getLocalContext().setIsModified(false);

    // Load the rules list
    BusinessRuleVoCollection ruleList = domain.list(form.cmbEntity().getValue());

    if (form.cmbEntity().getValue() != null && (ruleList == null || ruleList.size() == 0))
    {
        engine.showMessage("No rules were found for the selected Data Entity");
        updateContextMenuState();
        return;
    }
    setRuleList(ruleList);

    // Keep previous selection
    form.dyngrdRules().setValue(form.getLocalContext().getSelectedRule());
    //WDEV-18211 
    form.setMode(FormMode.VIEW);
}
项目:openMAXIMS    文件:Logic.java   
/**
 * 
 */
private BusinessRuleVoCollection getRuleList()
{
    if (form.dyngrdRules().getRows().size() == 0)
        return null;

    BusinessRuleVoCollection ruleList = new BusinessRuleVoCollection();

    for (int i = 0; i < form.dyngrdRules().getRows().size(); i++)
    {
        DynamicGridRow row = form.dyngrdRules().getRows().get(i);

        if (row.getValue() instanceof BusinessRuleVo)
        {
            BusinessRuleVo rule = (BusinessRuleVo) row.getValue();
            ruleList.add(rule);
        }
    }

    return ruleList;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * 
 */
private void setRuleList(BusinessRuleVoCollection list)
{
    // Clear the rules list
    form.dyngrdRules().getRows().clear();

    if (list == null)
        return;

    for (int i = 0; i < list.size(); i++)
    {
        BusinessRuleVo rule = list.get(i);

        // Add non nulls elements to the grid
        if (rule != null)
        {
            setRuleListRow(form.dyngrdRules().getRows().newRow(), rule);
        }
    }
}
项目:openMAXIMS    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
    if (entity == null)
        return null;

    DomainFactory factory = getDomainFactory();
    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
    criteria.equal("this.rootEntity", entity.getId());
    criteria.equal("this.active", true);

    List rules = criteria.find();
    Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
项目:openMAXIMS    文件:RulesListImpl.java   
public BusinessRuleVoCollection listRules(Boolean activeOnly, String name, String entityID) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);

    if (activeOnly)
    {
        criteria.equal("this.active", true);
    }

    if (name != null && name.length() > 0)
    {
        criteria.like("this.name", "%" + name + "%");
    }

    if (entityID != null)
    {
        criteria.equal("this.rootEntity", entityID);
    }

    List list = criteria.find();
    Collections.sort(list, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(list);
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * Function used to populate the Business Rules collection from business
 * rules grid on ICP Stage tab
 * 
 * @return
 */
private BusinessRuleVoCollection getICPStageRules()
{
    // Create a new rule collection
    BusinessRuleVoCollection rules = new BusinessRuleVoCollection();

    // Iterate rules grid rows
    for (int i = 0; i < form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().size(); i++)
    {
        BusinessRuleVo rule = form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().get(i).getValue();

        // Skip null rules
        if (rule == null)
            continue;

        // Add rule to collection
        rules.add(rule);
    }

    // Return populated rule collection
    return rules;
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * Function used to populate the Business Rules collection from business
 * rules grid on ICP Phase tab
 * 
 * @return
 */
private BusinessRuleVoCollection getICPPhaseRules()
{
    // Create a new rule collection
    BusinessRuleVoCollection rules = new BusinessRuleVoCollection();

    // Iterate rules grid rows
    for (int i = 0; i < form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().size(); i++)
    {
        BusinessRuleVo rule = form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().get(i).getValue();

        // Skip null rules
        if (rule == null)
            continue;

        // Add rule to collection
        rules.add(rule);
    }

    // Return populated rule collection
    return rules;
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * 
 */
public void open() throws PresentationLogicException
{
    //WDEV-18211 
    form.dyngrdRules().getRows().clear();

    // Set IsModified to false (local context) WDEV-18211 moved here
    form.getLocalContext().setIsModified(false);

    // Load the rules list
    BusinessRuleVoCollection ruleList = domain.list(form.cmbEntity().getValue());

    if (form.cmbEntity().getValue() != null && (ruleList == null || ruleList.size() == 0))
    {
        engine.showMessage("No rules were found for the selected Data Entity");
        updateContextMenuState();
        return;
    }
    setRuleList(ruleList);

    // Keep previous selection
    form.dyngrdRules().setValue(form.getLocalContext().getSelectedRule());
    //WDEV-18211 
    form.setMode(FormMode.VIEW);
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * 
 */
private BusinessRuleVoCollection getRuleList()
{
    if (form.dyngrdRules().getRows().size() == 0)
        return null;

    BusinessRuleVoCollection ruleList = new BusinessRuleVoCollection();

    for (int i = 0; i < form.dyngrdRules().getRows().size(); i++)
    {
        DynamicGridRow row = form.dyngrdRules().getRows().get(i);

        if (row.getValue() instanceof BusinessRuleVo)
        {
            BusinessRuleVo rule = (BusinessRuleVo) row.getValue();
            ruleList.add(rule);
        }
    }

    return ruleList;
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * 
 */
private void setRuleList(BusinessRuleVoCollection list)
{
    // Clear the rules list
    form.dyngrdRules().getRows().clear();

    if (list == null)
        return;

    for (int i = 0; i < list.size(); i++)
    {
        BusinessRuleVo rule = list.get(i);

        // Add non nulls elements to the grid
        if (rule != null)
        {
            setRuleListRow(form.dyngrdRules().getRows().newRow(), rule);
        }
    }
}
项目:openmaxims-linux    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
    if (entity == null)
        return null;

    DomainFactory factory = getDomainFactory();
    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
    criteria.equal("this.rootEntity", entity.getId());
    criteria.equal("this.active", true);

    List rules = criteria.find();
    Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
项目:openmaxims-linux    文件:RulesListImpl.java   
public BusinessRuleVoCollection listRules(Boolean activeOnly, String name, String entityID) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);

    if (activeOnly)
    {
        criteria.equal("this.active", true);
    }

    if (name != null && name.length() > 0)
    {
        criteria.like("this.name", "%" + name + "%");
    }

    if (entityID != null)
    {
        criteria.equal("this.rootEntity", entityID);
    }

    List list = criteria.find();
    Collections.sort(list, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(list);
}
项目:AvoinApotti    文件:Logic.java   
/**
 * Function used to populate rules for an ICP Stage configuration
 * 
 * @param rules
 *            - Business Rules collection used for populating ICP Stage
 *            rules grid
 */
private void setICPStageRules(BusinessRuleVoCollection rules)
{
    // Clear rules grid
    form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().clear();

    // Terminate function if rules collection is null
    if (rules == null)
        return;

    for (BusinessRuleVo rule : rules)
    {
        // Skip rule if null
        if (rule == null)
            continue;

        // Create a new row
        grdStageRulesRow newRow = form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().newRow();

        // Fill new row columns cells
        newRow.setcolName(rule.getName());
        newRow.setcolDescription(rule.getDescription());
        newRow.setcolCategory(rule.getCategory());
        newRow.setcolActive(rule.getActive());

        // Set row value
        newRow.setValue(rule);
    }
}
项目:AvoinApotti    文件:Logic.java   
/**
 * Function used to populate rules for an ICP Phase configuration
 * 
 * @param rules
 *            - Business Rules collection used for populating ICP Phase
 *            rules grid
 */
private void setICPPhaseRules(BusinessRuleVoCollection rules)
{
    // Clear rules grid
    form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().clear();

    // Terminate function if rule collection is null
    if (rules == null)
        return;

    // Iterate rule collection
    for (BusinessRuleVo rule : rules)
    {
        // Skip null rules
        if (rule == null)
            continue;

        // Create a new row
        grdPhaseRulesRow newRow = form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().newRow();

        // Fill new row columns cells
        newRow.setcolName(rule.getName());
        newRow.setcolDescription(rule.getDescription());
        newRow.setcolCategory(rule.getCategory());
        newRow.setcolActive(rule.getActive());

        // Set row value
        newRow.setValue(rule);
    }
}
项目:AvoinApotti    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection save(BusinessRuleVoCollection rules) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException
{
    if (rules == null)
        throw new CodingRuntimeException("Major Logical Error - Rules collection must not be null");

    DomainFactory factory = getDomainFactory();

    for (int i = 0; i < rules.size(); i++)
    {
        BusinessRuleVo rule = rules.get(i);
        BusinessRule domRule = BusinessRuleVoAssembler.extractBusinessRule(factory, rule);          

        if (rule.getXmlContent() == null)
            throw new CodingRuntimeException("Major Logical Error - XML Content cannot be null");

        String xml;
        try {
            IRule iRule = RuleXmlSerialization.deserializeFromXml(rule.getXmlContent(), Entities.getInstance());
            iRule.setPriority(rule.getPriority());
            xml = RuleXmlSerialization.serialize(iRule);
            domRule.setXmlContent(xml);
            factory.save(domRule);
        }
        catch (Exception e) 
        {
            throw new DomainInterfaceException(e.getMessage());             
        }               
    }

    // Return null
    return null;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Function used to populate rules for an ICP Stage configuration
 * 
 * @param rules
 *            - Business Rules collection used for populating ICP Stage
 *            rules grid
 */
private void setICPStageRules(BusinessRuleVoCollection rules)
{
    // Clear rules grid
    form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().clear();

    // Terminate function if rules collection is null
    if (rules == null)
        return;

    for (BusinessRuleVo rule : rules)
    {
        // Skip rule if null
        if (rule == null)
            continue;

        // Create a new row
        grdStageRulesRow newRow = form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().newRow();

        // Fill new row columns cells
        newRow.setcolName(rule.getName());
        newRow.setcolDescription(rule.getDescription());
        newRow.setcolCategory(rule.getCategory());
        newRow.setcolActive(rule.getActive());

        // Set row value
        newRow.setValue(rule);
    }
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Function used to populate rules for an ICP Phase configuration
 * 
 * @param rules
 *            - Business Rules collection used for populating ICP Phase
 *            rules grid
 */
private void setICPPhaseRules(BusinessRuleVoCollection rules)
{
    // Clear rules grid
    form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().clear();

    // Terminate function if rule collection is null
    if (rules == null)
        return;

    // Iterate rule collection
    for (BusinessRuleVo rule : rules)
    {
        // Skip null rules
        if (rule == null)
            continue;

        // Create a new row
        grdPhaseRulesRow newRow = form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().newRow();

        // Fill new row columns cells
        newRow.setcolName(rule.getName());
        newRow.setcolDescription(rule.getDescription());
        newRow.setcolCategory(rule.getCategory());
        newRow.setcolActive(rule.getActive());

        // Set row value
        newRow.setValue(rule);
    }
}
项目:openMAXIMS    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection save(BusinessRuleVoCollection rules) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException
{
    if (rules == null)
        throw new CodingRuntimeException("Major Logical Error - Rules collection must not be null");

    DomainFactory factory = getDomainFactory();

    for (int i = 0; i < rules.size(); i++)
    {
        BusinessRuleVo rule = rules.get(i);
        BusinessRule domRule = BusinessRuleVoAssembler.extractBusinessRule(factory, rule);          

        if (rule.getXmlContent() == null)
            throw new CodingRuntimeException("Major Logical Error - XML Content cannot be null");

        String xml;
        try {
            IRule iRule = RuleXmlSerialization.deserializeFromXml(rule.getXmlContent(), Entities.getInstance());
            iRule.setPriority(rule.getPriority());
            xml = RuleXmlSerialization.serialize(iRule);
            domRule.setXmlContent(xml);
            factory.save(domRule);
        }
        catch (Exception e) 
        {
            throw new DomainInterfaceException(e.getMessage());             
        }               
    }

    // Return null
    return null;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Function used to populate rules for an ICP Stage configuration
 * 
 * @param rules
 *            - Business Rules collection used for populating ICP Stage
 *            rules grid
 */
private void setICPStageRules(BusinessRuleVoCollection rules)
{
    // Clear rules grid
    form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().clear();

    // Terminate function if rules collection is null
    if (rules == null)
        return;

    for (BusinessRuleVo rule : rules)
    {
        // Skip rule if null
        if (rule == null)
            continue;

        // Create a new row
        grdStageRulesRow newRow = form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().newRow();

        // Fill new row columns cells
        newRow.setcolName(rule.getName());
        newRow.setcolDescription(rule.getDescription());
        newRow.setcolCategory(rule.getCategory());
        newRow.setcolActive(rule.getActive());

        // Set row value
        newRow.setValue(rule);
    }
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Function used to populate rules for an ICP Phase configuration
 * 
 * @param rules
 *            - Business Rules collection used for populating ICP Phase
 *            rules grid
 */
private void setICPPhaseRules(BusinessRuleVoCollection rules)
{
    // Clear rules grid
    form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().clear();

    // Terminate function if rule collection is null
    if (rules == null)
        return;

    // Iterate rule collection
    for (BusinessRuleVo rule : rules)
    {
        // Skip null rules
        if (rule == null)
            continue;

        // Create a new row
        grdPhaseRulesRow newRow = form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().newRow();

        // Fill new row columns cells
        newRow.setcolName(rule.getName());
        newRow.setcolDescription(rule.getDescription());
        newRow.setcolCategory(rule.getCategory());
        newRow.setcolActive(rule.getActive());

        // Set row value
        newRow.setValue(rule);
    }
}
项目:openMAXIMS    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection save(BusinessRuleVoCollection rules) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException
{
    if (rules == null)
        throw new CodingRuntimeException("Major Logical Error - Rules collection must not be null");

    DomainFactory factory = getDomainFactory();

    for (int i = 0; i < rules.size(); i++)
    {
        BusinessRuleVo rule = rules.get(i);
        BusinessRule domRule = BusinessRuleVoAssembler.extractBusinessRule(factory, rule);          

        if (rule.getXmlContent() == null)
            throw new CodingRuntimeException("Major Logical Error - XML Content cannot be null");

        String xml;
        try {
            IRule iRule = RuleXmlSerialization.deserializeFromXml(rule.getXmlContent(), Entities.getInstance());
            iRule.setPriority(rule.getPriority());
            xml = RuleXmlSerialization.serialize(iRule);
            domRule.setXmlContent(xml);
            factory.save(domRule);
        }
        catch (Exception e) 
        {
            throw new DomainInterfaceException(e.getMessage());             
        }               
    }

    // Return null
    return null;
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * Function used to populate rules for an ICP Stage configuration
 * 
 * @param rules
 *            - Business Rules collection used for populating ICP Stage
 *            rules grid
 */
private void setICPStageRules(BusinessRuleVoCollection rules)
{
    // Clear rules grid
    form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().clear();

    // Terminate function if rules collection is null
    if (rules == null)
        return;

    for (BusinessRuleVo rule : rules)
    {
        // Skip rule if null
        if (rule == null)
            continue;

        // Create a new row
        grdStageRulesRow newRow = form.ctnConfiguration().lyrICPTabs().Stage().grdStageRules().getRows().newRow();

        // Fill new row columns cells
        newRow.setcolName(rule.getName());
        newRow.setcolDescription(rule.getDescription());
        newRow.setcolCategory(rule.getCategory());
        newRow.setcolActive(rule.getActive());

        // Set row value
        newRow.setValue(rule);
    }
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * Function used to populate rules for an ICP Phase configuration
 * 
 * @param rules
 *            - Business Rules collection used for populating ICP Phase
 *            rules grid
 */
private void setICPPhaseRules(BusinessRuleVoCollection rules)
{
    // Clear rules grid
    form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().clear();

    // Terminate function if rule collection is null
    if (rules == null)
        return;

    // Iterate rule collection
    for (BusinessRuleVo rule : rules)
    {
        // Skip null rules
        if (rule == null)
            continue;

        // Create a new row
        grdPhaseRulesRow newRow = form.ctnConfiguration().lyrICPTabs().Phase().grdPhaseRules().getRows().newRow();

        // Fill new row columns cells
        newRow.setcolName(rule.getName());
        newRow.setcolDescription(rule.getDescription());
        newRow.setcolCategory(rule.getCategory());
        newRow.setcolActive(rule.getActive());

        // Set row value
        newRow.setValue(rule);
    }
}
项目:openmaxims-linux    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection save(BusinessRuleVoCollection rules) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException
{
    if (rules == null)
        throw new CodingRuntimeException("Major Logical Error - Rules collection must not be null");

    DomainFactory factory = getDomainFactory();

    for (int i = 0; i < rules.size(); i++)
    {
        BusinessRuleVo rule = rules.get(i);
        BusinessRule domRule = BusinessRuleVoAssembler.extractBusinessRule(factory, rule);          

        if (rule.getXmlContent() == null)
            throw new CodingRuntimeException("Major Logical Error - XML Content cannot be null");

        String xml;
        try {
            IRule iRule = RuleXmlSerialization.deserializeFromXml(rule.getXmlContent(), Entities.getInstance());
            iRule.setPriority(rule.getPriority());
            xml = RuleXmlSerialization.serialize(iRule);
            domRule.setXmlContent(xml);
            factory.save(domRule);
        }
        catch (Exception e) 
        {
            throw new DomainInterfaceException(e.getMessage());             
        }               
    }

    // Return null
    return null;
}