title Scenario 2. Case in which the Scenario Engine becomes the issuer of the activity instance

participant Scenario Engine
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
note over Scenario Engine:[TODO] need a task definition that can issue an activity
Scenario Engine->Worklist:Issue new activity
Scenario Engine<-Worklist:Returns activity-instance-id
note over Scenario Engine:[TODO] 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)
note over Scenario Engine:[TODO] intermediate event handling
Publisher-->Assignee:Notify the result (activity-instance id, output result)