if (!getVars().contains(state)) {
int refIndex = i;
if (i >= this.vars.size()) {
refIndex = this.vars.size() - 1;
}
IVar refState = this.vars.get(refIndex);
this.getVars().add(i, state);
WebflowModelXmlUtils.insertBefore(state.getNode(), refState.getNode());
super.firePropertyChange(ADD_CHILDREN, new Integer(i), state);
}
}