Skip to content
DataMiner Dojo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Learn more about Agile
        • Agile Webspace
        • Everything Agile
          • The Agile Manifesto
          • Best Practices
          • Retro Recipes
        • Methodologies
          • The Scrum Framework
          • Kanban
          • Extreme Programming
        • Roles
          • The Product Owner
          • The Agile Coach
          • The Quality & UX Coach (QX)
      • Book your Agile Fundamentals training
      • Book your Kanban workshop
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Program
    • DataMiner DevOps Support
    • Feature Suggestions
  • Downloads
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

Automation script error from LCA: “interaction is required to execute this script”

148 views5 hours ago
5
MAXIMILIANO FILHO [DevOps Enabler]1.18K 4 days ago 0 Comments

Hello!

We have an interactive Automation script (BroadpeakSwitch) that works correctly when executed manually from DataMiner Cube, but fails when launched from a Low-Code App with the following error:

"Encountered errors while executing script: Error launching script: interaction is required to execute this script"

The full script is attached for your analysis. Could you please help us understand the cause of this error?

Thank you in advance.

Best regards,

Script:
namespace BroadpeakSwitch
{
    public class Script
    {
        public void Run(IEngine engine)
        {
            try
            {
                //engine.ShowUI();
                RunSafe(engine);
            }
            catch (Exception e)
            {
                engine.ExitFail($"Run|Something went wrong: {e.Message}");
            }
        }

        private static void RunSafe(IEngine engine)
        {
            engine.SetFlag(RunTimeFlags.NoKeyCaching);
            engine.Timeout = TimeSpan.FromHours(1);

....

            var app = new InteractiveController(engine);
            var navigation = new NavigationService(app, engine, switchService, request);
            navigation.Start(channels);
        }
    }

    ....

    public class NavigationService
    {
        private readonly InteractiveController _app;
        private readonly IEngine _engine;
        private readonly SwitchService _switchService;
        private readonly SwitchRequest _request;

        public NavigationService(InteractiveController app, IEngine engine, SwitchService switchService, SwitchRequest request)
        {
            _app = app;
            _engine = engine;
            _switchService = switchService;
            _request = request;
        }

        public void Start(IList<Channel> channels)
        {
            var dialog = new ConfirmationDialog(_engine, this, _switchService.ElementName, _request, channels);
            _app.ShowDialog(dialog);
        }

        public void ExecuteSwitch(IList<Channel> channels)
        {
            var result = _switchService.Execute(channels, _request.InputSource);
            _app.ShowDialog(new ResultDialog(_engine, this, result));
        }

        public void CloseApp(string message) => _engine.ExitSuccess(message);
    }

    /// <summary>
    /// Mostra o que os parâmetros pediram e aguarda confirmação. Não permite alterar a escolha.
    /// </summary>
    public class ConfirmationDialog : Dialog
    {
        private readonly Label _title = new Label("Confirm Switch") { Style = TextStyle.Title };
        private readonly TextBox _channelsBox = new TextBox { IsMultiline = true, Height = 150, Width = 400, IsReadOnly = true };
        private readonly Button _btnCancel = new Button("Cancel") { Width = 120 };
        private readonly Button _btnConfirm = new Button("Confirm") { Width = 120 };

        public ConfirmationDialog(IEngine engine, NavigationService nav, string elementName, SwitchRequest request, IList<Channel> channels) : base(engine)
        {
            Title = "Broadpeak - Confirm";

            string scope = request.IsAllChannels
                ? $"All channels ({channels.Count})"
                : $"Single channel: {channels[0].Name}";

            _channelsBox.Text = string.Join(Environment.NewLine, channels.Select(c => c.Name));

            AddWidget(_title, 0, 0, 1, 2);
            AddWidget(new Label("Element:"), 1, 0);
            AddWidget(new Label(elementName) { Style = TextStyle.Bold }, 1, 1);
            AddWidget(new Label("Scope:"), 2, 0);
            AddWidget(new Label(scope) { Style = TextStyle.Bold }, 2, 1);
            AddWidget(new Label("Target source:"), 3, 0);
            AddWidget(new Label(request.InputSource.ToUpperInvariant()) { Style = TextStyle.Bold }, 3, 1);

            int row = 4;
            if (request.IsAllChannels)
            {
                AddWidget(new Label("Affected channels:"), row++, 0, 1, 2);
                AddWidget(_channelsBox, row++, 0, 1, 2);
            }

            AddWidget(_btnCancel, row, 0);
            AddWidget(_btnConfirm, row, 1);

            _btnCancel.Pressed += (s, e) => nav.CloseApp("Switch cancelled by the user.");
            _btnConfirm.Pressed += (s, e) => nav.ExecuteSwitch(channels);
        }
    }

    public class ResultDialog : Dialog
    {
        private readonly Label _title = new Label("Operation Result") { Style = TextStyle.Title };
        private readonly Label _summary = new Label();
        private readonly TextBox _errorBox = new TextBox { IsMultiline = true, Height = 200, Width = 400, IsReadOnly = true };
        private readonly Button _btnClose = new Button("Finish") { Width = 120 };

        public ResultDialog(IEngine engine, NavigationService nav, SwitchResult result) : base(engine)
        {
            Title = "Broadpeak - Result";

            int successCount = result.Succeeded.Count;
            int errorCount = result.Errors.Count;

            _summary.Text = $"Target: {result.InputSource} | Success: {successCount} channel(s) | Errors: {errorCount}";

            AddWidget(_title, 0, 0, 1, 2);
            AddWidget(_summary, 1, 0, 1, 2);

            int row = 2;
            if (errorCount > 0)
            {
                _errorBox.Text = string.Join(Environment.NewLine, result.Errors);
                AddWidget(new Label("Error Logs:"), row++, 0, 1, 2);
                AddWidget(_errorBox, row++, 0, 1, 2);
            }

            AddWidget(_btnClose, row, 1);

            _btnClose.Pressed += (s, e) => nav.CloseApp(
                $"Switch to {result.InputSource} finished: {successCount} succeeded, {errorCount} failed.");
        }
    }
}

Peter Vanpoucke [SLC] [DevOps Advocate] Answered question 5 hours ago

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
0
Peter Vanpoucke [SLC] [DevOps Advocate]1.25K Posted 5 hours ago 0 Comments

Hi Maximiliano

From the code excerpt, it does indeed appear that the script is intended to be recognized as interactive. The reported launch error suggests that the Low-Code App may not be treating the script it starts as interactive, but the excerpt alone does not show why. Could you check that the Low-Code App references BroadpeakSwitch itself, rather than a different script or a wrapper script?

It is recommended to use the XML Interactivity setting, which is supported from DataMiner 10.5.9/10.6.0 onward. If your version supports it, add <Interactivity>Always</Interactivity> next to the <Name> element. Setting it explicitly is preferable to relying on the //engine.ShowUI(); hint comment. On older versions, the setting is not supported and automatic detection is used.

Let me know how it goes.

Kind regards

Peter Vanpoucke [SLC] [DevOps Advocate] Answered question 5 hours ago
You are viewing 1 out of 2 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Privacy Policy • Terms & Conditions • Contact

© 2026 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin