runUrl

runUrl(url: String, readerInputs: Dictionary<ReaderInput> = {}, inputValues: Dictionary<Any> = {}, configuration: RuntimeExecutionConfiguration = {}): RunSuccess | ExecutionFailure

Runs the script at the specified URL.

Experimental: This is an experimental feature that is subject to change or removal from future versions of DataWeave.

Parameters

Name Description

url

The name of the file to execute.

readerInputs

Inputs to read and bind to the execution.

inputValues

Inputs to be bind directly to the execution.

configuration

The runtime configuration.

Example

This example shows how runUrl behaves with different inputs.

Source

import * from dw::Runtime
var jsonValue = {
  value: '{"name": "Mariano"}' as Binary {encoding: "UTF-8"},
  encoding: "UTF-8",
  properties: {},
  mimeType: "application/json"
}

var Utils = "fun sum(a,b) = a +b"
---
{
  "execute_ok" : runUrl("classpath://org/mule/weave/v2/engine/runtime_runUrl/example.dwl", {"payload": jsonValue })
}

Output

{
   "execute_ok": {
     "success": true,
     "value": "\"Mariano\"",
     "mimeType": "application/dw",
     "encoding": "UTF-8",
     "logs": [

     ]
   }
 }

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub