Version 1 of 14 · · Current version

tags
#help #lifecycle

Help: lifecycle messages

d2 sends these messages in your project as things happen, so your rules can react. Handle them in the project's init page, Settings:Init (Admin → Init); InitExample shows one at work.

Each is sent only when your project has a rule for it. It runs as a flow that can write objects, after whatever caused it, and you can open it under Flows. A mistake in a rule shows there and in the audit log, and never stops the project.

The project

  • diesel.project.init (project): the project was loaded (d2 started, or was updated), or its init page was saved. The place to set up what the project needs, since it runs again whenever you change the page.
  • diesel.project.created (project): once, when the project was made.
  • diesel.project.released (project, version): after a release (Admin → Project); version is the new one, like 1.2.0.

Objects

  • diesel.entity.created (realm, category, key): an object was added, by a form, the API, your AI or a flow.
  • diesel.entity.updated (realm, category, key): an object was changed.
  • diesel.entity.deleted (realm, category, key): an object was deleted.

category is the object's class and key its key; pick the ones a rule is for with a condition, like $when diesel.entity.created (category, key) if (category is "Holding") { … }. Not sent for a scratch run (the fiddle, or a run that doesn't write), nor for the sample objects a spec declares. The writes a rule makes while handling one of these don't send more of them, so a rule can't loop.

Coming later

  • diesel.user.joined, diesel.user.left (email, role): someone joined or left the project.
  • diesel.quota.reached (quota): the project reached one of its plan's limits.