mix ash_workflow.gen.transition_log (AshWorkflow v0.6.0)

Copy Markdown View Source

Scaffolds a transition log resource for a workflow

Generates a sibling resource that satisfies AshWorkflow.Verifiers.ValidateTransitionLog, registers it in the workflow resource's domain, and — where it can do so safely — adds the matching transition_log entry to the workflow resource's workflow block.

The generated resource uses the same data layer as the workflow resource (Ash.DataLayer.Ets or AshPostgres.DataLayer, reusing the workflow's configured repo on Postgres).

Example

mix ash_workflow.gen.transition_log MyApp.Ticket

Options

  • --log-module - the module name for the generated log resource. Defaults to the workflow module's name with Transition appended, e.g. MyApp.Ticket becomes MyApp.TicketTransition.
  • --actor - an actor resource module. When given, the generated log resource gets a belongs_to relationship to it and the workflow's transition_log block gets a matching belongs_to_actor entry.