0

My urban code process has a property called 'url'.
The process also has a 'Run Groovy Script' step in it. This script builds a string.

def url = 'http://localhost:8443/dosomething'

What is the syntax for setting this value to the process 'url' property?

A j
  • 1,069
  • 2
  • 16
  • 29

1 Answers1

2

Assume that you have a component or generic process with two steps.

The first step, "Run Groovy Script," is a Groovy step. Its Groovy code looks like this:

String targetUrl = 'http://localhost:8443/dosomething'
outProps.put("url", targetUrl)

That second line creates an output property named "url" that later steps can use.

In the second step, you can use ${p:Run Groovy Script/url} to refer to that property. You can use that code either in the step properties or in code such as Groovy or Shell scripts.

Edit: It occurs to me that you might be asking how to set a process property, not an output property. You can do that by first creating the output property as in the code before. Then, add a Set Process Request Property step and use the ${p:Run Groovy Script/url} reference to set the property value. Here's a screencap of what that step might look like:

The step properties for the Set Process Request Property step

Tim McMackin
  • 199
  • 1
  • 8