-
Notifications
You must be signed in to change notification settings - Fork 2
Workflows
They are in config/workflows
In your rails console, do the following:
2.4.2 : > Hyrax::Workflow::WorkflowImporter.load_workflows2.4.2 : > admin_set = AdminSet.first
2.4.2 : > admin_set.permission_template # What's a permission template?
2.4.2 : > admin_set.permission_template.available_workflows
2.4.2 : > admin_set.permission_template.active_workflow
2.4.2 : > osmd = admin_set.permission_template.available_workflows.find_by_name("one_step_mediated_deposit")
2.4.2 : > Sipity::Workflow.activate!(permission_template: admin_set.permission_template, workflow_id: osmd.id)
2.4.2 : > admin_set.permission_template.active_workflowNote: It isn't obvious in a small system where you only have one copy of each workflow, but each AdminSet has its own copy of each workflow. For example, here are two AdminSets, each using a workflow called emory_one_step_approval. Note, however, that each of these AdminSet objects has a different instance of emory_one_step_approval, one that is specific to that AdminSet's permission template.
irb(main):011:0> eh = AdminSet.where(title: "Environmental Health").first
=> #<AdminSet id: "vq27zn406", title: ["Environmental Health - MPH"], description: [], creator: ["admin_set_owner"], access_control_id: "efba7fe5-7c08-41b9-bb20-a606de6fde9c", representative_id: nil, thumbnail_id: nil>
irb(main):012:0> eh.permission_template.active_workflow
=> #<Sipity::Workflow id: 24, name: "emory_one_step_approval", label: "One-step approval tailored for Emory", description: "A single-step workflow for mediated deposit in whi...", created_at: "2018-03-31 00:05:24", updated_at: "2018-03-31 00:05:27", permission_template_id: 8, active: true, allows_access_grant: false>
irb(main):013:0> geh = AdminSet.where(title: "Global Environmental Health - MPH").first
=> #<AdminSet id: "8910jt56k", title: ["Global Environmental Health - MPH"], description: [], creator: ["admin_set_owner"], access_control_id: "bb8ad7ed-e57a-45dc-ad5a-3ec5c34ec36c", representative_id: nil, thumbnail_id: nil>
irb(main):014:0> geh.permission_template.active_workflow
=> #<Sipity::Workflow id: 36, name: "emory_one_step_approval", label: "One-step approval tailored for Emory", description: "A single-step workflow for mediated deposit in whi...", created_at: "2018-03-31 00:05:43", updated_at: "2018-03-31 00:05:48", permission_template_id: 12, active: true, allows_access_grant: false>You should now see that your deposited object doesn't become public right away. Instead, you have a notification that it's awaiting approval. If you log in as an admin, you can also see it awaiting approval in the admin dashboard and you can see a "Review and Approval" panel on the object.