/// <summary>
        /// Activity Constructor
        /// </summary>
        /// <param name="activity">activity</param>
        public MWFEventAudit(MWFActivity activity)
            : base(activity.GetCtx(), 0, activity.Get_TrxName())
        {
            SetAD_WF_Process_ID(activity.GetAD_WF_Process_ID());
            SetAD_WF_Node_ID(activity.GetAD_WF_Node_ID());
            SetAD_Table_ID(activity.GetAD_Table_ID());
            SetRecord_ID(activity.GetRecord_ID());
            SetAD_WF_Responsible_ID(activity.GetAD_WF_Responsible_ID());
            SetAD_User_ID(activity.GetAD_User_ID());
            SetWFState(activity.GetWFState());
            SetEventType(EVENTTYPE_ProcessCreated);
            SetElapsedTimeMS(Utility.Env.ZERO);
            MWFNode node = activity.GetNode();

            if (node != null && node.Get_ID() != 0)
            {
                String action = node.GetAction();
                if (MWFNode.ACTION_SetVariable.Equals(action) ||
                    MWFNode.ACTION_UserChoice.Equals(action))
                {
                    SetAttributeName(node.GetAttributeName());
                    //SetOldValue(String.valueOf(activity.getAttributeValue()));
                    SetOldValue(Util.GetValueOfString(activity.GetAttributeValue()));
                    if (MWFNode.ACTION_SetVariable.Equals(action))
                    {
                        SetNewValue(node.GetAttributeValue());
                    }
                }
            }
        }
        /// <summary>
        /// Get Node Name
        /// </summary>
        /// <returns>node name</returns>
        public String GetNodeName()
        {
            MWFNode node = MWFNode.Get(GetCtx(), GetAD_WF_Node_ID());

            if (node.Get_ID() == 0)
            {
                return("?");
            }
            return(node.GetName(true));
        }
Beispiel #3
0
        /// <summary>
        /// Get WF Node from Cache
        /// </summary>
        /// <param name="ctx">context</param>
        /// <param name="AD_WF_Node_ID">id</param>
        /// <returns>MWFNode</returns>
        public static MWFNode Get(Ctx ctx, int AD_WF_Node_ID)
        {
            int     key      = AD_WF_Node_ID;
            MWFNode retValue = _cache[key];

            if (retValue != null)
            {
                return(retValue);
            }
            retValue = new MWFNode(ctx, AD_WF_Node_ID, null);
            if (retValue.Get_ID() != 0)
            {
                _cache.Add(key, retValue);
            }
            return(retValue);
        }