question: public @ CheckForNull Queue . Item run2 ( @ Nonnull String replacementMainScript , @ Nonnull Map < String , String > replacementLoadedScripts ) { List < Action > actions = new ArrayList < Action > ( ) ; CpsFlowExecution execution = getExecution ( ) ; if ( execution == null ) { return null ; } actions . add ( new ReplayFlowFactoryAction ( replacementMainScript , replacementLoadedScripts , execution . isSandbox ( ) ) ) ; actions . add ( new CauseAction ( new Cause . UserIdCause ( ) , new ReplayCause ( run ) ) ) ; for ( Class < ? extends Action > c : COPIED_ACTIONS ) { actions . addAll ( run . getActions ( c ) ) ; } return ParameterizedJobMixIn . scheduleBuild2 ( run . getParent ( ) , 0 , actions . toArray ( new Action [ actions . size ( ) ] ) ) ; }
target:  For use in projects that want initiate a replay via the Java API.