示例#1
0
        public void Triggers(string currentTime)
        {
            var db     = new CoreToWorkflowEntities();
            var change = db.tableTracks.Add(new tableTracks());

            change.CurrentTime = currentTime;
            db.SaveChanges();
        }
示例#2
0
        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));
        }
示例#3
0
        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();
        }
示例#4
0
        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();
        }
示例#5
0
        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);
            }
        }