...
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 |
---|---|
| Loads a file from the |
| Loads a property |
|
...
|
...
| Loads only the value of a property from the property store. |
| Executes the persisted pipeline at given location and returns the final body content as result. |
| Executes the persisted pipeline at given location, passes the given parameters |
| Returns the information object of the given user with given username. |
|
...
|
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 | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
pipeline: - resolve: uri: $uri:property:gloabl/app/myapp/config/app#title |
...
Info |
---|
In case you use the |
...
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):
...
language | json |
---|
Will return the property including metadata and value like this example:
Code Block | ||
---|---|---|
| ||
{ "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 | ||
---|---|---|
| ||
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: |
...
Code Block | ||
---|---|---|
| ||
{ "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.
...