matched_action_list->timer_id = -1; next_action = g_list_nth_data(matched_action_list->actions, matched_action_list->index);  passed = initiate_action(matched_action_list);
);
process_graph_event(	const char *event_node,   const char *event_rsc, const char *rsc_state,	const char *event_action, const char *event_rc, const char *op_status){	int lpc;	xmlNodePtr action        = NULL; /* <rsc_op> or <crm_event> */	xmlNodePtr next_action   = NULL;	action_list_t *matched_action_list = NULL;	xmlNodePtr xml_action = NULL;	const char *allow_fail  = NULL;	op_status_t rsc_code_i = 0;/* Find the action corresponding to this event */	crm_trace("looking for: task=%s node=%s rsc_id=%s rc=%s",		  event_action, event_node, event_rsc, event_rc);		slist_iter(		action_list, action_list_t, graph, lpc,		const char *this_action = NULL;		const char *this_node   = NULL;		const char *this_rsc    = NULL;		if(action_list->status != TE_LIST_ACTIVE) {			crm_trace("skipping %s list[%d]",				  action_list->status==TE_LIST_COMPLETE?"complete":"failed",				  lpc);			continue;		}				action = g_list_nth_data(action_list->actions,					  action_list->index);		if(action == NULL) {			crm_warn("No action for list[%d][%d]",				 lpc, action_list->index);						continue;		}/*		<rsc_op id= runnable= optional= task= on_node= >			<resource id="rsc3" priority="3.0"/>		</rsc_op>*/		this_action = xmlGetProp(			action, XML_LRM_ATTR_TASK);		this_node   = xmlGetProp(			action, XML_LRM_ATTR_TARGET);		this_rsc    = xmlGetProp(			action, XML_LRM_ATTR_RSCID);		crm_trace("matching against: <%s task=%s node=%s rsc_id=%s/>",			  action->name, this_action, this_node, this_rsc);				if(safe_str_neq(this_node, event_node)) {			crm_trace("node mismatch");			continue;		} else if(safe_str_neq(this_action, event_action)) {				crm_trace("action mismatch");			continue;					} else if(safe_str_eq(action->name, "rsc_op")) {			crm_trace("rsc_op");			if(safe_str_eq(this_rsc, event_rsc)) {				matched_action_list = action_list;			} else {				crm_trace("bad rsc (%s) != (%s)",					  this_rsc, event_rsc);			}					} else if(safe_str_eq(action->name, "crm_event")) {			crm_trace("crm_event");			matched_action_list = action_list;		} else {			crm_trace("no match");		}				);				if(matched_action_list == NULL) {		/* unexpected event, trigger a pe-recompute */		/* possibly do this only for certain types of actions */		crm_err("Unexpected event... matched action list was NULL"			" for: task=%s node=%s rsc_id=%s, rc=%s, state=%s",			event_action, event_node, event_rsc, event_rc, rsc_state);				return FALSE;	} else {		crm_trace("Matched event to item %d in list %d",			  matched_action_list->index,			  matched_action_list->id);	}	xml_action = g_list_nth_data(matched_action_list->actions,						 matched_action_list->index);	allow_fail  = xmlGetProp(xml_action, "allow_fail");	/* check for action failure */	rsc_code_i = -1;	if(event_rc != NULL) {		rsc_code_i = atoi(op_status);	}		if(rsc_code_i == -1) {		/* just information that the action was sent */		crm_trace("Ignoring TE initiated updates");		return TRUE;	}		switch(rsc_code_i) {		case LRM_OP_DONE:			break;		case LRM_OP_ERROR:		case LRM_OP_TIMEOUT:		case LRM_OP_NOTSUPPORTED:			if(safe_str_neq(allow_fail, XML_BOOLEAN_TRUE)) {				crm_err("Action %s to %s on %s resulted in"					" failure... aborting transition.",					event_action, event_rsc, event_node);				return FALSE;			}			break;		case LRM_OP_CANCELLED:			/* do nothing?? */			crm_warn("Dont know what to do for cancelled ops yet");			break;		default:			crm_err("Unsupported action result: %s", event_rc);			return FALSE;			break;	}		crm_trace("Action was successful, looking for next action");	while(matched_action_list->status == TE_LIST_ACTIVE) {		gboolean passed = FALSE;		if(matched_action_list->timer_id > 0) {			crm_debug("Removing timer for list: %s",				  xml_action->name);			g_source_remove(matched_action_list->timer_id);		}				matched_action_list->timer_id = -1;		next_action = g_list_nth_data(matched_action_list->actions,					      matched_action_list->index);				passed = initiate_action(matched_action_list);		if(passed == FALSE) {			crm_err("Initiation of next event failed");			return FALSE;					} else if(matched_action_list->status == TE_LIST_COMPLETE) {			/* last action in that list, check if there are			 *  anymore actions at all			 */			crm_debug("Our list is complete... anyone else?");			slist_iter(				action_list, action_list_t, graph, lpc,				if(action_list->status != TE_LIST_COMPLETE){					crm_debug("Another list is not yet complete");					return TRUE;				}				);		} else {			crm_debug("Exiting with status: %d", matched_action_list->status);			return TRUE;					}	}	crm_info("Transition complete...");	send_success();		return TRUE;}