Service Module Host

The Service Module Host is the windows service that listens to and processes the messages in the Service Broker Queue. If a workflow has been published, it will execute when the event is raised and processed by the Service Module Host.  

Triggers have been added to the main tables that events can be raised against.  When anything occurs in the user interface that updates these tables then an entry is written to the Service Broker Queue and the Service Module Host sweeps the queue to determine if a published workflow applies to the record.  If so, the business logic within the Workflow executes and processes the record.  If not, the record is cleared from the queue.

Typically, the service is installed either on the API or COM server. Once installed it must be running even if no workflows have been created or published because the Nexus triggers are always inserting records into the Service Broker Queue and those records need to be processed.

Service Module Host:

Service Module Host 

Nexus Triggers:

Nexus Triggers

Service Broker Queue:

The Service Broker Queue must be Enabled. To check to see if it is enabled perform the following steps:

  1. In SQL, right-click on the database and go to Properties.

    DB Properties

  2. Select Options and scroll down in the window to Service Broker. The Broker Enabled property should read True.

    Broker Enables

  3. You can also use the query below to see if the Service Broker is enabled. If the Broker Enabled property is False. You can run the below scripts to enable the broker.


    --Check to see if Service Broker is Enabled
    SELECT is_broker_enabled
    FROM sys.databases
    WHERE database_id = DB_ID()

    --Enable Service Broker
    alter database c2000Help set single_user with rollback immediate
    ALTER DATABASE c2000Help SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE
    ALTER DATABASE c2000Help SET MULTI_USER WITH ROLLBACK IMMEDIATE

  4. You can query the Service Broker External Notification queue as shown below in order to verify that the queue is empty.

Service Broker Queue

Note: The queue should always be empty or close to empty as the Service Module Host should always be running and will clear out the queue immediately.  If the queue has many rows then check to make sure the Service is running. 

alert Never bring a customer live on a workflow until the queue is empty. If a workflow is published and the queue is populated, once the Service is started it will try to process each row against a published workflow. This could cause student records to have actions triggered that should not be.  Start the service and let the queue empty and then publish the Workflow.

When is Service Module Host Used?

When creating a new Workflow in Workflow Composer, in the list of Entities a user can view  the available Contracts and select the applicable Entity/Service along with the corresponding triggering Event. The list is populated once the Packages are imported into the Workflow Composer. When importing the packages into  the composer, there will be V1 Contracts and Activities and V2 Contracts and Activities.  

V1 Contracts 

The V1 Contracts are referred to as the "old namespacing" before the Nexus re-architecture occurred.  These Contracts are listed under Cmc.Nexus.Contracts.  All workflows created using the V1 Contracts and Event of type Saved will always use the Service Module Host. The triggers for V1 saved events are at the database level so such workflows will be executed whether ‘Save’ is performed on Web Client, Anthology Student (Desktop Client), or CampusLink.

V1 Contracts

V2 Contracts 

The V2 Contracts are referred to as the "new namespacing" which was introduced with the Nexus re-architecture.  These Contracts are listed by module or area in the Entities list.  All workflows created using the V2 Contracts and Event of type Saved will call the services directly and will not use the Service Module Host.

Note:  If in a V2 Contract Workflow, there is a V1 or V2 activity that is saving a Course for example and there is also a V1 Student Course Saved Event Workflow published in the environment, then the V2 Contract will execute and the V1 Student Course Saved Event Workflow will execute under the Service Module Host.

V2 Contracts 

Forms Builder 

Forms Builder works as a workflow engine and calls the services directly from within Forms Builder.  The Service Module Host is not relied upon for any activity used in the Forms Builder workflow.

Note:  If in a Forms Builder workflow, there is a V2 activity that is saving a Course for example and there is also a V1 Student Course Saved Event workflow published in the environment, then the Forms Builder workflow will execute and the V1 Student Course Saved Event workflow will execute under the Service Module Host.  

Task Scheduler Occurrence Event

A Scheduled Workflow relies upon the scheduled job and does not require the Service Module Host.

Task Scheduler Occurrence Event