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

Question

Question

Using WorkflowConnection in the SDK Scripts to Invoke Remote Workflows

asked on May 24, 2019

I am attempting to start a workflow on an alternative server using the built in SDK options.

I created the following script inside the SDK Script activity and it runs without any error, but the workflow "Invoke Me" never starts.

If I copy the exact code over to Visual Studio, and add the references to the SDK DLL's it works and the workflow starts.

Has anyone ever successfully used this SDK method inside of the workflow SDK Script object?

namespace WorkflowActivity.Scripting.SDKScript
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;
    using System.Text;
    using Laserfiche.RepositoryAccess;
    using Laserfiche.Workflow;
    using Laserfiche.Workflow.Objects;

    /// <summary>
    /// Provides one or more methods that can be run when the workflow scripting activity is performed.
    /// </summary>
    public class Script1 : RAScriptClass102
    {
        /// <summary>
        /// This method is run when the activity is performed.
        /// </summary>
        protected override void Execute()
        {
            // Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
            string workflowServer = "batman";
            string workflowApplication = "Custom";

            using (WorkflowConnection connection = WorkflowConnection.CreateConnection(workflowServer, workflowApplication)){
                string workflowName = "Invoke Me";
                PublishedWorkflow workflowToStart = connection.Database.GetPublishedWorkflow(workflowName);
                Dictionary<string, string> parameters = new Dictionary<string, string>();
                parameters.Add("Test","123");
                workflowToStart.StartWorkflow(parameters);

            }
        }
    }
}

 

0 0

Replies

replied on May 24, 2019

Is there a reason you need to do this with an SDK script, or can you just use an Invoke Workflow activity pointed at a different server?

 

0 0
replied on May 24, 2019

I am using a 64-bit and 32-bit WF instances and I already tried this, but it does not work. No errors, it just never initiates the workflow after it states that it successfully does. I am looking for an alternative method.

0 0
replied on May 24, 2019 Show version history

I know this option can work, so my guess would be that whatever is preventing this method from working also preventing your script from working.

Maybe check the error logs on the receiving server to see if Workflow is logging anything for these requests.

These are asynchronous requests, and the fact that it is not generating an error inside the calling workflow suggests that the server is at least getting the request, which should help narrow down the possible source of the problem.

0 0
replied on July 24, 2023 Show version history

Hi,

May I know the DDL name and location for using Laserfiche.workflow.objects namespace 

Laserfiche.Workflow.Objects

or plz share me the verified URL to download this DLL

Thanks,

Vharsha.I

0 0
replied on July 24, 2023

These libraries are included with Workflow. 

1 0
replied on August 14

Hi Chad

 I’m currently facing the a similar issue and noticed the thread didn’t include a final solution.

Did you ever find the cause or a way to fix it? I’d really appreciate it if you could share your experience.

Best regards,

0 0
replied on August 15

Ah this was just too long ago, can't remember, sorry about that. I have moved away from working with any SDKs over the years and have found REST API's much easer to work with. Workflow includes a REST API for starting workflows and an activity for calling it, HTTP Post.

The endpoints are listed on the local server here

http://localhost/Workflow/api/help

Some useful information on this post as well

https://answers.laserfiche.com/questions/168986/Discussion-Will-Laserfiche-ever-get-a-unified-RESTful-HTTP-API#169285

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

Sign in to reply to this post.