Example #1
0
        protected override void Execute(CodeActivityContext context)
        {
            var userTaskId = (Guid)context.DataContext.GetProperties()["__UserTaskId"].GetValue(context.DataContext);
            var db         = context.GetExtension <Db>();
            var userTask   = db.UserTasks.Find(userTaskId);

            userTask.ViewName       = ViewName.Get(context);
            userTask.ViewInputModel = JsonConvert.SerializeObject(ViewInputModel.Get(context) ?? new object()
                                                                  , Formatting.None
                                                                  , new JsonSerializerSettings {
                ContractResolver = new CamelCasePropertyNamesContractResolver(), DateFormatString = "dd.MM.yyyy"
            }
                                                                  );
        }
Example #2
0
        protected override void Execute(NativeActivityContext context)
        {
            var task = new UserTaskEntry()
            {
                Id             = Guid.NewGuid(),
                Caption        = Caption.Get(context),
                QueueName      = QueueName.Get(context),
                ViewName       = ViewName.Get(context),
                ViewInputModel = JsonConvert.SerializeObject(ViewInputModel.Get(context) ?? new object()
                                                             , Formatting.None
                                                             , new JsonSerializerSettings {
                    ContractResolver = new CamelCasePropertyNamesContractResolver(), DateFormatString = "dd.MM.yyyy"
                }),
                WWFId = context.WorkflowInstanceId
            };

            var db = context.GetExtension <Db>();

            db.UserTasks.Add(task);

            UserTaskId.Set(context, task.Id);

            context.ScheduleFunc(Wizard, task.Id, OnChildComplete);
        }