public class RecordmMsg extends Object
An instance of this class is accessible, in the scripts, through the binded variable called msg
.
Modifier and Type | Class and Description |
---|---|
class |
RecordmMsg.Field
Represents a field that may have been changed.
|
Constructor and Description |
---|
RecordmMsg(Map<String,Object> msg) |
Modifier and Type | Method and Description |
---|---|
RecordmMsg.Field |
field(String name)
Selects a field name for change detection.
|
Object |
get(String key)
Get one of the message's values.
|
String |
getAction()
Retrieves the action associated with this event.
|
String |
getDefinitionName()
Retrieves the definition name associated to this event.
|
Integer |
getDefinitionVersion()
Retrieves the instance definition version associated with this event.
|
Integer |
getId()
Retrieves the instance identifier associated with this event.
|
RecordmInstance |
getInstance()
Access to the instance in the message.
|
RecordmInstance |
getOldInstance()
Access to the old instance in an update message.
|
Map<String,Object> |
getRaw()
Get the raw representation of the messsage as a
Map |
Long |
getTimestamp()
Retrieves the timestamp associated with this event.
|
String |
getUser()
Retrieves the username of the user associated with this event.
|
String |
value(Function<Map<String,Object>,Boolean> predicate)
Shortcut method to get the first value of a field of the updated Instance.
|
String |
value(String name)
Shortcut method to get the first value of a field of the updated Instance.
|
Object |
value(String name,
Class aClass)
Shortcut method to get the first value of a field of the updated Instance.
|
List<String> |
values(String name)
Get all the values of fields with the specified name.
|
List<Object> |
values(String name,
Class aClass)
Get all the values of fields with the specified name.
|
public RecordmMsg.Field field(String name)
name
- the field nameRecordmMsg.Field
which can be used to test for changes to any field of this name.public String getAction()
The action represents the type of operation performed on an instance, and it can be one of the following values:
add
: Indicates that the event represents an addition or creation operation.update
: Indicates that the event represents an update or modification operation.delete
: Indicates that the event represents a deletion or removal operation.String
representing the action associated with the event. The possible values are "add", "update", or "delete".public String getDefinitionName()
String
representing the definition associated with the event.public Integer getDefinitionVersion()
Integer
representing the instance definition version associated with the event.public Integer getId()
Integer
representing the instance identifier associated with the event.public RecordmInstance getInstance()
RecordmInstance
public RecordmInstance getOldInstance()
RecordmInstance
public Long getTimestamp()
Long
representing the timestamp of the event, typically in milliseconds since the epoch.public String getUser()
String
representing the username of the user associated with the event.public String value(Function<Map<String,Object>,Boolean> predicate)
public String value(String name)
name
- the name of the fieldvalue(String, Class)
}
to get the value as a specific typepublic Object value(String name, Class aClass)
name
- the name of the fieldaClass
- the type to convert the field to.
See ${RecordmInstance.value(String, Class)
} for supported types.public List<String> values(String name)
name
- the name of the field(s)values(String, Class)
}
to get the values as a specific typepublic List<Object> values(String name, Class aClass)
name
- the name of the field(s)aClass
- the type to convert the field to.
See RecordmInstance.value(String, Class)
for supported types.Copyright © 2021 Cult Of Bits, lda