Question

How to pass User Parameters to WorkspaceRunner?

  • 26 March 2024
  • 9 replies
  • 83 views

Badge +14
  • Contributor
  • 120 replies

 

I have a parent WS that runs a load of WorkSpaceRunners. I want to pass on some User Parameters from the parent to the “kids”, see settings below. The child workspace is already setup with these User Parameters and run fine with them when run on their own. I have not been able to find any documentation on this, so the settings below are my best guesstimate. 

My steps are User Parameters in parent -› User Parameters in workspacerunner settings -› User Parameters set up in child workspace settings -› use them in child workspace.

So, how do I fix this?

  • Does the child WS need to be set up in a special way in order to pick up the incoming parameters?
  • Is there a misstake in the syntax?
  • Anything else I can look into?

 

 


9 replies

Userlevel 2
Badge +12

Create a User Parameter in the main-Workbench

e.g. SOMETHING and assign it in the WorkSpaceRunner:

 

Userlevel 6
Badge +32

Not sure if I understand your problem. What I do is:

  • Create the child workspace, define the parameters.
  • Create the parent workspace, add workspacerunner, select child workspace, and the parameters are there.
Badge +14

Not sure if I understand your problem. What I do is:

  • Create the child workspace, define the parameters.
  • Create the parent workspace, add workspacerunner, select child workspace, and the parameters are there.

This is almost what I did. In my case the parameters did not fill out in the Workspacerunner automatically, only the empty box was there. So I entered $(DATABASDATE) and the other one manually. I also created  the User Parameters in the parent workspace, should I not have done that?

Userlevel 6
Badge +32

Not sure if I understand your problem. What I do is:

  • Create the child workspace, define the parameters.
  • Create the parent workspace, add workspacerunner, select child workspace, and the parameters are there.

This is almost what I did. In my case the parameters did not fill out in the Workspacerunner automatically, only the empty box was there. So I entered $(DATABASDATE) and the other one manually. I also created  the User Parameters in the parent workspace, should I not have done that?

Sorry :) but you did not describe what the issue is?

Userlevel 4
Badge +13

Not sure if I understand your problem. What I do is:

  • Create the child workspace, define the parameters.
  • Create the parent workspace, add workspacerunner, select child workspace, and the parameters are there.

This is almost what I did. In my case the parameters did not fill out in the Workspacerunner automatically, only the empty box was there. So I entered $(DATABASDATE) and the other one manually. I also created  the User Parameters in the parent workspace, should I not have done that?

You do not need to create the same parameters in the parent as you did in the child. I normally use attribute values (coming from the initiating feature) to set the values of the parameters in the WorkspaceRunner.

For example I may have a list of states that I read into the parent workspace, and a state parameter in the child. The the parent then runs the child workspace once per state on the list, passing the state name/info into the child workspace’s parameters.

Badge +14

You do not need to create the same parameters in the parent as you did in the child. I normally use attribute values (coming from the initiating feature) to set the values of the parameters in the WorkspaceRunner.

 

This is how I usually do it. In parent save User Parameter-settings as attributes to file, open that file in child and pass attributes on to child-User Parameters if needed. (In this case the settings are links to files and folders)

This time I was giving it a new try to pass on the “settings” directly in the Workspacerunner, it has a dialogue for it after all… But for some reason I have never gotten this metod to work. Maybe it is not intended to work as I thought it would?

And by not work I mean that the child wp does not recive the settings i am trying to pass on, but when I run the child on its own and I fill out the User Parameters manually it runs fine.

Userlevel 5
Badge +25

Did you define $(DATABASDATE) as a parameter in the parent workspace as well? If not, then there’s no point in passing it to to the child workspace because it has no value.

Just so you know, the child parameters don’t need to be defined in the parent workspace. When you’re using a WorkspaceRunner to set them you can do that whichever way you like, so from attributes, or functions, or user parameters, or using the editors.

It’s best to see the WorkspaceRunner as a clone (or multiple) of yourself starting the child workspace with different parameters. But because that would be time consuming, you automate it.

Badge +14

My parent WP is only a ”container” that runs a dozen or so workspacerunners. There are a few “global settings” that I set manually with User Parameters in the parent and then pass on to the kidz. This works fine if I save a settings file that the child then reads. But there must be a way to pass a string that was manually entered as a User Parameter directly through the workspacerunner to the child? Since the child’s user parameters are exposed in the parent workspace I assumed so. But maybe no?

Userlevel 5
Badge +25

As said before; yes you can. It needs to be specified as a user parameter both in the parent and child workspaces (but it doesn't have to have the same name), it has to be set in the WorkspaceRunner and you can use more options than just a user parameter to set it.

So we can better help you: can you please share screenshots of:

  • The user parameters section of the child workspace
  • The user parameters section of the parent workspace
  • The WorkspaceRunner parameters

Reply