node = current; }
pe_pre_notify(rsc, current, op,parent,data_set); register_activity(rsc, op, current, parent); } else { pe_post_notify(rsc, next, op, parent, data_set); register_activity(rsc, op, next, parent); } break; case rsc_state_restart: register_activity(rsc, op, current, parent); if(task == stop_rsc) { pe_pre_notify(rsc, current, op, parent, data_set); } else { pe_post_notify(rsc, current,op,parent,data_set); }
native_create_notify_element(	resource_t *rsc, action_t *op, crm_data_t *parent,	const char *tagname, pe_working_set_t *data_set){/* 	char *key = NULL; */	int trigger_id = -1;	crm_data_t *trigger = NULL;		node_t *node = NULL;	node_t *next = NULL;	node_t *current = NULL;	enum action_tasks task = text2task(op->task);	rsc_state_t state = rsc->fns->state(rsc);	native_variant_data_t *native_data = NULL;	get_native_variant_data(native_data, rsc);	if(native_data->color != NULL) {		next = native_data->color->details->chosen_node;	}	if(native_data->running_on != NULL) {		current = native_data->running_on->data;	}		node = next;	switch(state) {		case rsc_state_active:		case rsc_state_restart:			break;		case rsc_state_move:			if(task == stop_rsc) {				node = current;			}						break;		case rsc_state_starting:			if(task == stop_rsc) {				node = NULL;			}			break;		case rsc_state_stopping:			node = current;			if(task != stop_rsc) {				node = NULL;			}			break;		case rsc_state_stopped:			node = NULL;			break;		case rsc_state_unknown:			node = NULL;			break;	}	if(node == NULL) {		crm_debug_2("No %s created for %s: %s (%s)",			    tagname, op->uuid, rsc->id, rsc_state2text(state));		return;	}	crm_debug_2("Creating %s for %s: %s (%s)",		    tagname, op->uuid, rsc->id, rsc_state2text(state));	if(safe_str_neq(tagname, "target")) {		trigger_id = data_set->action_id++;	}	/* 	key = generate_notify_key(rsc->id, op->task, 0); */	trigger = create_xml_node(parent, tagname);	if(trigger_id != -1) {		crm_xml_add_int(trigger, XML_ATTR_ID, trigger_id);	} else {		crm_xml_add_int(trigger, XML_ATTR_ID, op->id);	}		crm_xml_add(trigger, XML_LRM_ATTR_RSCID, rsc->id);	crm_xml_add(trigger, XML_LRM_ATTR_TASK, op->task);	crm_xml_add(trigger, XML_LRM_ATTR_TARGET, node->details->uname);	crm_xml_add(trigger, XML_LRM_ATTR_TASK_UUID, op->uuid);	crm_xml_add(trigger, XML_LRM_ATTR_TARGET_UUID, node->details->id);	if(trigger_id != -1) {/* 		crm_xml_add(trigger, "notify_task", notify_task); */		crm_xml_add(trigger, "allow_fail", "false");	}}