You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Feature Request: Workflow Designer debugger

posted on April 18, 2016 Show version history

Currently in Workflow Designer there is a button (green triangle) on Toolbar that provides the ability to "run the current workflow". This provides the ability to start the workflow at any place and with input specified.

I was thinking what if we had the ability to run a workflow in "debug" mode. you then have the ability to run only one item in the workflow and see all tokens and everything else that goes with it for only that one item. Once happy it allows you to step to the next step. etc. This way you are debugging your workflow by working through it.

I would still like to see the current functionality where you run via toolbar, but added to that a debug mode.

Is there anybody else that believes that this will add value?

6 0
replied on May 2, 2017

Agreed!  I'm not the biggest fan of having to put in a bunch of logging code just to find out which line is bombing.

0 0
replied on November 13

How do put in logging code? Is there an activity for logging?

0 0
replied on November 13

Since this thread was started, Workflow added automatic tracking for tokens when an instance terminates.

For other purposes, you can add Track Tokens activities where you want to check your values to ensure they are what you expect. The values will be listed in the instance details.

You can also enable and disable activities if running just partial steps is desired.

You can have scripts record messages in the instance details at runtime by using the WorkflowAPI. Look at the TrackInformation, TrackWarning and TrackError methods.

protected override void Execute()
{
    // Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
    WorkflowApi.TrackInformation("Hello World!");
    WorkflowApi.TrackWarning("Warning! something unexpected but non-terminal happened.");
    WorkflowApi.TrackError("Something really bad happened, terminating the script now!");

0 0
replied on November 14 Show version history

Thanks @████████, yes I have seen the Track methods, thanks. I was thinking more of just an activity that allows similar functionality, but it's all good, the "track tokens" activity seems to be the best option outside of scripting.

If it's useful to anyone, I created this helper class to be able to use logging from within shared scripts (or any script that doesn't inherit from the workflow script base class):

using System;
using System.Collections.Generic;


public static class InfoLogger
{
  static Queue<string> _log = new Queue<string>();

  public static void LogInfo(this string message)
  {
    _log.Enqueue(message);
  }

  public static void LogInfo(this object obj)
  {
    _log.Enqueue(obj.ToString());
  }


  public static void PopulateInfoLog(this IWorkflowApi workflowApi)
  {
    foreach (var message in _log)
    {
      workflowApi.TrackInformation(message);
    }
  }
}

You can use the LogInfo() method to add messages to the log, then from within your workflow script you can call WorkflowAPI.PopulateInfoLog() to log messages in the order they were added .

0 0
replied on February 8, 2017

Yes, this will be helpful feature which we hope to see.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.