package pt.utl.ist.scripts.runOnce.candidacy; import net.sourceforge.fenixedu.domain.candidacyProcess.IndividualCandidacyProcess; import net.sourceforge.fenixedu.domain.candidacyProcess.IndividualCandidacyState; import pt.utl.ist.scripts.commons.AtomicScript; public class ChangeApplicationState extends AtomicScript { private static final String PROCESS_CODE = "1011138416"; @Override protected void run() throws Exception { IndividualCandidacyProcess process = IndividualCandidacyProcess .findIndividualCandidacyProcessByCode( net.sourceforge.fenixedu.domain.candidacyProcess.degreeTransfer.DegreeTransferIndividualCandidacyProcess.class, PROCESS_CODE); if (process == null) { System.out.println(String.format("Process with number %s does not exists", PROCESS_CODE)); return; } System.out.println("Current state " + process.getCandidacyState().getLocalizedName()); process.getCandidacy().setState(IndividualCandidacyState.STAND_BY); System.out.println("New state " + process.getCandidacyState().getLocalizedName()); } /** * @param args */ public static void main(String[] args) { process(new ChangeApplicationState()); } }