# File lib/puppet/transaction.rb, line 195
195:     def eval_resource(resource)
196:         events = []
197: 
198:         if resource.is_a?(Puppet::Type::Component)
199:             raise Puppet::DevError, "Got a component to evaluate"
200:         end
201: 
202:         if skip?(resource)
203:             @resourcemetrics[:skipped] += 1
204:         else
205:             events += eval_children_and_apply_resource(resource)
206:         end
207: 
208:         # Check to see if there are any events for this resource
209:         if triggedevents = trigger(resource)
210:             events += triggedevents
211:         end
212: 
213:         # Collect the targets of any subscriptions to those events.  We pass
214:         # the parent resource in so it will override the source in the events,
215:         # since eval_generated children can't have direct relationships.
216:         relationship_graph.matching_edges(events, resource).each do |orig_edge|
217:             # We have to dup the label here, else we modify the original edge label,
218:             # which affects whether a given event will match on the next run, which is,
219:             # of course, bad.
220:             edge = orig_edge.class.new(orig_edge.source, orig_edge.target, orig_edge.label)
221:             edge.event = events.collect { |e| e.name }
222:             set_trigger(edge)
223:         end
224: 
225:         # And return the events for collection
226:         events
227:     end