Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update overview.md #4

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/user-guide/agents-protocols/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ Regular assets are connected to agents by adding an `Agent Link` configuration i
| `messageMatchPredicate` | Used in combination with the `messageMatchFilters`; the predicate is applied to inbound messages (after the `messageMatchFilters` have been applied) and if the predicate matches then the message is said to match the attribute and the attribute will be updated by passing the original message through the value filter(s) and converter | [ValuePredicate](https://github.com/openremote/openremote/blob/a58951f6780176163bad7f58f79ba2a12eb75eb6/model/src/main/java/org/openremote/model/query/filter/ValuePredicate.java) | N |
| `messageMatchFilters` | Used in combination with the `messageMatchPredicate` to allow filtering the inbound message before the match predicate is evaluated | [ValueFilter[]](https://github.com/openremote/openremote/blob/master/model/src/main/java/org/openremote/model/value/ValueFilter.java) | N |

### Dynamic Value Injection
Dynamic injection of the written or current attribute value is supported in generic protocols by using the dynamic value placeholder `%VALUE[:FORMAT]%`, this can be used in the `writeValue` of the `AgentLink` as well as in other supported places depending on the protocol, for example the HTTP protocol supports using this in the headers, query parameters and/or path. The `:FORMAT` is optional and uses the [java.util.Formatter](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Formatter.html), if not specified then built in value conversion is used to convert the value into a JSON string representation. e.g. `%VALUE:%.2f%`, `%VALUE%`

### Dynamic value injection
When writing to linked attributes it can be desirable to insert the written value into a bigger payload before sending to the agent protocol; the dynamic value placeholder `{$value}` makes this possible and every occurrence within the bigger payload is replaced by the value written to the linked attribute.
### Dynamic Time Injection
Dynamic injection of the current time is supported in generic protocols by using the dynamic time placeholder `%TIME[+/-PnDTnHnMn.nS][:FORMAT]%`, this can be used in the `writeValue` of the `AgentLink` as well as in other supported places depending on the protocol, for example the HTTP protocol supports using this in the headers, query parameters and/or path. The `+/-PnDTnHnMn.nS` and `:FORMAT` are optional where `+/-PnDTnHnMn.nS` uses [java.time.Durtion.parse()]([https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Formatter.html](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Duration.html#parse(java.lang.CharSequence))) and `:FORMAT` uses [DateTimeFormatter](https://docs.oracle.com/en%2Fjava%2Fjavase%2F22%2Fdocs%2Fapi%2F%2F/java.base/java/time/format/DateTimeFormatter.html) with added support for `EPOCH_MILLIS` and `EPOCH_SECONDS` if `:FORMAT` is not specified then [ISO_INSTANT](https://docs.oracle.com/en%2Fjava%2Fjavase%2F22%2Fdocs%2Fapi%2F%2F/java.base/java/time/format/DateTimeFormatter.html#ISO_INSTANT) is asssumed. e.g. `%TIME%`, `%TIME-PT1H%`, `%TIME+P20D:yyyy-dd-mm%`, `%TIME:EPOCH_MILLIS%`

### Value filter known types

Expand Down
Loading