Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In most locations where a URI is accepted as an argument, for example in commands or utils, you can apply such a PIPEFORCE URI.

Here are some examples of such common PIPEFORCE URIs:

URI

Description

$uri:drive:/someFolder/myFile.txt

Loads a file from the drive data room.

$uri:property:global/app/myapp/template/text

Loads a property value from the property store and also all property metadata such as uuid and created time for example.

$uri:property-value:global/app/myapp/

...

data/

...

1

Loads only the value of a property from the property store.

$uri:pipeline:global/app/myapp/pipeline/hello

Executes the persisted pipeline at given location and returns the final body content as result.

$uri:pipeline:global/app/myapp/pipeline/hello?firstName=Sam&lastName=Smith

Executes the persisted pipeline at given location, passes the given parameters firstName and lastName to it and returns the final body content as result. The parameters can be accessed via the vars scope inside the pipeline.

$uri:user:admin

Returns the information object of the given user with given username.

$uri:user:uuid=260e8400-e29b-11d4-a716

...

  • Returns the information object of the given user with given uuid.

Here is an example to apply a custom URI on a command:

...

In order to return only the value of a property, add a property filter with @ at the end (see below for more details about this). For exampleyou can use the $uri:property-value scheme instead:

Code Block
languageyaml
pipeline:
    - resolve:
        uri: $uri:property-value:gloabl/app/myapp/config/app@valueapp

This will the return only the value part of the property as JSON:

...

And if you would like return only the title text of the JSON property value, you can use the # symbol which filters the value of a property, in case it is a JSON document (more about this in the description for Property URI below)let you query the content of the returned JSON value by applying a PEL on it. For example:

Code Block
languageyaml
pipeline:
    - resolve:
        uri: $uri:property:gloabl/app/myapp/config/app#title

...

Info

In case you use the # symbol or any other reserved symbol as request parameter, you need to decode it before sending. AlternativelyOtherwise the server would strip it off. Alternatively, you can send the URI in a POST request, form-data encoded in the body. In this case, no encoding is required.

...

Code Block
pipeline:
  - body.set:
      value: "Content is: ${@resolve.uri('$uri:property-value:gloabl/app/myapp/config/app@valueapp')}"

PIPEFORCE URI Types

$uri:drive

...

Code Block
pipeline:
    - body.set:
        value: "${@resolve.uri('$uri:property:global/app/myapp/object/personconfig')}"

Property Filter

It is also possible to further filter the property using a PE, which gets applied to the property before its result will be returned.

Code Block
$uri:property:<PATH>@<PROPERTY_FILTER>

As you might already know, a property has a structure like this (envelope + value):

...

languagejson

Will return the property including metadata and value like this example:

Code Block
languagejson
{
    "pathchecksum": "/unique/path/of/the/propertysha-256=38334e50687bc68125e3b66121311a0bd1b848b8fa36c85dfe189d84313c5582",
    "uuidpath": "unique id",/pipeforce/ns/global/app/myapp/config/app",
    "typeuuid": "mime type of this property""cc059f6e-fa6a-4ad8-bc51-04a85e33b965",
    "locked": false,
    "createdtrashed": createdTimeStampInMillisfalse,
    "value": "The payload of the property",
    "attachments": [{ \"title\": \"My App\", ...}",
          {
       "defaultValue": null,
    "uuidtype": "unique idapplication/json",
       "created": 1669907722095,
    "nameupdated": "file name of the attachment"1671171893712,
    "timeToLive": null
}

$uri:property-value

This custom URI points to the value of a property in the property store:

Code Block
$uri:property-value:<PATH_OF_PROPERTY_IN_PROPERTY_STORE>

Example:

Code Block
pipeline:
     "size": bytes,
            "contentType": "content type of this attachment",
            "chunks": [
                {
                    "size": bytes,
                    "content": byteArray
                },
                ...
            ]
        },
        ...
    ]
    ...
}

For a full list of the attributes of a property, please refer to Property Store.

With a property URI filter, you can now select the part you would like to return in your URI:

Code Block
languageyaml
pipeline:
    - body.set:
- resolve: $uri:property-value:global/app/myapp/config

Will return the value of the property as JSON:

Code Block
{
    "title": "My App",
    "description": "This is my app",
    "icon": "assignment",
    "tags": [
       value: "Num. of attachments: ${@resolve.uri('$uri:property:global/app/myapp/object/person@created')}""myapp"
    ],
    ...
}

Value Filter (JSON)

In case the value of a property is of type application/json, you can apply a an expression filter on the value in order to return just a subset from the JSON value.:

Code Block
$uri:property-value:<PATH>#<VALUE_FILTER>
Info

This filter only works in case the value of the property is of the type: application/json!

...

Code Block
languagejson
{
    "path": "path/to/person",
    "type": "application/json",
    "value": {
        "name": "Max Master",
        "age": 35,
        "hobbies": [
            "swimming",
            "hiking"
        ]
    }
}

We can use a Value Filter value filter in the property URI in order to directly return the name of the person, like this:

Code Block
pipeline:
    - body.set:
        value: "Name: #{@resolve.uri('resolve: $uri:property-value:path/to/person#name')}"

Which will log return a message value like this:

Code Block
Name: Max Master

It's possible to use the full power of the PEL to filter, for example:

Code Block
pipeline:
    - body.set:
        value: "Number of hobbies: ${@resolve.uri('resolve: $uri:property-value:path/to/person#@list.size(hobbies)')}"

Which will log return a message value like this:

Code Block
Number of hobbies: 3

The value filter will be applied on the fully loaded properties property value attribute: It will be converted to JSON and then the expression will be applied, then the resulting value is returned.

...