//Reconcile ActionSetField and ActionUpdateField calls
final List<IAction> actions = new ArrayList<IAction>();
for ( IAction action : model.rhs ) {
if ( action instanceof ActionSetField ) {
final ActionSetField asf = (ActionSetField) action;
final ActionSetFieldWrapper afw = findExistingAction( asf,
actions );
if ( afw == null ) {
actions.add( new ActionSetFieldWrapper( asf,
( asf instanceof ActionUpdateField ) ) );
} else {
final List<ActionFieldValue> existingActionFieldValue = new ArrayList<ActionFieldValue>( Arrays.asList( afw.getAction().getFieldValues() ) );
for ( ActionFieldValue afv : asf.getFieldValues() ) {
existingActionFieldValue.add( afv );
}
final ActionFieldValue[] temp = new ActionFieldValue[ existingActionFieldValue.size() ];
afw.getAction().setFieldValues( existingActionFieldValue.toArray( temp ) );
}