lib/workflow_setup.rb
# Activate a mediated deposit workflow for the given admin_set.
# Default is emory_one_step_approval, but a different value can be passed in.
# The activate! method will DEactivate it if it was already active, so be careful.
# @return [Boolean] true if successful
Activate a mediated deposit workflow for the given admin_set.
Default is emory_one_step_approval, but a different value can be passed in.
The activate. method will DEactivate it if it was already active, so be careful.
Activate a mediated deposit workflow for the given admin_set . Default is emory_one_step_approval but a different value can be passed in . The activate . method will DEactivate it if it was already active so be careful .
def activate_mediated_deposit(admin_set, workflow_name = "emory_one_step_approval")
    osmd = admin_set.permission_template.available_workflows.where(name: workflow_name).first
    if osmd.active == true
      @logger.debug "AdminSet #{admin_set.title.first} already had workflow #{admin_set.permission_template.available_workflows.where(active: true).first.name}. Not making any changes."
      return true
    end
    Sipity::Workflow.activate!(
      permission_template: admin_set.permission_template,
      workflow_id: osmd.id
    )
    @logger.debug "AdminSet #{admin_set.title.first} has workflow #{admin_set.permission_template.available_workflows.where(active: true).first.name}"
    true
  end
def activate_mediated_deposit ( admin_set , workflow_name = "emory_one_step_approval" ) osmd = admin_set . permission_template . available_workflows . where ( name : workflow_name ) . first if osmd . active == true @logger . debug "AdminSet #{admin_set.title.first} already had workflow #{admin_set.permission_template.available_workflows.where(active: true).first.name}. Not making any changes." return true end Sipity :: Workflow . activate! ( permission_template : admin_set . permission_template , workflow_id : osmd . id ) @logger . debug "AdminSet #{admin_set.title.first} has workflow #{admin_set.permission_template.available_workflows.where(active: true).first.name}" true end
Activate a mediated deposit workflow for the given admin_set.
Activate a mediated deposit workflow for the given admin_set .
true if successful
true if successful
Boolean
admin_set
<not_specific>
workflow_name
<not_specific>