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

Question

Question

My SDK doesn't work anymore from version 10.2 to 10.4

asked on September 30, 2019

Hi all,

 

Using Workflow and SDK (C# .NET) I created a script that allows me to automatically print documents.

This is my Script.

 

namespace WorkflowActivity.Scripting.Print
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;
    using System.Text;
    using Laserfiche.RepositoryAccess;
    using System.Diagnostics;
    using System.IO;

    public class Script1 : RAScriptClass102
    {
        protected override void Execute()
        {
            Process process = new Process();
            process.StartInfo.FileName = "C:\\Program Files (x86)\\Foxit Software\\Foxit Reader\\Foxit Reader.exe";
            process.StartInfo.Arguments = string.Format("-p \"" + GetTokenValue("File") + "\" \"gdn02ptr006\"");
            process.Start();
            process.WaitForExit();
        }
    }
}

I updated Laserfiche from 10.2 to 10.4 the week before and from this moment, my script doesn't work anymore.

 

I tried to make a new one and run the calc.exe.

namespace WorkflowActivity.Scripting.ScriptSDK
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;
    using System.Text;
    using Laserfiche.RepositoryAccess;
    using System.Diagnostics;

    /// <summary>
    /// Offre une ou plusieurs méthodes qui peuvent être exécutées au moment de l'exécution de l'activité de scriptage du flux de travail.
    /// </summary>
    public class Script1 : RAScriptClass104
    {
        /// <summary>
        /// Cette méthode est exécutée quand l'activité est effectuée.
        /// </summary>
        protected override void Execute()
        {

            Process process = new Process();
            process.StartInfo.FileName = "C:\\Windows\\System32\\calc.exe";
            process.Start();

        }
    }
}

This is strange because from the Script Editor, my Script is running correctly and my calc.exe is executed.

 

Do I have to change something?

Thanks for your help.

Regards

0 0

Answer

SELECTED ANSWER
replied on October 1, 2019

What doesn't work? Do you get an error?

The script that launches calculator is unlikely to work at runtime because it's trying to launch a window. When it's running in the Workflow Server service, there is no user session, so there's no place to launch a window.

1 0
replied on October 1, 2019

Hi Miruna,

 

The SDK run from Script Editor.

 

But not from the Workflow

 

I don't have error but the calc.exe doesn't launch.

 

 

The Laserfiche Workflow 10.2 service was launch as user.  But after change to 10.4, the service was was back to the service System local. I changed the service to open as user and now is ok.

 

 

Thank you very much.

 

Regard

0 0

Replies

replied on October 1, 2019

To your script, add a line to output your arguments value so you can verify with a track tokens activity that the arguments line is as expected.

SetTokenValue("Arguments", string.Format("-p \"" + GetTokenValue("File") + "\" \"gdn02ptr006\""));

You may also try explicitly telling it not to open in a Window

process..StartInfo.CreateNoWindow = true;

 

0 0
replied on October 1, 2019 Show version history

Does running "C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Reader.exe" -p "%File%" "gdn02ptr006" from the command line, replacing %File% with the value from the file token, on the server still work?

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

Sign in to reply to this post.