this.stateClone.removePersistenceContext();
}
}
if (state.getEntryActions() == null && this.entryActions.size() > 0) {
EntryActions entry = new EntryActions();
entry.createNew(stateClone);
for (IActionElement a : this.entryActions) {
entry.addEntryAction(a);
}
stateClone.setEntryActions(entry);
}
else if (this.entryActions.size() == 0) {
stateClone.setEntryActions(null);
}
else {
stateClone.getEntryActions().removeAll();
for (IActionElement a : this.entryActions) {
stateClone.getEntryActions().addEntryAction(a);
}
}
if (state.getExitActions() == null && this.exitActions.size() > 0) {
ExitActions exit = new ExitActions();
exit.createNew(stateClone);
for (IActionElement a : this.exitActions) {
exit.addExitAction(a);
}
stateClone.setExitActions(exit);
}
else if (this.exitActions.size() == 0) {
stateClone.setExitActions(null);
}
else {
stateClone.getExitActions().removeAll();
for (IActionElement a : this.exitActions) {
stateClone.getExitActions().addExitAction(a);
}
}
if (this.exceptionHandler != null && this.exceptionHandler.size() > 0) {
stateClone.removeAllExceptionHandler();
for (org.springframework.ide.eclipse.webflow.core.model.IExceptionHandler a : this.exceptionHandler) {
stateClone.addExceptionHandler(a);
}
}
else {
stateClone.removeAllExceptionHandler();
}
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);