State change
A case record exists in the following states:
State |
Description |
---|---|
Start |
Every new applicant in the system begins at this initial state |
End |
At the end of the process, the applicant's case finishes in this end state |
Reviewing |
The case worker is reviewing the applicant's record |
Decision |
The case has been reviewed and the business is taking a decision |
Accepted |
The case has been accepted and the applicant is being notified |
Rejected |
The case has been rejected and the applicant is being rejected |
All these business requirements are captured in Finite State Machine.
Controller code
By now the code should be familiar to you. The controller method changeStateCaseRecordDialog()
in NewTaskModalController
is as follows:
$scope.changeStateCaseRecordDialog = function (caseRecordItem) { /* Copy */ $scope.caseRecord = { id: caseRecordItem.id, firstName: caseRecordItem.firstName, lastName: caseRecordItem.lastName, dateOfBirth: caseRecordItem.dateOfBirth, country...