Transfer Students to Another Class Section

Scenario: Active students are enrolled and registered into a course in the current term. The course has multiple class sections in the current term. The course is in Scheduled status for the target students. The workflow is used to transfer students from one class section to another class section of the same course.

Similar workflows could be used to balance student populations across multiple class sections; or, if student groups are created, students could be transferred into a class section based on specific student group criteria.

  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.

    3. Click Group Membership (GroupMembership).

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

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

  6. Drop a LookupClassSections activity into the sequence.

    1. Click the Search button to find and select the course into which the students are transferred.

    2. Create a variable for the array of class section values.

      Name the variable, e.g., ClassSects, and select the Variable type of ClassSection[].

    3. Specify appropriate values for the CourseId and TermId.

      Note: Use an SQL query to determine the CourseId and TermId values for your database environment, e.g.,

      select * from AdEnrollSched where AdCourseID = "value from workflow" and systudentid = "current student id"

    LookUpClassSections Example

  7. Drop a For Each<> activity into the sequence.

    1. In the TypeArgument field, browse for Cmc.Nexus.Sis.Academics.ClassSection.

      The DisplayName field changes to ForEach<ClassSection>.

    2. In the Values field, enter the ClassSects variable created in the previous step.

    The ForEach<ClassSection> activity steps through the array of class sections and returns the Ids for each item.

    ForEach<ClassSection>

  8. Drop a Sequence into the Body field of the ForEach<ClassSection> activity.

  9. Drop an If activity into the sequence added in the previous step.

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

      item.SectionCodeEquals("ACC101")

      where "ACC101" (case sensitive) is the name of the class section into which you want to transfer students.

  10. Create a variable for the new class section values.

    Name the variable, e.g., NewSection, and select the Variable type of Int32.

  11. Drop an A+B Assign activity into the Then branch of the If condition.

    1. In the To field of the Assign activity, specify the name of the variable created in the previous step (NewSection).

    2. Assign the value item.ID to the NewSection variable.

    ForEach<ClassSection> with If activity

  12. Drop a SaveStudentCourse activity into the sequence below the If activity.

    1. In the Action field, select TransferClassSection.

    2. In the StudentCourseId field, specify the value of the current class.

      Note: Use an SQL query to determine the StudentCourseId value for your database environment, e.g.,

      select adenrollschedid from AdEnrollSched where AdCourseID = "value from workflow" and systudentid = "current student id"

    3. In the TransferToClassSectionId field, specify the NewSection variable.

    SaveStudentCourse Example - TransferClassSection

  13. 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.

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

  15. 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.

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