Presenting a Robot’s Work Progress

February 16, 2018 | Robotics

Robots Work Progress 1

Often while running their workflow, a robot will perform some processing in the background. When background processing takes a long time, it may be beneficial for the operator to have information about the volume of transactions already processed by the robot.
Presenting a Robot’s “progress” can be done in various ways (e.g. The robot opening a notepad and writing a new line for each transaction or step).

In this article we are presenting a more refined way to approach this: the Robot is using a named pipe communication to “broadcast” a structured message to a potentially listening server. The Robot will try to connect, but fall-back gracefully if no server is listening. For this purpose, we will develop a custom activity that receives progress information (e.g. Min, Max and Current progress bar values, text to be displayed). All parameters are structured as a JSON string that is sent to the server.

    public class ShowProgress : CodeActivity

    {

        [Category(“Input”)]

        [RequiredArgument]

        public InArgument<String> Label { get; set; }

        [Category(“Input”)]

        [RequiredArgument]

        public InArgument<Int32> Bar_Min { get; set; }

        [Category(“Input”)]

        [RequiredArgument]

        public InArgument<Int32> Bar_Max { get; set; }

        [Category(“Input”)]

        [RequiredArgument]

        public InArgument<Int32> Bar_Value { get; set; }

        protected override void Execute(CodeActivityContext context)

        {

            string label = Label.Get(context);

            Int32 bar_min = Bar_Min.Get(context);

            Int32 bar_max = Bar_Max.Get(context);

            Int32 bar_value = Bar_Value.Get(context);

            String msg = String.Format(“{{\”label\”:\”{0}\”,\”bar_min\”:{1},\”bar_max\”:{2},\”bar_value\”:{3}}}”,

                label,

                bar_min,

                bar_max,

                bar_value

            );

            NamedPipeClientStream pipeClient = new NamedPipeClientStream(“.”, “TImpactUiPath”,

                PipeDirection.InOut, PipeOptions.None,

                TokenImpersonationLevel.Impersonation);

            try

            {

                pipeClient.Connect(250);

                StreamString ss = new StreamString(pipeClient);

                ss.WriteString(msg);

                pipeClient.Close();

            }

            catch

            {

            }

        }

    }

The Robot will calculate the Min. and Max. values and will call the custom activity passing those parameters together with the current value of the background processing’s progress.

StreamString class details are presented in the article “How to: Use Named Pipes for Network Interprocess Communication” (link in References section)

In the next article we are going to present a sample Windows Forms application that will instantiate a named pipe server and display any received messages as visual representation of a “loading/filling/….” Progress bar.

Related Articles

7 ways in which the best law firms are attracting and retaining top talent

June 17, 2019 | Digital Transformation | Legal | Robotics

The best law firms understand that they have to treat their employees as customers, and that means really understanding what matters to them. This article will explore some of those key drivers and how the best firms are turning them to their advantage. 1 – Smart lawyers know that the future rests with the firms […]

The Six Factors Changing Local Government Forever

May 24, 2019 | Digital Transformation | Local Government | Robotics

Many Local Governments stand on the brink of bankruptcy after years of underfunding and budget cuts. Employees are overworked and underpaid, whilst Chief Executives are forced to make difficult decisions which affect the lives of their constituents. T-Impact have identified six key factors that are changing Local Government and senior staff need to adapt to […]

IBM & UiPath partner to offer the ultimate automation solution

May 15, 2019 | Digital Transformation | Robotics

IBM provides the world’s leading workflow solutions. Their business process management suite (BPMS) solution enables organisations to manage complex processes that span many organisations and IT systems. It supports processes that can run for long periods of time and provides dashboards to monitor and track processes, which is especially useful when there are numerous instances […]