Workflow status and Idle event support #54
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Create support for handling various
Idle
events. Firstly, support workflows receiving an event callback when they configure themselves for receiving anIdle
event. But more interestingly:We now support a new event subscription called
IdleNotStartedSince
. This intent of this event is to kick-off workflows automatically that have not been started in a configurable amount of time for a given enrollment ID. In other words: regularly run workflows for enrollments that regularly check-in.To support this we add two new capabilities to the engine. The first is the ability to attach arbitrary data (event context) to an event subscription. For the above new event this means you can include the amount of time, in seconds, since the workflow should have been last run on an enrollment. Secondly we've added the ability of the engine to store, update, and clear the last time an workflow has run for an enrollment. This enables us to be able to check that time stamp and calculate if need to run a workflow again.
Note: this PR has MySQL schema changes. Please see the
schema.00001.sql
file for modification to apply.