module PIM::CommunicationPlans

Public Instance Methods

all_communication_plans() click to toggle source
# File pim.rb, line 9978
def all_communication_plans
  plans = {}
  plans.merge!(@module_communication_plans) if @module_communication_plans
  add_parent_objects(plans) { |p| p.module_communication_plans }
  plans
end
communication_plan(name, label = nil, &block) click to toggle source
# File pim.rb, line 9957
def communication_plan name, label = nil, &block

  name = to_sym(name)
  if block

    raise "Communication plan with name '#{name}' is already defined" if module_communication_plans.has_key?(name)

    plan = PIM::CommunicationPlan.new name, label
    plan.instance_exec(&block)

    module_communication_plans[name] = plan
    plan

  elsif name.is_a? PIM::CommunicationPlan
    plan
  else
    all_communication_plans[name]
  end

end
communication_plans_as_json() click to toggle source
# File pim.rb, line 9989
def communication_plans_as_json
  as_json(Hash[all_communication_plans.sort])
end
execute_plan_action(action_type, action_creator, action_tags, action_date, channel, organization, data) click to toggle source
# File pim.rb, line 9997
def execute_plan_action action_type, action_creator, action_tags, action_date, channel, organization, data
  plan = all_communication_plans[to_sym(channel.plan)]
  raise "Plan '#{channel.plan}' used in channel '#{channel.name}' is not defined" if plan.nil?
  plan.execute_plan_action action_type, action_creator, action_tags, action_date, channel, organization, data
end
get_export_formats() click to toggle source
# File pim.rb, line 9993
def get_export_formats
  PIM::Services::CommunicationPlanService.get_export_formats
end
module_communication_plans() click to toggle source
# File pim.rb, line 9985
def module_communication_plans
  @module_communication_plans ||= {}
end