コード例 #1
0
        public void AssignValue(ParameterManager processParameterManager, ParameterManager actionInParameterManager)
        {
            try
            {
                switch (ParameterBindType)
                {
                case ParameterBindType.ActionProcessBasicParameterBind:
                    /*StepAction.ActionInParameterManager*/
                    actionInParameterManager.SetBasicParamValue(ActionParameterName,
                                                                processParameterManager.GetBasicParam(ProcessParameterName).GetValue());
                    break;

                case ParameterBindType.ActionConstBasicParameterBind:
                    /*StepAction.ActionInParameterManager*/
                    actionInParameterManager[ActionParameterName].SetValueInString(ConstValueString);
                    break;

                case ParameterBindType.ActionProcessListParameterBind:
                    /*StepAction.ActionInParameterManager*/
                    actionInParameterManager.GetListParam(ActionParameterName)
                    .Replace(processParameterManager.GetListParam(ProcessParameterName));
                    /*ProcessInstance.ProcessParameterManager*/

                    break;

                case ParameterBindType.ActionProcessDictionaryParameterBind:
                    /*StepAction.ActionInParameterManager*/
                    actionInParameterManager.GetDictionaryParam(ActionParameterName).Replace(processParameterManager.GetDictionaryParam(ProcessParameterName));
                    break;

                case ParameterBindType.ActionProcessDictionaryBasicParameterBind:
                    break;

                case ParameterBindType.ActionProcessBasicDictionaryParameterBind:
                    break;

                case ParameterBindType.InvalidBind:
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
            catch (Exception e)
            {
                throw new InvalidOperationException($"InParameterBind数据赋值失败,{e.Message}");
            }
        }
コード例 #2
0
        public void AssignAction(ParameterManager processParameterManager)
        {
            //if (!_bindToResourceTemplate) return;
            var dictionaryParameter = processParameterManager.GetDictionaryParam(_bindingDictionaryName);

            var selectedResource = dictionaryParameter.GetValue(_bindKey).ToString();

            var resource = ActionsManagement.GetContainer(selectedResource);

            var baseAction = resource.GetAction(_actionName);

            Action = baseAction.Clone();
            Action.ActionContainer = baseAction.ActionContainer;

            Log.Info($"当前StepAction绑定的是Machine:[{selectedResource}]的Action:[{_actionName}].");
        }