Hi all,
I am hoping someone here can help me figure this one out. I am building a web application that requires multiple branching- or control flow statements.This app takes a condition and then skips the selected page if those conditions are met. What I need now is to be able to take multiple conditions- from multiple answers- and target the same page.
The code is below:
public class BranchingRule extends AbstractIdentified
{
private String formId;
/** @dbmap.field name=PBPBTP */
private String type;
/** @dbmap.field name=PBPGID */
private String targetPageId;
/** @dbmap.field name=PBQUID */
private String questionId;
/** @dbmap.field name=PBPBVL */
private String value;
//bcl 11/29/05
private String status;
private String alias;
//gdj 8/2/06
private boolean newRule;
//gdj 8/3/06
private String id;
//
public BranchingRule()
{
super();
}
protected BranchingRule(BranchingRule from)
{
super((AbstractIdentified) from);
this.type = from.getType();
this.value = from.getValue();
this.targetPageId = from.getTargetPageId();
this.questionId = from.getQuestionId();
this.alias = from.getAlias();
this.id = from.getId();
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object object)
{
if ((object == null) || (!object.getClass().equals(this.getClass())))
{
return false;
}
BranchingRule rhs = (BranchingRule) object;
return new EqualsBuilder()
.append(this.getFormId(), rhs.getFormId())
.append(this.getTargetPageId(), rhs.getTargetPageId())
.append(this.getQuestionId(), rhs.getQuestionId())
.append(this.getValue(), rhs.getValue())
.append(this.getType(), rhs.getType())
.append(this.getAlias(), rhs.getAlias())
.append(this.getId(), rhs.getId())
.isEquals();
}
/**
* @return
*/
public String getFormId()
{
if (formId == null)
formId = "";
return formId;
}
/**
* @return String
*/
public String getType()
{
if (type == null)
type = "";
return type;
}
/**
* @return String
*/
public String getValue()
{
if (value == null)
value = "";
return value;
}
/**
* @return String
*/
public String getStatus()
{
if (status == null)
status = "";
return status;
}
/**
* @param string void
*/
public void setType(String string)
{
type = string;
}
/**
* @param string void
*/
public void setValue(String string)
{
value = string;
}
/* (non-Javadoc)
* @see org.vsac.forager4j.beans.Copyable#copy()
*/
public Copyable copy()
{
return new BranchingRule(this);
}
/**
* @return
*/
public String getQuestionId()
{
return questionId;
}
/**
* @return
*/
public String getTargetPageId()
{
return targetPageId;
}
/**
* @param string
*/
public void setFormId(String string)
{
formId = string;
}
/**
* @param string
*/
public void setQuestionId(String string)
{
questionId = string;
}
/**
* @param string
*/
public void setTargetPageId(String string)
{
targetPageId = string;
}
public void setStatus(String string)
{
this.status = string;
}
/**
* @see java.lang.Object#toString()
*/
public String toString() {
return new ToStringBuilder(this)
.append("id", this.getId())
.append("targetPageId", this.targetPageId)
.append("questionId", this.questionId)
.append("value", this.value)
.append("type", this.type)
.append("temporarlyIdentified", this.isTemporarlyIdentified())
.append("alias", this.getAlias())
.toString();
}
/**
* @return
*/
public String getAlias() {
return alias;
}
/**
* @param string
*/
public void setAlias(String string) {
alias = string;
}
/**
* @return
*/
public boolean isNewRule() {
return newRule;
}
/**
* @param b
*/
public void setNewRule(boolean b) {
newRule = b;
}
/**
* @return
*/
public String getId() {
return id;
}
/**
* @param string
*/
public void setId(String string) {
id = string;
}
}
Your help is appreciated. Thanks!