Diffo.Provider.Assigner (Diffo v0.4.1)

Copy Markdown View Source

Helper to perform Assignment using Diffo.Provider.AssignmentRelationship.

Each assignment is stored as an AssignmentRelationship with top-level pool, thing, and value attributes. This makes them filterable at the Cypher level and usable in aggregate expressions.

Summary

Functions

Assign a thing using the pool declared via pools do on the instance module. The thing name is looked up from the pool declaration.

Assign a thing using the instance changeset assignment.

The resource lifecycle states from which an instance may make assignments.

The service lifecycle states from which an instance may make assignments.

Returns :ok if the instance is in a lifecycle state that permits assignment, otherwise {:error, reason}.

Functions

assign(result, changeset, pool_name)

Assign a thing using the pool declared via pools do on the instance module. The thing name is looked up from the pool declaration.

assign(result, changeset, pool, thing)

Assign a thing using the instance changeset assignment.

assignable_resource_states()

The resource lifecycle states from which an instance may make assignments.

assignable_service_states()

The service lifecycle states from which an instance may make assignments.

assignable_state?(arg1)

Returns :ok if the instance is in a lifecycle state that permits assignment, otherwise {:error, reason}.