org.kuali.student.lum.program.server
Class ProgramStateChangeServiceImpl

java.lang.Object
  extended by org.kuali.student.lum.program.server.ProgramStateChangeServiceImpl

@Transactional(noRollbackFor=DoesNotExistException.class,
               rollbackFor=java.lang.Throwable.class)
public class ProgramStateChangeServiceImpl
extends Object

This class is called whenever the state of a major discipline changes.

We have a separate class because the operations need to be marked with the @Transactional annotation.

THIS CLASS IS DUPLICATED FOR MAJOR DISCIPLINE, CORE, AND CREDENTIAL PROGRAMS SINCE THERE ARE DIFFERENT SERVICE METHODS FOR EACH OF THESE TYPES (THOUGH THEY ARE SIMILAR)

Author:
Kuali Rice Team (kuali-rice@googlegroups.com)

Field Summary
private  ProgramService programService
          The program service - injected by spring.
 
Constructor Summary
ProgramStateChangeServiceImpl()
           
 
Method Summary
 void changeState(String majorDisciplineId, String newState)
          This method is called by workflow when the state changes.
 void changeState(String endEntryTerm, String endEnrollTerm, String majorDisciplineId, String newState)
          This method is called from the UI (servlet) when state changes.
private  MajorDisciplineInfo findPreviousVersion(MajorDisciplineInfo majorDisciplineInfo)
          This method finds the previous version (the version right before this one).
private  void makeCurrent(MajorDisciplineInfo majorDisciplineInfo)
          This method will make this version of the major discipline the current one.
private  void setEndTerms(MajorDisciplineInfo majorDisciplineInfo, String endEntryTerm, String endEnrollTerm)
          This method updates the end terms for the major discipline passed into it.
 void setProgramService(ProgramService programService)
          This method is used by Spring to inject the program service into this bean.
private  void updateMajorDisciplineInfoState(MajorDisciplineInfo majorDisciplineInfo, String newState)
          This method will update the state of this object and all associated objects.
 void updateRequirementsState(MajorDisciplineInfo majorDisciplineInfo, String newState)
          This method will update the requirement state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

programService

private ProgramService programService
The program service - injected by spring.

Constructor Detail

ProgramStateChangeServiceImpl

public ProgramStateChangeServiceImpl()
Method Detail

changeState

public void changeState(String majorDisciplineId,
                        String newState)
                 throws Exception
This method is called by workflow when the state changes.

Parameters:
majorDisciplineId -
state -
Throws:
Exception

changeState

public void changeState(String endEntryTerm,
                        String endEnrollTerm,
                        String majorDisciplineId,
                        String newState)
                 throws Exception
This method is called from the UI (servlet) when state changes.

Parameters:
endEntryTerm -
endEnrollTerm -
programType -
majorDisciplineId -
newState -
Throws:
Exception

setEndTerms

private void setEndTerms(MajorDisciplineInfo majorDisciplineInfo,
                         String endEntryTerm,
                         String endEnrollTerm)
This method updates the end terms for the major discipline passed into it.

You must still call updateState() to save the object using the web service.

Parameters:
majorDisciplineInfo -
endEntryTerm -
endEnrollTerm -

updateMajorDisciplineInfoState

private void updateMajorDisciplineInfoState(MajorDisciplineInfo majorDisciplineInfo,
                                            String newState)
                                     throws Exception
This method will update the state of this object and all associated objects.

It is needed because we need to make separate web service calls to update the state of these objects.

Parameters:
majorDisciplineInfo -
newState -
Throws:
Exception

makeCurrent

private void makeCurrent(MajorDisciplineInfo majorDisciplineInfo)
                  throws Exception
This method will make this version of the major discipline the current one.

Parameters:
majorDisciplineInfo -
Throws:
Exception

findPreviousVersion

private MajorDisciplineInfo findPreviousVersion(MajorDisciplineInfo majorDisciplineInfo)
                                         throws Exception
This method finds the previous version (the version right before this one).

e.g. v1 = ACTIVE v2 = APPROVED

If you passed v2 into this method, it would return v1.

If there is only one major discipline this method will return null.

Parameters:
majorDisciplineInfo -
Returns:
Throws:
Exception

updateRequirementsState

public void updateRequirementsState(MajorDisciplineInfo majorDisciplineInfo,
                                    String newState)
                             throws Exception
This method will update the requirement state.

Note that it uses StatementUtil to update the statement tree.

Parameters:
majorDisciplineInfo -
newState -
Throws:
Exception

setProgramService

public void setProgramService(ProgramService programService)
This method is used by Spring to inject the program service into this bean.

Parameters:
programService -


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.