Ejemplo n.º 1
0
        public YesNoFieldVariable(VariableInstance variableInstance, FormControlScopeViewModel controlScopeViewModel, ScopeResources scopeResources, BooleanSettings settings)
            : base(variableInstance, controlScopeViewModel, scopeResources)
        {
            NoText = settings.UseTrueOrFalse ? "False" : "No";
            YesText = settings.UseTrueOrFalse ? "True" : "Yes";
            DefaultValue = settings.DefaultValue;

            if (variableInstance.Variable.Value == null)
            {
                Value = settings.DefaultValue.ToString().ToLower();
                IsYesChecked = settings.DefaultValue;
                IsNoChecked = settings.DefaultValue == false;
            }
            else
            {
                Value = variableInstance.Variable.Value.ToLower();
            }
        }
Ejemplo n.º 2
0
 public VariableNode(VariableInstance v)
 {
     variable_instance = v;
 }
Ejemplo n.º 3
0
 public abstract EffigyLink CreateLink(CmlContext context, object representation, VariableInstance variable_instance, EffigyClassInfo @class);
Ejemplo n.º 4
0
        /// <summary>
        /// </summary>
        /// <param name="instanceid">流程ID</param>
        /// <param name="tokenid">节点ID</param>
        /// <param name="transitionName">按钮名称(离开当前节点的TransitionName)</param>
        public void Process(ProcessModel data)
        {
            var proxy = new WorkflowProxy();

            var processInstance = new ProcessInstance();
            processInstance.InstanceID = data.InstanceId;
            processInstance.TokenID = data.TokenId;
            processInstance.RouterName = data.TransitionName;

            var item = new VariableInstance();
            if (processInstance.RouterName == "到是否参加社会保险")
            {
                int flag = 0;
                if (!string.IsNullOrWhiteSpace(data.TemplateData))
                {
                    dynamic jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(data.TemplateData);
                    string idCardNumber = jsonObj.ShenFenZhengHaoMa;
                    if (socialSpRepo.Entities.Any(m => m.IDCardNumber == idCardNumber))
                    {
                        flag = 1;
                    }
                    else
                    {
                        flag = 0;
                        socialSpRepo.Insert(new SocialSecurityPersonnel()
                        {
                            IDCardNumber = idCardNumber
                        });
                    }
                }
                item.VariableName = "flag";
                item.Value = flag;
                processInstance.Variables.Add(item);
            }

            //将表单数据保存至流程的变量中,以便在审核环节能够读出表单的数据(变量值不能超过2000)
            if (!string.IsNullOrWhiteSpace(data.TemplateData))
            {
                VariableInstance pageUrl = proxy.GetCurrentTaskSetPage(processInstance.InstanceID, processInstance.TokenID);
                item = new VariableInstance();
                item.Value = data.TemplateData;
                item.VariableName = pageUrl.Value.ToString();
                processInstance.Variables.Add(item);
            }

            //获取下一个节点名并启动流程
            string userId = "";
            var list = proxy.GetTransitionNextNodeRoles(data.DefineName, data.TokenName, data.TransitionName);
            if (list != null && list.Count > 0)
            {

                string nodeName = list[0];
                User choosenUser = teamRepo.GetNextUserByNodeName(data.DefineName, nodeName);
                //var choosenUser = GetRandomUserId(users);
                if (choosenUser == null)
                {
                    throw new BusinessException("找不到下一步处理人");
                }

                assignedUserRepo.Insert(new AssignedUser
                {
                    InDate = DateTime.Now,
                    InstanceID = data.InstanceId,
                    UserID = choosenUser.UserID,
                    Nodename = nodeName,
                    ProcessName = data.DefineName,
                    InUser = data.User.UserID
                });

                var user = new TaskUser { UserId = choosenUser.UserID, UserName = choosenUser.UserName };
                userId = choosenUser.UserID;
                processInstance.IncludeActors.Add(user);
            }
            proxy.ProcessExecuter(processInstance);

            LogHelper.Instanse.WriteInfo(
                string.Format("InstanceID:-{0},TokenID:-{1},推给了-{2}",
                    processInstance.InstanceID, processInstance.TokenID, userId));

            if (!string.IsNullOrEmpty(data.TemplateData))
            {
                userAnswerRepo.Insert(new UserAnwser()
                {
                    TemplateData = data.TemplateData,
                    TemplateName = data.TemplateName,
                    InDate = DateTime.Now,
                    ProcessName = data.DefineName,
                    NodeName = data.TokenName,
                    UserID = data.User.UserID,
                    InstanceID = data.InstanceId,
                    TokenID = data.TokenId
                });
            }
        }
Ejemplo n.º 5
0
 public EffigyLink_Single(CmlContext context, VariableInstance v, EffigySingleDestination d, EffigyClassInfo c) : base(context, c)
 {
     variable_instance = v;
     destination       = d;
 }
Ejemplo n.º 6
0
        protected internal virtual IList <VariableInstance> createMockVariableInstanceList(VariableInstance mockInstance)
        {
            IList <VariableInstance> mocks = new List <VariableInstance>();

            mocks.Add(mockInstance);
            return(mocks);
        }
Ejemplo n.º 7
0
 public override void PushToVariable(VariableInstance variable, TyonHydrater hydrater)
 {
     GetTyonSurrogate().PushToVariable(variable, hydrater);
 }
Ejemplo n.º 8
0
 public override void PushToVariable(VariableInstance variable, TyonHydrater hydrater)
 {
     variable.SetContents(GetBool());
 }
Ejemplo n.º 9
0
 public static HalVariableValue generateCaseInstanceVariableValue(VariableInstance variableInstance, string caseInstanceId)
 {
     return(fromVariableInstance(variableInstance).link(REL_SELF, CaseInstanceRestService_Fields.PATH, caseInstanceId, "variables"));
 }
Ejemplo n.º 10
0
 public static HalVariableValue generateExecutionVariableValue(VariableInstance variableInstance, string executionId)
 {
     return(fromVariableInstance(variableInstance).link(REL_SELF, ExecutionRestService_Fields.PATH, executionId, "localVariables"));
 }
Ejemplo n.º 11
0
 public static HalVariableValue generateTaskVariableValue(VariableInstance variableInstance, string taskId)
 {
     return(fromVariableInstance(variableInstance).link(REL_SELF, TaskRestService_Fields.PATH, taskId, "localVariables"));
 }
Ejemplo n.º 12
0
        public ScopeResources(FormResources formResources, VariableInstance variableInstance)
        {
            EnvironmentItems = new ObservableDictionary<string, object>();
            EnvironmentSelectedItems = new ObservableDictionary<string, object>();

            RoleItems = new ObservableDictionary<string, object>();
            RoleSelectedItems = new ObservableDictionary<string, object>();

            MachineItems = new ObservableDictionary<string, object>();
            MachineSelectedItems = new ObservableDictionary<string, object>();

            ActionItems = new ObservableDictionary<string, object>();
            ActionSelectedItems = new ObservableDictionary<string, object>();

            EnvironmentItems.Add(formResources.Environment.Name, formResources.Environment.Id);

            foreach (string role in formResources.Roles)
            {
                RoleItems.Add(role, role);
            }

            foreach (MachineResource machineResource in formResources.Machines)
            {
                MachineItems.Add(machineResource.Name, machineResource.Id);
            }

            foreach (KeyValuePair<string, string> keyValuePair in formResources.Actions)
            {
                ActionItems.Add(keyValuePair.Key, keyValuePair.Value);
            }

            SetSelectedItems(variableInstance.Variable, formResources.Environment.Id, formResources.Environment.Name);

            SetResourceText(variableInstance.Resource);


            SetupEvents();
        }
Ejemplo n.º 13
0
 public CmlScriptValue_Argument_Single_VariableInstance(VariableInstance v)
 {
     variable_instance = v;
 }
Ejemplo n.º 14
0
 public TyonVariable(VariableInstance variable, TyonDehydrater dehydrater) : this()
 {
     SetId(variable.GetVariable().GetVariableName());
     SetTyonValue(dehydrater.CreateTyonValue(variable.GetVariableType(), variable.GetContents()));
 }
Ejemplo n.º 15
0
        public DropdownFieldVariable(VariableInstance variableInstance, FormControlScopeViewModel controlScopeViewModel,
            ScopeResources scopeResources)
            : base(variableInstance, controlScopeViewModel, scopeResources)
        {

        }
Ejemplo n.º 16
0
 public override EffigyLink CreateLink(CmlContext context, object representation, VariableInstance variable_instance, EffigyClassInfo @class)
 {
     return(new EffigyLink_Single(
                context,
                variable_instance,
                CreateSingleDestination(representation),
                @class
                ));
 }
Ejemplo n.º 17
0
 public Global_Direct_VariableInstance(string n, VariableInstance v) : base(n)
 {
     variable = v;
 }
Ejemplo n.º 18
0
 public abstract void PushToVariable(VariableInstance variable, TyonHydrater hydrater);
Ejemplo n.º 19
0
 public Global_Direct_VariableInstance(VariableInstance v) : this(v.GetVariable().GetVariableName(), v)
 {
 }
Ejemplo n.º 20
0
 public virtual void assertVariableMigratedToExecution(VariableInstance variableBefore, string executionId)
 {
     assertVariableMigratedToExecution(variableBefore, executionId, variableBefore.ActivityInstanceId);
 }
Ejemplo n.º 21
0
 public override void PushToVariable(VariableInstance variable, TyonHydrater hydrater)
 {
     hydrater.DeferProcess(delegate() {
         variable.SetContents(hydrater.ResolveInternalAddress(GetTyonAddress()));
     });
 }
Ejemplo n.º 22
0
        protected FieldVariable(VariableInstance variableInstance, FormControlScopeViewModel viewModel, ScopeResources scopeResources)
        {
            ScopeResources = scopeResources;
            Value = variableInstance.Variable.Value;
            ViewModel = viewModel;
            VariableInstance = variableInstance;
            _scopeText = ScopeResources.Text;

            ScopeResources.MachineSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
            ScopeResources.EnvironmentSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
            ScopeResources.RoleSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
            ScopeResources.ActionSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
        }
Ejemplo n.º 23
0
 public override void PushToVariable(VariableInstance variable, TyonHydrater hydrater)
 {
     variable.SetContents(hydrater.ResolveExternalAddress(GetTyonAddress()));
 }