public void addActionsToActionStateExecutionListAt ( final Flow flow , final String actionStateId , final int position , final EvaluateAction ... actions ) { val actionState = getState ( flow , actionStateId , ActionState . class ) ; val currentActions = new ArrayList < Action > ( ) ; val actionList = actionState . getActionList ( ) ; actionList . forEach ( currentActions :: add ) ; val index = position < 0 || position == Integer . MAX_VALUE ? currentActions . size ( ) : position ; currentActions . forEach ( actionList :: remove ) ; Arrays . stream ( actions ) . forEach ( a -> currentActions . add ( index , a ) ) ; actionList . addAll ( currentActions . toArray ( Action [ ] :: new ) ) ; }
Add actions to action state execution list at .