Exemple #1
0
        /// <summary>
        /// Processes the Action item and returns the connection id of the next item in the flow.
        /// </summary>
        private string ProcessFlowAction(ActionFlowItem actionItem)
        {
            try
            {
                FireFlowItemInProgess(actionItem);

                if (!String.IsNullOrEmpty(actionItem.Contents))
                {
                    //FireFlowDebugMessage("Action: " + actionItem.Contents + CRLF);

                    // Executing flow diagram contents using Iron Python engine.
                    m_pythonEngine.Execute(actionItem.Contents);

                    // Read any output from the debug stream.
                    m_sipFlowDebugStream.Position = m_debugStreamPosition;
                    string debugOutput = m_debugStreamReader.ReadToEnd();
                    m_debugStreamPosition = m_sipFlowDebugStream.Position;

                    if (debugOutput != null && debugOutput.Trim().Length > 0)
                    {
                        FireFlowDebugMessage(DateTime.Now.ToString("dd MMM yyyy HH:mm:ss:fff") + CRLF + debugOutput);
                    }
                }

                // Return the flowid of the item connected downstream of this action item.
                return(actionItem.DownstreamFlowConnection.DestinationFlowItemId);
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPFlow ProcessFlowAction. " + excp.Message);
                throw excp;
            }
        }
        /// <summary>
        /// Processes the Action item and returns the connection id of the next item in the flow.
        /// </summary>
        private string ProcessFlowAction(ActionFlowItem actionItem)
        {
            try
            {
                FireFlowItemInProgess(actionItem);

                if (!String.IsNullOrEmpty(actionItem.Contents))
                {
                    //FireFlowDebugMessage("Action: " + actionItem.Contents + CRLF);

                    // Executing flow diagram contents using Iron Python engine.
                    m_pythonEngine.Execute(actionItem.Contents);

                    // Read any output from the debug stream.
                    m_sipFlowDebugStream.Position = m_debugStreamPosition;
                    string debugOutput = m_debugStreamReader.ReadToEnd();
                    m_debugStreamPosition = m_sipFlowDebugStream.Position;

                    if(debugOutput != null && debugOutput.Trim().Length > 0)
                    {
                        FireFlowDebugMessage(DateTime.Now.ToString("dd MMM yyyy HH:mm:ss:fff") + CRLF + debugOutput);
                    }
                }

                // Return the flowid of the item connected downstream of this action item.
                return actionItem.DownstreamFlowConnection.DestinationFlowItemId;
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPFlow ProcessFlowAction. " + excp.Message);
                throw excp;
            }
        }