Пример #1
0
  public void addValue(ActionEvent event) {

    this.collect();

    for (LogicNodeValueEntity value : this.listNodeOperationValue) {
      if (value.getOrderNum().equals(this.nodeOperationValue.getOrderNum())) {
        FacesMessage msg =
            new FacesMessage(
                FacesMessage.SEVERITY_ERROR,
                "Logic Node Operaton - Value",
                "Order Number(" + this.nodeOperationValue.getOrderNum() + ") already exists!");
        FacesContext.getCurrentInstance().addMessage(null, msg);
        return;
      }
    }

    if (this.nodeOperationValue.getResultService().equals(0)) {
      if (this.nodeOperationValue.getResultContext() == null
          || this.nodeOperationValue.getResultContext().length() == 0) {
        FacesMessage msg =
            new FacesMessage(
                FacesMessage.SEVERITY_ERROR,
                "Logic Node Operaton - Value",
                "You must inform the context, ex: call.ani");
        FacesContext.getCurrentInstance().addMessage(null, msg);
        return;
      }
    }

    if (this.nodeOperationValue.getValue1() == null
        || this.nodeOperationValue.getValue1().length() == 0) {
      FacesMessage msg =
          new FacesMessage(
              FacesMessage.SEVERITY_ERROR,
              "Logic Node Operation - Value",
              "Please, inform Value1!");
      FacesContext.getCurrentInstance().addMessage(null, msg);
      return;
    }
    if (!(this.nodeOperationValue.getOperation().equals("=")
            || this.nodeOperationValue.getOperation().equals("<")
            || this.nodeOperationValue.getOperation().equals(">"))
        && (this.nodeOperationValue.getValue2() == null
            || this.nodeOperationValue.getValue2().length() == 0)) {
      FacesMessage msg =
          new FacesMessage(
              FacesMessage.SEVERITY_ERROR,
              "Logic Node Operation - Value",
              "Please, inform Value2!");
      FacesContext.getCurrentInstance().addMessage(null, msg);
      return;
    }
    this.nodeOperationValue.setId(Util.getUID());
    this.listNodeOperationValue.add(this.nodeOperationValue);

    this.nodeOperationValue = new LogicNodeValueEntity();
  }
Пример #2
0
  public void init() {
    this.nodeOperation = new LogicNodeOperationEntity();
    this.nodeOperation.setId(Util.getUID());
    this.nodeOperationValue = new LogicNodeValueEntity();

    this.listNodeOperationValue = new ArrayList<LogicNodeValueEntity>();

    this.insert = true;

    this.logicNodeBean = null;
    operationId = "";
  }