IStudentCourseService - Drop Course

You can use the GetServiceInstance<> activity to invoke the IStudentCourseService method to update a student course record in the Anthology Student database.

The workflow example below is associated with a Forms Builder form that allows students to submit an online form to drop a course to which they have previously been enrolled. The workflow creates and saves a document of the course drop request form and removes the dropped course from the student's course list.

Workflow Example

  1. In Workflow Composer, create the following Variables. Be sure to use the indicated variable types and defaults.

    Variables

    • For the StuDrop variable type, browse to Cmc.Nexus.Crm.Entities.DocumentEntity.

    • For the DropSvc variable type, browse to Cmc.Nexus.Academics.Services.IStudentCourseService.

    • For the DropStudentCourseRequest variable type, browse to Cmc.Nexus.Academics.Services.DropStudentCourseRequest.

    • For the StudentCourseResponse variable type, browse to Cmc.Nexus.Academics.Services.StudentCourseResponse.

  2. To exchange data with Forms Builder, the workflow uses the following arguments:

    Arguments

  3. The first state/form finds the student record and assigns the student's name:

    • LookupUser determines studentid value.

    • GetEntity<StudentEntity> uses the studentid and returns the studentEntity.

    • Assign Name assigns studentEntity.FirstName + " " + studentEntity.LastName to the Fullname argument.

    Find Student

  4. The transition contains a WaitForFormBookmark activity (labeled "Submit"), a sequence with a number of activities to process the course drop request (see next step), and the validation condition Not formInstance.ValidationMessages.HasErrors.

    Submit transition

  5. The "Process Drop Request" sequence creates a file of the course drop request form submitted by the student.

    • The Persist activity precedes the PrintUrlToPdf activity to explicitly request that the workflow persists its data to a file.

    • The PrintUrlToPdf activity creates a file named Pdf (see Variables).

    • The "Add to Doc Center" sequence adds the Pdf file to the student's records in the Document Center (see next step).

    • The "Drop Course" sequence removes the course from the students course list (see below).

    Process Drop Request sequence

  6. The "Add to Doc Center" sequence creates and saves the Pdf file of the student's course drop request.

    • CreateDocument takes the Pdf variable as in-argument, returns the StuDrop (DocumentEntity) variable, and uses the studentid variable (see Variables).

      It also specifies values for the following properties:

      • Date Requested (datetime.Today)
      • Due Date (datetime.Today)
      • Document Type (use drop-down to select, e.g., 148)
      • Image FileName ("StudentDropCourse.pdf")
      • Notes (e.g., "Student Drop Course Form Submitted Online")
      • Status (use drop-down to select, e.g., "On File")
    • Assign Received Date assigns the value "datetime.Today" to StuDrop.ReceivedDate.

    • Assign Approved Date assigns the value "datetime.Today" to the StuDrop.ApprovedDate.

    • SaveDocument saves the StuDrop (DocumentEntity).

    Process Drop Request sequence

  7. The "Drop Course" sequence removes the course from the student's course list and assigns required properties.

    • GetEntity<StudentCourseStatusChangeReasonEntity> takes the studentCourseStatusChangeReasonEntity.Id value and returns studentCourseStatusChangeReasonEntity.

    • GetEntity<StudentEnrollmentPeriodEntity> takes the studentEnrollmentPeriodEntity.Id value and returns studentEnrollmentPeriodEntity.

    • GetEntity<StudentCourseEntity> takes the studentCourseEntity.CourseId value and returns studentCourseEntity.

    • GetServiceInstance<IStudentCourseService> returns the DropSvc variable.

    • Assign activities set the following values:

      To Value
      DropRequest.LetterGrade "WF"
      DropRequest.DropDate datetime.Today
      DropRequest.StudentEnrollmentScheduleId studentCourseEntity.Id
      DropRequest.DropReasonId studentCourseStatusChangeReasonEntity.Id
      DropResponse DropSvc.DropStudentCourse(DropRequest)

    Process Drop Request sequence

Note: Insert LogLine and LogObject activities at various points in the workflow as needed.