private void RouteAction(string worker, string route) { Debug.Assert(!string.IsNullOrWhiteSpace(worker)); Debug.Assert(!string.IsNullOrWhiteSpace(route)); route = RouteSubstitutions(route); _dblog.DebugFormat("workflow instance {0} taking action {1}/{2}", Id, worker, route); if (Workers.ContainsKey(WorkerKey(worker, route))) { try { Workers[WorkerKey(worker, route)].Invoke(Id, route); } catch (Exception ex) { var es = string.Format("Exception while invoking route {0}: {1},\n{2}", worker, route, ex); _log.Error(es); var on = Catalog.Factory.Resolve <IApplicationAlert>(); on.RaiseAlert(ApplicationAlertKind.System, es); } } else { var es = string.Format("Cannot invoke action on worker {0}, this worker doesn't exist in the workflow", worker); _log.Error(es); var on = Catalog.Factory.Resolve <IApplicationAlert>(); on.RaiseAlert(ApplicationAlertKind.System, es); } }