- Defined in:
A proxy for the entity (e.g. a repository Object) that is being processed via workflows.
Objects of this class (and their underlying database records) represent another object in the context of the workflow process. By using a proxy, we can avoid polluting the repository object's data and behavior with things related to workflow processing. This means we can move an object into and through a workflow without making changes independently from curatorial considerations (e.g. metadata changes).
Keeping this object and interface separate also presents a clear seam for alternative solutions.
GlobalID URI via #proxy_for_global_id. Since the repository objects aren't assumed to be
ActiveModel compatible, we use the URI-based system provided by
GlobalID to ensure that this relationship functions independent of the modelling system used for the respository objects. is provided as a convenience method for retrieving the underlying repository object.
Eachholds a relationship to a , which is the active workflow on the object represented by the . It also holds a reference to a , which is the current state of the object within the workflow.
workflow_id: 8, workflow_state_id: 20, created_at: “2017-07-07 13:39:42”, updated_at: “2017-07-07 13:39:42”>
Instance Method Summary collapse
Instance Method Details
#proxy_for ⇒ Object
Returns the thing this
60 61 62
# File 'app/models/sipity/entity.rb', line 60 def proxy_for @proxy_for ||= GlobalID::Locator.locate(proxy_for_global_id) end
#workflow_state_name ⇒ Object
51 52 53
# File 'app/models/sipity/entity.rb', line 51 def workflow_state_name workflow_state&.name end