}
if (state.getOutputMapper() == null
&& (this.outputAttributes.size() > 0 || this.outputMapping.size() > 0)) {
if (WebflowModelXmlUtils.isVersion1Flow(state)) {
OutputMapper entry = new OutputMapper();
entry.createNew(stateClone);
for (IInputAttribute a : this.outputAttributes) {
entry.addOutputAttribute((IOutputAttribute) a);
}
for (IMapping a : this.outputMapping) {
entry.addMapping(a);
}
stateClone.setOutputMapper(entry);
}
else {
stateClone.removeAllOutputAttribute();
for (IInputAttribute a : this.outputAttributes) {
stateClone.addOutputAttribute((IOutputAttribute) a);
}
stateClone.setOutputMapper(null);
}
}
else if (this.outputAttributes.size() == 0 && this.outputMapping.size() == 0) {
stateClone.setOutputMapper(null);
}
else {
stateClone.getOutputMapper().removeAllOutputAttribute();
stateClone.getOutputMapper().removeAllMapping();
for (IInputAttribute a : this.outputAttributes) {
stateClone.getOutputMapper().addOutputAttribute((IOutputAttribute) a);
}
for (IMapping a : this.outputMapping) {
stateClone.getOutputMapper().addMapping(a);
}
}
if (state.getInputMapper() == null
&& (this.inputAttributes.size() > 0 || this.inputMapping.size() > 0)) {
if (WebflowModelXmlUtils.isVersion1Flow(state)) {
InputMapper entry = new InputMapper();
entry.createNew(stateClone);
for (IInputAttribute a : this.inputAttributes) {
entry.addInputAttribute(a);
}
for (IMapping a : this.inputMapping) {
entry.addMapping(a);
}
stateClone.setInputMapper(entry);
}
else {
stateClone.removeAllInputAttribute();
for (IInputAttribute a : this.inputAttributes) {
stateClone.addInputAttribute(a);
}
stateClone.setInputMapper(null);
}
}
else if (this.inputAttributes.size() == 0 && this.inputMapping.size() == 0) {
stateClone.setInputMapper(null);
}
else {
stateClone.getInputMapper().removeAllInputAttribute();
stateClone.getInputMapper().removeAllMapping();
for (IInputAttribute a : this.inputAttributes) {
stateClone.getInputMapper().addInputAttribute(a);
}
for (IMapping a : this.inputMapping) {
stateClone.getInputMapper().addMapping(a);
}
}
if (state.getGlobalTransitions() == null && this.globalTransitions.size() > 0) {
GlobalTransitions entry = new GlobalTransitions();
entry.createNew(stateClone);
for (IStateTransition a : this.globalTransitions) {
entry.addGlobalTransition(a);
}
stateClone.setGlobalTransitions(entry);
}
else if (this.globalTransitions.size() == 0) {
stateClone.setGlobalTransitions(null);