|
| 1 | +$integration: http://ibm.com/appconnect/integration/v2/integrationFile |
| 2 | +integration: |
| 3 | + type: trigger-action |
| 4 | + trigger-interfaces: |
| 5 | + trigger-interface-1: |
| 6 | + type: event-trigger |
| 7 | + connector-type: azureservicebus |
| 8 | + triggers: |
| 9 | + CREATED: |
| 10 | + assembly: |
| 11 | + $ref: '#/integration/assemblies/assembly-1' |
| 12 | + input-context: |
| 13 | + data: Messages |
| 14 | + options: |
| 15 | + entityType: Queues |
| 16 | + entityType_Id: routingqueue |
| 17 | + parentFilter: |
| 18 | + entityType: Queues |
| 19 | + entityType_Id: routingqueue |
| 20 | + subscription: {} |
| 21 | + connectorServiceOptions: |
| 22 | + httpMethod: post |
| 23 | + path: >- |
| 24 | + resources/{entityType}/{entityType_Id}/Messages/operations/CREATED/subscribe |
| 25 | + action: created |
| 26 | + action-interfaces: |
| 27 | + action-interface-1: |
| 28 | + type: api-action |
| 29 | + business-object: Items |
| 30 | + connector-type: azurecosmosdb |
| 31 | + actions: |
| 32 | + getanItem: {} |
| 33 | + options: |
| 34 | + connectorServiceOptions: |
| 35 | + httpMethod: get |
| 36 | + path: >- |
| 37 | + resources/Database/{DatabaseId}/Container/{ContainerId}/Items/operations/getanItem |
| 38 | + action: retrieve |
| 39 | + action-interface-2: |
| 40 | + type: api-action |
| 41 | + business-object: Messages |
| 42 | + connector-type: azureservicebus |
| 43 | + actions: |
| 44 | + sendMessage: {} |
| 45 | + options: |
| 46 | + connectorServiceOptions: |
| 47 | + httpMethod: post |
| 48 | + path: >- |
| 49 | + resources/{entityType}/{entityType_Id}/Messages/operations/sendMessage |
| 50 | + action: create |
| 51 | + action-interface-3: |
| 52 | + type: api-action |
| 53 | + business-object: Messages |
| 54 | + connector-type: azureservicebus |
| 55 | + actions: |
| 56 | + acknowledgeMessage: {} |
| 57 | + options: |
| 58 | + connectorServiceOptions: |
| 59 | + httpMethod: post |
| 60 | + path: >- |
| 61 | + resources/{entityType}/{entityType_Id}/Messages/operations/acknowledgeMessage |
| 62 | + action: custom |
| 63 | + assemblies: |
| 64 | + assembly-1: |
| 65 | + assembly: |
| 66 | + execute: |
| 67 | + - parse: |
| 68 | + parse-format: json |
| 69 | + source: |
| 70 | + template: '{{$Trigger.body}}' |
| 71 | + input: |
| 72 | + - variable: Trigger |
| 73 | + $ref: '#/trigger/payload' |
| 74 | + - variable: flowDetails |
| 75 | + $ref: '#/flowDetails' |
| 76 | + sample-data: |- |
| 77 | + { |
| 78 | + "id":"abc", |
| 79 | + "container":"shipments", |
| 80 | + "message":"message to be send." |
| 81 | + } |
| 82 | + output-schema: |
| 83 | + $schema: http://json-schema.org/draft-04/schema# |
| 84 | + type: object |
| 85 | + properties: |
| 86 | + id: |
| 87 | + type: string |
| 88 | + container: |
| 89 | + type: string |
| 90 | + message: |
| 91 | + type: string |
| 92 | + title: Parsed JSON |
| 93 | + name: JSON Parser Parse |
| 94 | + - custom-action: |
| 95 | + name: Azure Cosmos DB Retrieve item by ID |
| 96 | + target: |
| 97 | + $ref: '#/integration/action-interfaces/action-interface-1' |
| 98 | + action: getanItem |
| 99 | + map: |
| 100 | + mappings: |
| 101 | + - ContainerId: |
| 102 | + template: '{{$JSONParserParse.container}}' |
| 103 | + - DatabaseId: |
| 104 | + template: DHL |
| 105 | + $map: http://ibm.com/appconnect/map/v1 |
| 106 | + input: |
| 107 | + - variable: Trigger |
| 108 | + $ref: '#/trigger/payload' |
| 109 | + - variable: JSONParserParse |
| 110 | + $ref: '#/node-output/JSON Parser Parse/response/payload' |
| 111 | + - variable: flowDetails |
| 112 | + $ref: '#/flowDetails' |
| 113 | + filter: |
| 114 | + where: |
| 115 | + and: |
| 116 | + - id: '{{$JSONParserParse.id}}' |
| 117 | + - ContainerId: '{{$JSONParserParse.container}}' |
| 118 | + - DatabaseId: SampleID |
| 119 | + input: |
| 120 | + - variable: Trigger |
| 121 | + $ref: '#/trigger/payload' |
| 122 | + - variable: JSONParserParse |
| 123 | + $ref: '#/node-output/JSON Parser Parse/response/payload' |
| 124 | + - variable: flowDetails |
| 125 | + $ref: '#/flowDetails' |
| 126 | + - custom-action: |
| 127 | + name: Azure Service Bus Send message |
| 128 | + target: |
| 129 | + $ref: '#/integration/action-interfaces/action-interface-2' |
| 130 | + action: sendMessage |
| 131 | + map: |
| 132 | + mappings: |
| 133 | + - body: |
| 134 | + template: >- |
| 135 | + {"message": {{$JSONParserParse.message}}, |
| 136 | + "data":{{$AzureCosmosDBRetrieveitembyID.Data}}} |
| 137 | + - entityType: |
| 138 | + template: '{{$AzureCosmosDBRetrieveitembyID.entityType}}' |
| 139 | + - entityType_Id: |
| 140 | + template: '{{$AzureCosmosDBRetrieveitembyID.entityId}}' |
| 141 | + $map: http://ibm.com/appconnect/map/v1 |
| 142 | + input: |
| 143 | + - variable: Trigger |
| 144 | + $ref: '#/trigger/payload' |
| 145 | + - variable: JSONParserParse |
| 146 | + $ref: '#/node-output/JSON Parser Parse/response/payload' |
| 147 | + - variable: AzureCosmosDBRetrieveitembyID |
| 148 | + $ref: >- |
| 149 | + #/node-output/Azure Cosmos DB Retrieve item by |
| 150 | + ID/response/payload |
| 151 | + - variable: flowDetails |
| 152 | + $ref: '#/flowDetails' |
| 153 | + filter: |
| 154 | + where: |
| 155 | + and: |
| 156 | + - entityType: '{{$AzureCosmosDBRetrieveitembyID.entityType}}' |
| 157 | + - entityType_Id: '{{$AzureCosmosDBRetrieveitembyID.entityId}}' |
| 158 | + input: |
| 159 | + - variable: Trigger |
| 160 | + $ref: '#/trigger/payload' |
| 161 | + - variable: JSONParserParse |
| 162 | + $ref: '#/node-output/JSON Parser Parse/response/payload' |
| 163 | + - variable: AzureCosmosDBRetrieveitembyID |
| 164 | + $ref: >- |
| 165 | + #/node-output/Azure Cosmos DB Retrieve item by |
| 166 | + ID/response/payload |
| 167 | + - variable: flowDetails |
| 168 | + $ref: '#/flowDetails' |
| 169 | + - logging: |
| 170 | + map: |
| 171 | + $map: http://ibm.com/appconnect/map/v1 |
| 172 | + input: |
| 173 | + - variable: Trigger |
| 174 | + $ref: '#/trigger/payload' |
| 175 | + - variable: JSONParserParse |
| 176 | + $ref: '#/node-output/JSON Parser Parse/response/payload' |
| 177 | + - variable: AzureCosmosDBRetrieveitembyID |
| 178 | + $ref: >- |
| 179 | + #/node-output/Azure Cosmos DB Retrieve item by |
| 180 | + ID/response/payload |
| 181 | + - variable: AzureServiceBusSendmessage |
| 182 | + $ref: >- |
| 183 | + #/node-output/Azure Service Bus Send |
| 184 | + message/response/payload |
| 185 | + - variable: flowDetails |
| 186 | + $ref: '#/flowDetails' |
| 187 | + mappings: |
| 188 | + - logLevel: |
| 189 | + template: Info |
| 190 | + - logMessage: |
| 191 | + template: '=====> locktoken???{{$Trigger.lockToken}}' |
| 192 | + name: Log |
| 193 | + - custom-action: |
| 194 | + name: Azure Service Bus Acknowledge a message |
| 195 | + target: |
| 196 | + $ref: '#/integration/action-interfaces/action-interface-3' |
| 197 | + action: acknowledgeMessage |
| 198 | + map: |
| 199 | + mappings: |
| 200 | + - acknowledgeType: |
| 201 | + template: Acknowledge and Delete |
| 202 | + - entityType: |
| 203 | + template: Queues |
| 204 | + - entityType_Id: |
| 205 | + template: routingqueue |
| 206 | + - lockToken: |
| 207 | + template: '{{$Trigger.lockToken}}' |
| 208 | + - messageIdOrSequenceNo: |
| 209 | + template: '{{$Trigger.messageId}}' |
| 210 | + $map: http://ibm.com/appconnect/map/v1 |
| 211 | + input: |
| 212 | + - variable: Trigger |
| 213 | + $ref: '#/trigger/payload' |
| 214 | + - variable: JSONParserParse |
| 215 | + $ref: '#/node-output/JSON Parser Parse/response/payload' |
| 216 | + - variable: AzureCosmosDBRetrieveitembyID |
| 217 | + $ref: >- |
| 218 | + #/node-output/Azure Cosmos DB Retrieve item by |
| 219 | + ID/response/payload |
| 220 | + - variable: AzureServiceBusSendmessage |
| 221 | + $ref: >- |
| 222 | + #/node-output/Azure Service Bus Send |
| 223 | + message/response/payload |
| 224 | + - variable: flowDetails |
| 225 | + $ref: '#/flowDetails' |
| 226 | + filter: |
| 227 | + where: |
| 228 | + and: |
| 229 | + - entityType: Queues |
| 230 | + - entityType_Id: routingqueue |
| 231 | + input: |
| 232 | + - variable: Trigger |
| 233 | + $ref: '#/trigger/payload' |
| 234 | + - variable: JSONParserParse |
| 235 | + $ref: '#/node-output/JSON Parser Parse/response/payload' |
| 236 | + - variable: AzureCosmosDBRetrieveitembyID |
| 237 | + $ref: >- |
| 238 | + #/node-output/Azure Cosmos DB Retrieve item by |
| 239 | + ID/response/payload |
| 240 | + - variable: AzureServiceBusSendmessage |
| 241 | + $ref: >- |
| 242 | + #/node-output/Azure Service Bus Send |
| 243 | + message/response/payload |
| 244 | + - variable: flowDetails |
| 245 | + $ref: '#/flowDetails' |
| 246 | + name: Route messages from Azure Service Bus queue to Cosmos DB then forward to another queue and acknowledge the message |
| 247 | +models: {} |
0 commit comments