Ejemplo n.º 1
0
        public void Fire(TransEventArgs transEventArgs)
        {
            //EventHandle(transEventArgs);
            //isExecuted = true;

            //BpmContext bpmContext = transEventArgs.taskInstance.GetProcessInstance().GetContextInstance();
            //string sMsg = bpmContext.Msg.Message;
            //if (sMsg.Length == 0) bpmContext.Msg.Type = HOLDCore.MsgType.Success;
            //bpmContext.MsgDeal(sMsg, bpmContext.Msg.Type);
        }
Ejemplo n.º 2
0
        public void Fire(TransEventArgs transEventArgs)
        {
            //EventHandle(transEventArgs);
            //isExecuted = true;

            //BpmContext bpmContext = transEventArgs.taskInstance.GetProcessInstance().GetContextInstance();
            //string sMsg = bpmContext.Msg.Message;
            //if (sMsg.Length == 0) bpmContext.Msg.Type = HOLDCore.MsgType.Success;
            //bpmContext.MsgDeal(sMsg, bpmContext.Msg.Type);
        }
Ejemplo n.º 3
0
        private void EventHandle(TransEventArgs transEventArgs)
        {
            var actionType = eventAction.ActionType;
            var strCls     = eventAction.Class;
            var strMethod  = eventAction.Method;
            var strVars    = eventAction.VarNames;

            switch (actionType)
            {
            case ActionType.Class:
                var type       = Assembly.Load(strCls.Substring(0, strCls.IndexOf('.'))).GetType(strCls);
                var instance   = Activator.CreateInstance(type);
                var methodInfo = type.GetMethod(strMethod);

                //var param = new object[] { taskEventArgs };

                #region for HOLDFrameWork
                //将变量转换处理
                var varType       = Assembly.Load("HOLDCommon").GetType("HOLDCommon.ZephyrCommon");
                var varInstance   = Activator.CreateInstance(varType);
                var varMethodInfo = varType.GetMethod("ExcuteTransParam");
                var varParam      = new object[] { transEventArgs, strVars };
                var param         = varMethodInfo.Invoke(varInstance, varParam) as object[];

                #endregion

                methodInfo.Invoke(instance, param);
                break;

            case ActionType.Common:
                strCls = GetCommonClass();
                var typeCommon       = Assembly.Load(strCls.Substring(0, strCls.IndexOf('.'))).GetType(strCls);
                var instanceCommon   = Activator.CreateInstance(typeCommon);
                var methodInfoCommon = typeCommon.GetMethod(strMethod);
                var paramCommon      = new object[] { transEventArgs };

                methodInfoCommon.Invoke(instanceCommon, paramCommon);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 4
0
        private void EventHandle(TransEventArgs transEventArgs)
        {
            var actionType = eventAction.ActionType;
            var strCls = eventAction.Class;
            var strMethod = eventAction.Method;
            var strVars = eventAction.VarNames;

            switch (actionType)
            {
                case ActionType.Class:
                    var type = Assembly.Load(strCls.Substring(0, strCls.IndexOf('.'))).GetType(strCls);
                    var instance = Activator.CreateInstance(type);
                    var methodInfo = type.GetMethod(strMethod);

                    //var param = new object[] { taskEventArgs };   

                    #region for HOLDFrameWork
                    //将变量转换处理
                    var varType = Assembly.Load("HOLDCommon").GetType("HOLDCommon.ZephyrCommon");
                    var varInstance = Activator.CreateInstance(varType);
                    var varMethodInfo = varType.GetMethod("ExcuteTransParam");
                    var varParam = new object[] { transEventArgs, strVars };
                    var param = varMethodInfo.Invoke(varInstance, varParam) as object[];

                    #endregion

                    methodInfo.Invoke(instance, param);
                    break;
                case ActionType.Common:
                    strCls = GetCommonClass();
                    var typeCommon = Assembly.Load(strCls.Substring(0, strCls.IndexOf('.'))).GetType(strCls);
                    var instanceCommon = Activator.CreateInstance(typeCommon);
                    var methodInfoCommon = typeCommon.GetMethod(strMethod);
                    var paramCommon = new object[] { transEventArgs };

                    methodInfoCommon.Invoke(instanceCommon, paramCommon);
                    break;
                default:
                    break;
            }
        }