Action
A representation of an FDC3 Action (specified via a Context or Context & Intent) that can be inserted inside another object, for example a chat message.
The action may be completed by calling:
fdc3.raiseIntent()with the specified Intent and Contextfdc3.raiseIntentForContext()if only a context is specified, (which the Desktop Agent will resolve by presenting the user with a list of available Intents for the Context).channel.broadcast()with the specified Context, if thebroadcastaction has been defined.
Accepts an optional app parameter in order to specify a specific app.
Schema
https://fdc3.finos.org/schemas/next/context/action.schema.json (github)
Type
fdc3.action
Properties
action
type: string with values:
broadcast,raiseIntent
The action field indicates the type of action:
- raiseIntent : If no action or
raiseIntentis specified, thenfdc3.raiseIntentorfdc3.raiseIntentForContextwill be called with the specified context (and intent if given). - broadcast : If
broadcastand achannelIdare specified thenfdc3.getOrCreateChannel(channelId)is called to retrieve the channel and broadcast the context to it withchannel.broadcast(context). If nochannelIdhas been specified, the context should be broadcast to the current channel (fdc3.broadcast())
title (required)
type: string
A human readable display name for the action
intent
type: string
Optional Intent to raise to perform the actions. Should reference an intent type name, such as those defined in the FDC3 Standard. If intent is not set then fdc3.raiseIntentForContext should be used to perform the action as this will usually allow the user to choose the intent to raise.
context (required)
type: Context
A context object with which the action will be performed
channelId
type: string
Optional channel on which to broadcast the context. The channelId property is ignored unless the action is broadcast.
app
type: api/AppIdentifier
An optional target application identifier that should perform the action. The app property is ignored unless the action is raiseIntent.
Examples
{
"type": "fdc3.action",
"action": "raiseIntent",
"title": "Click to view Chart",
"intent": "ViewChart",
"context": {
"type": "fdc3.chart",
"instruments": [
{
"type": "fdc3.instrument",
"id": {
"ticker": "EURUSD"
}
}
],
"range": {
"type": "fdc3.dateRange",
"starttime": "2020-09-01T08:00:00.000Z",
"endtime": "2020-10-31T08:00:00.000Z"
},
"style": "candle"
},
"app": {
"appId": "MyChartViewingApp",
"instanceId": "instance1"
}
}
{
"type": "fdc3.action",
"action": "broadcast",
"channelId": "Channel 1",
"title": "Click to view Chart",
"context": {
"type": "fdc3.chart",
"instruments": [
{
"type": "fdc3.instrument",
"id": {
"ticker": "EURUSD"
}
}
],
"range": {
"type": "fdc3.dateRange",
"starttime": "2020-09-01T08:00:00.000Z",
"endtime": "2020-10-31T08:00:00.000Z"
},
"style": "candle"
}
}