Register Students into a Course

This workflow finds students with a status of 'Future Start' and registers the students into an introductory course when their status changes.

  1. Start the Workflow application from your desktop.

  2. On the Home tab, click New Event Workflow.

  3. In the Entities area:

    1. Click right arrow next to Cmc.Nexus.Contracts.

    2. Click right arrow next to Cmc.Nexus.Sis.Academics.

    3. Click Student Enrollment Period (StudentEnrollmentPeriod).

  4. In the Events area, click Saved (SavedEvent).

  5. Specify a Name for the workflow and click OK.

  6. Drag a LookupListItem activity it into the sequence.

    1. In the Item Type field, select Student Status.

    2. In the List Item field, select Future Start.

    3. In the Variables pane, create a lookup type variable (StudentStatus) to contain the results of the lookup.

    LookUpListItem Example

  7. Drag an If activity into the sequence.

    1. In the Condition field, specify the following expression:

      entity.HasChanged(StudentEnrollmentPeriod.StudentStatusIdProperty) and entity.StudentStatusId.Value() = StudentStatus.Id

  8. Drag an ExecuteDataReader activity into the Then branch of the If condition.

    1. In the Queryfield, specify the following string:

      "Select AdClassSchedId from AdClassSched where AdCourseID = 136"

    ExecuteDataReader Example

  9. Drop a CreateStudentCourse activity into the ExecuteDataReader activity.

    1. In the Student Id field, specify Student.

    2. In the Student Enrollment Period Id field, specify entity.Id.

    3. In the Class Section Id field, specify DirectCast(CurrentRow("AdClassSchedId"), Int32).

    4. In the Variables pane, create a variable to hold the Course object that you are creating and enter the variable name in the Properties pane for this activity.

    ExecuteDataReader with CreateStudentCourse

  10. Drag a SaveStudentCourse activity into the sequence below the ExecuteDataReader activity.

    1. In the Action field, select Register.

    2. Enter the variable that holds the Course object that you are creating in the Properties pane for this activity.

    SaveStudentCourse Example

  11. Check your workflow. Scroll through the workflow or use the fit to screen button located at the bottom of the Designer pane to see the whole workflow based on your screen resolution.

  12. Click Publish. The New Workflow Definition Version window is displayed.

  13. If you want the workflow to be run as soon as the event occurs on the entity, select Enable This Workflow Version, otherwise leave the check box cleared.

  14. Click Save, then Cancel to close the publisher window.