package com.fp.dto.rules;

import java.io.Serializable;

import com.fp.dto.Request;

public abstract class AbstractRule implements Serializable {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    public abstract Request execute(Request pRequest) throws Exception;

    protected String rule;

    /**
     * Entrega el valor de rule
     * 
     * @return Valor de rule
     */
    public String getRule() {
        return this.rule;
    }

    /**
     * Fija un nuevo valor en rule
     * 
     * @param rule nuevo valor para rule
     */
    public void setRule(String rule) {
        this.rule = rule;
    }

    /**
     * Entrega el valor de flow
     * 
     * @return Valor de flow
     */
    public String getFlow() {
        return this.flow;
    }

    /**
     * Fija un nuevo valor en flow
     * 
     * @param flow nuevo valor para flow
     */
    public void setFlow(String flow) {
        this.flow = flow;
    }

    protected String flow;
    

	protected boolean isNew(Request pRequest) throws Exception {
        return ("" + pRequest.get("isnew")).compareTo("Y") == 0;
    }
}
