Skip to main content

How to pass a variable to a workflow coding in the html5 viewer

Comments

3 comments

  • Permanently deleted user

    Hi Dean,

    Yes it is possible to pass a variable into the workflow. To do so, the workflow must have one or more input arguments.

    When you are setting up your workflow you can call "getInputs" on the workflow to obtain the collection of input arguments.

    You can then find the desired argument in the collection and set its value.

    Example:

    var inputArgs = workflow.getInputs();

     

     

    for (var i = 0; i < inputArgs.length; i++) {

     

        var arg = inputArgs[i];

     

     

        if (arg.name === "myArgName") {

     

            arg.value = "myArgValue";

     

            break;

     

        }

     

    }

    Then, when you call startWorkflow, pass the inputs collection in as the third argument like so:

    geocortex.workflow.WorkflowControllerProxy.startWorkflow(workflow, dispatcher, inputArgs);

     

    Hope this helps!

    -Jason

    0
  • Permanently deleted user

    Looks good now how do I set up the input arguments for the workflow?  Is this a specific activity?

    My inputs for my workflows are blank not sure how to set this.  Basically I just want to send a string to the workflow.

    0
  • Permanently deleted user

    found it set the variable to be an argument thanks

    0

Please sign in to leave a comment.