This activity allows you to use a global counter.
flogo install github.com/project-flogo/contrib/activity/counter
Name | Type | Description |
---|---|---|
counterName | string | The name of the counter - REQUIRED |
op | string | The counter operation, ‘get’ is the default operation |
Name | Type | Description |
---|---|---|
value | int | The result of the counter operation |
The below example increments a ‘messages’ counter:
{
"id": "increment_message_count",
"name": "Increment Message Count",
"activity": {
"ref": "github.com/project-flogo/contrib/activity/counter",
"settings": {
"counterName": "messages",
"op": "increment"
}
}
}
The below example retrieves the last value of the ‘messages’ counter:
{
"id": "get_message_count",
"name": "Get Message Count",
"activity": {
"ref": "github.com/project-flogo/contrib/activity/counter",
"settings": {
"counterName": "messages",
"op": "get"
}
}
}
The below example resets the ‘messages’ counter:
{
"id": "reset_message_count",
"name": "Reset Message Count",
"activity": {
"ref": "github.com/project-flogo/contrib/activity/counter",
"settings": {
"counterName": "messages",
"op": "reset"
}
}
}