public void Triggers(string currentTime) { var db = new CoreToWorkflowEntities(); var change = db.tableTracks.Add(new tableTracks()); change.CurrentTime = currentTime; db.SaveChanges(); }
protected override int Execute(CodeActivityContext context) { var res = 0; int idWF = IdWorkflow.Get(context); var db = new CoreToWorkflowEntities(); res = db.tableTasks.Where(x => x.IdTableEstatus == idWF).Count(); AmountTaskValue.Set(context, res); return(AmountTaskValue.Get(context)); }
protected override void Execute(CodeActivityContext context) { var db = new CoreToWorkflowEntities(); var change = db.tableTracks.Add(new tableTracks()); change.CurrentTime = CurrentTime.Get(context); change.IdTableWorkflow = IdWorkflow.Get(context); db.SaveChanges(); }
static void Main(string[] args) { var db = new CoreToWorkflowEntities(); int idWF = 1; string _duration = db.tableWorkflow.SingleOrDefault(x => x.Id == idWF).Duration.ToString(); var parameters = new Dictionary <string, object>(); parameters.Add("_TimeExecution", _duration); parameters.Add("_IdWorkflow", idWF); Activity _workflow = new _WfNative(); WorkflowInvoker.Invoke(_workflow, parameters); Console.ReadLine(); }
protected override string Execute(CodeActivityContext context) { var db = new CoreToWorkflowEntities(); int idWF = IdWorkflow.Get(context); int _position = TaskNumber.Get(context); var positionTaskInTable = db.tableTasks.Where(x => x.IdTableWorkflow == idWF).OrderBy(j => j.Id).ToList(); var nameFunction = positionTaskInTable[_position].TaskFunction; var obj = new _Tasks(); try { obj.GetType().GetMethod(nameFunction).Invoke(obj, null); return("se ejecuto la función: " + nameFunction); } catch { return("no existe la función: " + nameFunction); } }