title Scenario 3. Case in which the scheduled Scenario becomes the issuer of the activity instance

participant Scenario Engine
participant Scheduler
participant Scenario Instance
participant Assignee
participant Worklist
participant Publisher

note over Worklist:**activity-instance** topic is a channel that publishes messages related to changes in an activity instance.

Scenario Engine-->Publisher:Subscribe **activity-instance** topic
Assignee-->Publisher:Subscribe **activity-instance** topic
Scenario Engine->Scheduler:Register the scenario in the schedule
Scenario Engine<-Scheduler:schedule ontime
Scenario Engine->Scenario Instance:Instantiate Scenario Instance
Scenario Instance->Worklist:Issue new activity
Scenario Instance<-Worklist:Returns activity-instance-id
Scenario Instance->Scenario Engine:keep activity-instance id to listen intermediate event
Worklist->Publisher:Dispatches that a new activity instance has been posted
Publisher-->Assignee:Notifies the assignee that a new activity instance has been assigned
Assignee->Worklist:Execute the activity-instance
Worklist->Publisher:Dispatch the result (activity-instance id, output result)
Publisher-->Scenario Engine:Notify the result (activity-instance id, output result)
Scenario Engine->Scenario Instance:intermediate event handling
Publisher-->Assignee:Notify the result (activity-instance id, output result)
Scenario Instance->Scenario Instance:Keep going