Пример #1
0
        /// <param name = "handlerId">isid of the handler
        /// </param>
        /// <param name = "state">of the event task activitie
        /// </param>
        internal void addTaskFlowHandler(String handlerId, int state)
        {
            ActivityItem act;

            if (_enabled && _isTaskFlow)
            {
                act = new ActivityItem(this, ACT_TASK_FLW, FlowMonitorInterface.FLWMTR_TSK_HANDLER);

                String info;
                switch (state)
                {
                case FlowMonitorInterface.FLWMTR_START:
                    info = String.Format(S_HANDLER_STR, handlerId);
                    break;

                case FlowMonitorInterface.FLWMTR_END:
                    info = String.Format(E_HANDLER_STR, handlerId);
                    break;

                default:
                    info = null;
                    break;
                }

                if (info != null)
                {
                    // BRK_LEVEL_HANDLER_INTERNAL,BRK_LEVEL_HANDLER_SYSTEM,BRK_LEVEL_HANDLER_TIMER
                    // BRK_LEVEL_HANDLER_EXPRESSION,BRK_LEVEL_HANDLER_ERROR,BRK_LEVEL_HANDLER_USER
                    act.setInfo(info);
                }
                _queue.put(act);
            }
        }
Пример #2
0
        /// <summary>
        ///   add Activities to the queue
        /// </summary>
        /// <param name = "triggeredBy"></param>
        /// <param name = "state">of the event task activitie</param>
        internal void addTaskEvent(String triggeredBy, int state)
        {
            ActivityItem act;

            if (_enabled && _isTask)
            {
                act = new ActivityItem(this, ACT_TASK, FlowMonitorInterface.FLWMTR_EVENT);

                String info;
                switch (state)
                {
                case FlowMonitorInterface.FLWMTR_START:
                    info = S_EVENT_STR1 + triggeredBy + S_EVENT_STR2;
                    break;

                case FlowMonitorInterface.FLWMTR_END:
                    info = E_EVENT_STR + triggeredBy;
                    break;

                case FlowMonitorInterface.FLWMTR_PROPAGATE:
                    info = S_EVENT_PROPAGATED;
                    break;

                default:
                    info = null;
                    break;
                }

                act.setInfo(info);
                _queue.put(act);
            }
        }
Пример #3
0
        /// <param name = "id">is FLWMTR_CTRL_PREFIX or FLWMTR_CTRL_SUFFIX</param>
        /// <param name = "ctrlName"></param>
        /// <param name = "state">of the event task activitie</param>
        internal void addTaskFlowCtrl(int id, String ctrlName, int state)
        {
            ActivityItem act;

            if (_enabled && _isTaskFlow)
            {
                String info;
                switch (id)
                {
                case InternalInterface.MG_ACT_VARIABLE:
                    info = state == FlowMonitorInterface.FLWMTR_START
                            ? S_VARIABLE_STR
                            : E_VARIABLE_STR;
                    id = FlowMonitorInterface.FLWMTR_VARCHG_VALUE;
                    break;

                case InternalInterface.MG_ACT_CTRL_PREFIX:
                    info = state == FlowMonitorInterface.FLWMTR_START
                            ? S_CTRLPRF_STR
                            : E_CTRLPRF_STR;
                    id = FlowMonitorInterface.FLWMTR_CTRL_PREFIX;
                    break;


                case InternalInterface.MG_ACT_CTRL_SUFFIX:
                    info = state == FlowMonitorInterface.FLWMTR_START
                            ? S_CTRLSUF_STR
                            : E_CTRLSUF_STR;
                    id = FlowMonitorInterface.FLWMTR_CTRL_SUFFIX;
                    break;

                case InternalInterface.MG_ACT_CTRL_VERIFICATION:
                    info = state == FlowMonitorInterface.FLWMTR_START
                            ? S_CTRLVER_STR
                            : E_CTRLVER_STR;
                    id = FlowMonitorInterface.FLWMTR_CTRL_SUFFIX;
                    break;

                default:
                    info = null;
                    break;
                }

                act = new ActivityItem(this, ACT_TASK_FLW, id);
                if (info != null)
                {
                    info += ctrlName;
                    if (id == FlowMonitorInterface.FLWMTR_VARCHG_VALUE && state == FlowMonitorInterface.FLWMTR_START)
                    {
                        info += VARIABLE_REASON_STR;
                    }
                    act.setInfo(info);
                }
                _queue.put(act);
            }
        }
Пример #4
0
        /// <param name = "state">of the update
        /// </param>
        internal void addFlowOperationUpdate(int state)
        {
            ActivityItem act;

            if (_enabled && _isFlowOperation)
            {
                act = new ActivityItem(this, ACT_FLW_OPER, FlowMonitorInterface.FLWMTR_DATA_OPER); // MG_OPER_UPDATE
                if (state == FlowMonitorInterface.FLWMTR_START)
                {
                    act.setInfo(S_UPDATE_STR);
                }
                else
                {
                    act.setInfo(E_UPDATE_STR);
                }

                _queue.put(act);
            }
        }
Пример #5
0
        /// <summary>
        ///   Add a field flow operation activity item.
        /// </summary>
        /// <param name = "oper">The operation being logged.</param>
        /// <param name = "flowMode">The task's flow mode.</param>
        /// <param name = "flowDirection">The task's flow direction.</param>
        /// <param name = "bExecuted">Will the operation be executed.</param>
        internal void addFlowFieldOperation(Operation oper, Flow flowMode, Direction flowDirection, bool bExecuted)
        {
            if (_enabled && _isFlowOperation)
            {
                ActivityItem  act    = new ActivityItem(this, ACT_FLW_OPER, FlowMonitorInterface.FLWMTR_DATA_OPER);
                StringBuilder buffer = new StringBuilder(FLW_PERFIX);
                oper.AddFlowDescription(buffer);
                buffer.Append(' ');
                switch (flowMode)
                {
                case Flow.FAST:
                    if (flowDirection == Direction.FORE)
                    {
                        buffer.Append(FLW_FAST_FWD);
                    }
                    else if (flowDirection == Direction.BACK)
                    {
                        // FLOW_BACK
                        buffer.Append(FLW_FAST_BWD);
                    }
                    break;
                // We add nothing for FLOW_NONE

                case Flow.STEP:
                    if (flowDirection == Direction.FORE)
                    {
                        buffer.Append(FLW_STEP_FWD);
                    }
                    else if (flowDirection == Direction.BACK)
                    {
                        // FLOW_BACK
                        buffer.Append(FLW_STEP_BWD);
                    }
                    break;
                // For operation mode NONE we write STEP_FORWARD -
                // see FLWMTR_CTX::output_  case FLWMTR_DATA_OPER:

                case Flow.NONE:
                    buffer.Append(FLW_STEP_FWD);
                    break;

                default:
                    Logger.Instance.WriteExceptionToLog("FlowMonitorQueue.addFlowFieldOperation unknown flow mode " + flowMode);
                    return;
                }

                if (!bExecuted)
                {
                    buffer.Append(FLW_NOT_EXEC);
                }

                act.setInfo(buffer.ToString());
                _queue.put(act);
            }
        }
Пример #6
0
        /// <param name = "triggeredByVarName">var name , has triggered Recompute
        /// </param>
        internal void addRecompute(String triggeredByVarName)
        {
            ActivityItem act;

            if (_enabled && _isRecompute)
            {
                act = new ActivityItem(this, ACT_RECOMPUTE, FlowMonitorInterface.FLWMTR_RECOMP);
                act.setInfo(RECOMP_STR + triggeredByVarName);
                _queue.put(act);
            }
        }
Пример #7
0
        /// <summary>
        ///   add task flow for record prefix or sufix
        /// </summary>
        /// <param name = "id">is FLWMTR_PREFIX or FLWMTR_SUFFIX
        /// </param>
        /// <param name = "state">of the event task activitie
        /// </param>
        internal void addTaskFlowRec(int id, int state)
        {
            ActivityItem act;

            if (_enabled && _isTaskFlow)
            {
                String info;
                switch (id)
                {
                case InternalInterface.MG_ACT_REC_PREFIX:
                    info = state == FlowMonitorInterface.FLWMTR_START
                            ? S_RECPRF_STR
                            : E_RECPRF_STR;
                    id = FlowMonitorInterface.FLWMTR_PREFIX;
                    break;

                case InternalInterface.MG_ACT_REC_SUFFIX:
                    info = state == FlowMonitorInterface.FLWMTR_START
                            ? S_RECSUF_STR
                            : E_RECSUF_STR;
                    id = FlowMonitorInterface.FLWMTR_SUFFIX;
                    break;

                case InternalInterface.MG_ACT_TASK_PREFIX:
                    info = state == FlowMonitorInterface.FLWMTR_START
                            ? S_TASKPRF_STR
                            : E_TASKPRF_STR;
                    id = FlowMonitorInterface.FLWMTR_PREFIX;
                    break;

                case InternalInterface.MG_ACT_TASK_SUFFIX:
                    info = state == FlowMonitorInterface.FLWMTR_START
                            ? S_TASKSUF_STR
                            : E_TASKSUF_STR;
                    id = FlowMonitorInterface.FLWMTR_SUFFIX;
                    break;

                default:
                    info = null;
                    break;
                }

                act = new ActivityItem(this, ACT_TASK_FLW, id);
                act.setInfo(info);
                _queue.put(act);
            }
        }
Пример #8
0
        /// <summary>
        ///   user string passed to status line for actions
        /// </summary>
        /// <param name = "info">
        /// </param>
        private void addFlowInfo(String info)
        {
            if (!_enabled)
            {
                return;
            }

            ActivityItem  act    = new ActivityItem(this, ACT_FLW_OPER, FlowMonitorInterface.FLWMTR_DATA_OPER);
            StringBuilder buffer = new StringBuilder("");

            if (!info.Equals(""))
            {
                buffer.Append(INFORM_STR);
                buffer.Append(info);
            }
            act.setInfo(buffer.ToString());
            _queue.put(act);
        }
Пример #9
0
        ///<param name="contextID"></param>
        /// <param name = "newTaskMode">new task mode for the task</param>
        public void addTaskCngMode(Int64 contextID, char newTaskMode)
        {
            String       info = TSK_CHNG_MODE;
            ActivityItem act;

            if (_enabled && _isTask)
            {
                act = new ActivityItem(this, ACT_TASK, FlowMonitorInterface.FLWMTR_CHNG_MODE);

                switch (newTaskMode)
                {
                case Constants.TASK_MODE_MODIFY:
                    info += "Modify";
                    break;


                case Constants.TASK_MODE_CREATE:
                    info += "Create";
                    break;


                case Constants.TASK_MODE_DELETE:
                    info += "Delete";
                    break;


                case Constants.TASK_MODE_QUERY:
                    info += "Query";
                    break;


                default:
                    info = null;
                    break;
                }

                act.setInfo(info);
                _queue.put(act);
            }
        }