def check!
      # check mandatory entities
      self.allowed_entities.each do |entity_name, entity_options|
        if !entity_options[:optional] && @entities[entity_name].blank?
          raise Activr::Activity::MissingEntityError, "Missing '#{entity_name}' entity in this '#{self.kind}' activity: #{self.inspect}"
        end
      end
    end
def check!
      # check mandatory entities
      self.allowed_entities.each do |entity_name, entity_options|
        if !entity_options[:optional] && @entities[entity_name].blank?
          raise Activr::Activity::MissingEntityError, "Missing '#{entity_name}' entity in this '#{self.kind}' activity: #{self.inspect}"
        end
      end
    end
Check if activity is valid

 @raise [MissingEntityError] if a mandatory entity is missing
 @api private