org.kuali.student.lum.workflow
Class MajorDisciplineStateChangeServiceImpl

java.lang.Object
  extended by org.kuali.student.lum.workflow.MajorDisciplineStateChangeServiceImpl
All Implemented Interfaces:
StateChangeService

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

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  AtpService atpService
           
private  ProgramService programService
          The program service - injected by spring.
 
Constructor Summary
MajorDisciplineStateChangeServiceImpl()
           
 
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 endInstAdmitTerm, String majorDisciplineId, String newState)
          This method is called from the UI (servlet) when state changes.
protected  MajorDisciplineInfo getCurrentVersion(MajorDisciplineInfo majorDisciplineInfo)
          Get the current version of program given the selected version of program
private  void makeCurrent(MajorDisciplineInfo majorDisciplineInfo)
          This method will make this version of the major discipline the current one.
 void setAtpService(AtpService atpService)
           
private  void setEndTerms(MajorDisciplineInfo majorDisciplineInfo, String endEntryTerm, String endEnrollTerm, String endInstAdmitTerm)
          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.
private  void updatePreviousVersions(MajorDisciplineInfo selectedVersion, String endEntryTerm, String endEnrollTerm, String endInstAdmitTerm)
          This method finds all previous versions of program and sets all previous ACTIVE,APPROVED,DRAFT versions to SUPERSEDED and sets new end terms for previous current version.
 void updateRequirementsState(List<String> programRequirementIds, String newState)
          This method will update the requirement state.
 void updateVariationsRequirementsState(List<ProgramVariationInfo> variationList, String newState)
          This method will update the requirements of each variation.
 
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.


atpService

private AtpService atpService
Constructor Detail

MajorDisciplineStateChangeServiceImpl

public MajorDisciplineStateChangeServiceImpl()
Method Detail

changeState

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

Specified by:
changeState in interface StateChangeService
Parameters:
majorDisciplineId -
state -
Throws:
Exception

changeState

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

Specified by:
changeState in interface StateChangeService
Parameters:
endEntryTerm -
endEnrollTerm -
programType -
majorDisciplineId -
newState -
Throws:
Exception

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

updatePreviousVersions

private void updatePreviousVersions(MajorDisciplineInfo selectedVersion,
                                    String endEntryTerm,
                                    String endEnrollTerm,
                                    String endInstAdmitTerm)
                             throws Exception
This method finds all previous versions of program and sets all previous ACTIVE,APPROVED,DRAFT versions to SUPERSEDED and sets new end terms for previous current version.

Parameters:
majorDisciplineInfo - The version of major discipline program being activated
endEntryTerm - The new end entry term to set on previous active version
endEnrollTerm - The new end enroll term to set on previous active version
Throws:
Exception

getCurrentVersion

protected MajorDisciplineInfo getCurrentVersion(MajorDisciplineInfo majorDisciplineInfo)
                                         throws Exception
Get the current version of program given the selected version of program

Parameters:
verIndId -
Throws:
Exception

setEndTerms

private void setEndTerms(MajorDisciplineInfo majorDisciplineInfo,
                         String endEntryTerm,
                         String endEnrollTerm,
                         String endInstAdmitTerm)
                  throws InvalidParameterException,
                         MissingParameterException,
                         OperationFailedException,
                         DoesNotExistException
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 -
endInstAdmitTerm -
Throws:
OperationFailedException
MissingParameterException
InvalidParameterException
DoesNotExistException

updateRequirementsState

public void updateRequirementsState(List<String> programRequirementIds,
                                    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

updateVariationsRequirementsState

public void updateVariationsRequirementsState(List<ProgramVariationInfo> variationList,
                                              String newState)
                                       throws Exception
This method will update the requirements of each variation.

We need to do this here as opposed to in the assemblers, since we need to make calls out to a separate web service. Also, this needs to be done here because changing state no longer calls the save function.

Note that core and credential programs do not have variations so this method isn't necessary.

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 -

setAtpService

public void setAtpService(AtpService atpService)


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