Create and deploy an A2A flow

This example demonstrates how to create and deploy a flow with an application as the source, a Transfer CFT as a relay, and a group as the target, and is comprised of the following steps:

  • Create and deploy a flow with the Product catalog application as the source, and the Stores group as the target. Details
  • Add a new application to the Stores group and redeploy the flow. Details
  • Add a Transfer CFT relay and redeploy the flow. Details
Note API commands for flows with Transfer CFT support the following properties:

Central Governance prior to 1.1.3 SP2 at Source or Target > properties level.

Central Governance 1.1.3 SP2 and higher:

  • GET retrieves properties at the Source or Target > step > commonProperties level.
  • For backwards compatibility, POST and PUT support both properties at the Source or Target > properties level, and at the Source or Target > step > commonProperties level.
Variable Description
{{Appl_name-Product_catalog}} The name of the source application (Product catalog)
{{Appl_host-Product_catalog}} The host name of the Product catalog application
{{CFT_ID-Product_catalog_appl}} Business id of Transfer CFT linked to the Product catalog application

{{CFT_name-Product_catalog_appl}}

The name of the Transfer CFT linked to the Product catalog application

{{Appl_name-Store1_appl}} The name of the first application in the Stores1 target group
{{Appl_host-Store1_appl}} The host name of the Store1 application
{{CFT_ID-CFT_Store1_appl}} Business id of Transfer CFT linked to the Store1 application
{{CFT_name-Store1_appl}} The name of the Transfer CFT linked to the Store1 application
{{Appl_name-Store2_appl}} The name of the second application in the Store2 target group
{{Appl_host-Store2_appl}} The host name of the Store2 application
{{CFT_ID-Store2_appl}} Business id of Transfer CFT linked to Store1 application
{{CFT_ID-Relay}} Business id of Transfer CFT used as relay in the flow
{{CFT_name-Relay}} The name of the Transfer CFT used as relay in the flow
{{Group_ID-Stores}} Business id of application group Stores
{{Group_name-Stores}} The name of the group used as target in the flow
{{Flow_ID-Product_list}} Business id of the Product list flow
{{Protocol_1_IDF-Product_list_flow}} First protocol in the Product list flow
{{Protocol_2_IDF-Product_list_flow}} Second protocol in the in the Product list flow

Create and deploy a flow

The example in this section demonstrates how to create and deploy a flow with the Product catalog as the source, and the Stores as group the target.

Create an application called "Product catalog".

POST /api/v2/applications

{

"name": "Product catalog",

"host": "{{Appl_host-Product_catalog}}"

}

Retrieve applications whose names contain the word "catalog".

GET /api/v2/applications?name=%catalog%

The Product catalog application has the businessId = {{Appl_ID-Product_catalog}}.

Get Transfer CFTs that are registered with Central Governance.

GET /api/v2/products?type=”Transfer%20CFT”

The following Transfer CFTs are retrieved:

  • {{CFT_ID-Product_catalog_appl}}
  • {{CFT_ID-Store1_appl}}
  • {{CFT_ID-Store2_appl}}
  • {{CFT_ID-Relay}}

Link the {{CFT_name-Product_catalog_appl}} product to the "Product catalog" application.

POST /api/v2/applications//{{Appl_ID-Product_catalog}}/products/{{CFT_ID-Product_catalog_appl}}

No additional definition is required.

Create an application called "Store1" in the "Stores" group. The Stores group is created as well with this operation.

POST /api/v2/applications

{

"name": "Store1",

"host": "{{Appl_host-Store1}}",

"groups":[ {"name": "Stores"} ],

"productTypes": [ "Transfer CFT" ],

"products":[

{

"name": "{{CFT_name-Store1_appl}}"

}

]

}

Get the "Stores" businessId.

GET /api/v2/applicationgroups?name=Stores

The Stores application group has the businessId = {{Group_ID-Stores_group}}.

Create a flow with no source or target.

POST /api/v2/flows

{ "name": "Product list" }

Get the "Product list" flow businessId.

GET /api/v2/flows?name=Product%20list

The "Product list" flow has the businessId = {{Flow_ID-Product_list}}.

Add a source application with default source properties.

PUT /api/v2/flows/{{Flow_ID-Product_list}}/sources

{

"type": "APPLICATION",

"parts":

[

{

"part":

{

"name": "{{Appl_name-Product_catalog}}",

"host": "{{Appl_host-Product_catalog}}"

},

"selectedLinks":

[

{

"name": "{{CFT_name-Product_catalog_appl}}"

}

]

}

],

"step": {

"commonProperties": {

"transfer": {

"implicitSend": true,

"transferPriority": "128",

"customTransferPriorityEnabled": false,

"bandwidth": "MEDIUM",

"transferState": "DISP",

"userId": "",

"idOfFileSender": "",

"idOfFileReceiver": "",

"detectDuplicateTransfers": "",

"fileNotFound": "ABORT",

"fileModificationDuringTransfer": "SHR",

"actionAfterTransfer": "NONE",

"additionalInformation": "",

"description": "",

"purgeCompletedTransfer": "NO",

"maxDuration": "0",

"serializationPhase": " ",

"enableActivationPeriod": "NO",

"minDate": "",

"minTime": "",

"maxDate": "",

"maxTime": "",

"visibilityMessageLevel": "DEFAULT",

"enableDistribution": "NO",

"distributionListName": "",

"distributionListFileUsage": "upload_file",

"distributionListFileName": "",

"distributionUnknown": "ABORT",

"enableCustomProperties": false,

"fileDeletionOnPurge": []

},

"file": {

"physicalFile": "File",

"path": "",

"workingDir": "",

"fileList": "",

"archiveName": "",

"sentFileName": "",

"storageAccount": "",

"fileType": "Binary",

"fileTypeOS400": "D",

"fileTypeZOS": "auto",

"fileTypeHPNonStop": "B",

"recordFormat": " ",

"endOfRecordChar": "Both",

"ignoreEOFChar": false,

"encoding": "ascii",

"encodingCharset": "",

"transcoding": "none",

"transcodingCharset": "",

"transcodingTable": "",

"encodingOS400": "ebcdic",

"encodingOS400Charset": "",

"transcodingOS400": "none",

"transcodingOS400Charset": "",

"transcodingOS400Table": "",

"encodingZOS": "ebcdic",

"encodingZOSCharset": "",

"transcodingZOS": "none",

"transcodingZOSCharset": "",

"transcodingZOSTable": "",

"encodingHPNonStop": "ascii",

"encodingHPNonStopCharset": "",

"transcodingHPNonStop": "none",

"transcodingHPNonStopCharset": "",

"transcodingHPNonStopTable": "",

"unpaddingChar": "",

"maxRecordLength": "0",

"defaultMaxRecordLength": true,

"filter": "",

"filterType": "NONE",

"enableCustomProperties": false

},

"script": {

"preProcessingApplyToDistribList": "DEST",

"preProcessingFileContent": "",

"preProcessingFileName": "",

"preProcessingFileUsage": "existing_file",

"preProcessingState": "DISP",

"preScript": "none",

"postProcessingApplyToDistribList": "DEST",

"postProcessingApplyToGroup": "LIST",

"postProcessingFileContent": "",

"postProcessingFileName": "",

"postProcessingFileUsage": "existing_file",

"postProcessingState": "DISP",

"postScript": "default",

"acknowledgementApplyToDistribList": "DEST",

"acknowledgementApplyToGroup": "FILE",

"acknowledgementFileContent": "",

"acknowledgementFileName": "",

"acknowledgementFileUsage": "existing_file",

"acknowledgementScript": "default",

"acknowledgementState": "IGNORE",

"errorFileContent": "",

"errorFileName": "",

"errorFileUsage": "existing_file",

"errorScript": "default",

"preProcessingFileContent_button": "Browse",

"postProcessingFileContent_button": "Browse",

"acknowledgementFileContent_button": "Browse",

"errorFileContent_button": "Browse",

"enableCustomProperties": false,

"apply": "Apply",

"resetProperties": "Restore default values",

"cancel": "Cancel"

}

},

"middlewareIds": [

"{{CFT_name-Product_catalog_appl}}"

],

"routes": [],

"propertiesForSources": [],

"propertiesForTargets": []

}

}

Add a target application group with default target properties.

PUT /api/v2/flows/{{Flow_ID-Product_list}}/targets

{

"type": "GROUP",

"parts": [

{

   "part": {

      "name": "{{Group_name-Stores}}"

    }

  }

],

"step": {

"commonProperties": {

"transfer": {

"bandwidth": "MEDIUM",

"transferState": "DISP",

"userId": "",

"idOfFileSender": "",

"idOfFileReceiver": "",

"detectDuplicateTransfers": "",

"fileNotFound": "ABORT",

"noFileExistsCreationRule": "CREATE",

"fileExistsCreationRule": "DELETE",

"abortedTransfer": "KEEP",

"maxDuration": "0",

"serializationPhase": " ",

"purgeCompletedTransfer": "NO",

"description": "",

"enableActivationPeriod": "NO",

"minDate": "",

"minTime": "",

"maxDate": "",

"maxTime": "",

"visibilityMessageLevel": "DEFAULT",

"enableDistribution": "NO",

"distributionListName": "",

"distributionListFileUsage": "upload_file",

"distributionListFileName": "",

"distributionUnknown": "ABORT",

"enableCustomProperties": false,

"fileDeletionOnPurge": []

},

"file": {

"fileType": "Binary",

"fileTypeOS400": "D",

"fileTypeZOS": "auto",

"fileTypeHPNonStop": "B",

"attsuserHPNonStop": "",

"recordFormat": " ",

"endOfRecordChar": "Both",

"ignoreEOFChar": false,

"encoding": "ascii",

"encodingCharset": "",

"transcoding": "none",

"transcodingCharset": "",

"transcodingTable": "",

"encodingOS400": "ebcdic",

"encodingOS400Charset": "",

"transcodingOS400": "none",

"transcodingOS400Charset": "",

"transcodingOS400Table": "",

"encodingZOS": "ebcdic",

"encodingZOSCharset": "",

"transcodingZOS": "none",

"transcodingZOSCharset": "",

"transcodingZOSTable": "",

"encodingHPNonStop": "ascii",

"encodingHPNonStopCharset": "",

"transcodingHPNonStop": "none",

"transcodingHPNonStopCharset": "",

"transcodingHPNonStopTable": "",

"unpaddingChar": "",

"maxRecordLength": "0",

"defaultMaxRecordLength": true,

"targetFileName": "pub/&IDF.&IDTU.&FROOT.RCV",

"workingDir": "",

"temporaryFile": "",

"storageAccount": "",

"receivingFileSize": "0",

"enableCustomProperties": false

},

"script": {

"preProcessingApplyToDistribList": "DEST",

"preProcessingFileContent": "",

"preProcessingFileName": "",

"preProcessingFileUsage": "existing_file",

"preProcessingState": "DISP",

"preScript": "none",

"postProcessingApplyToDistribList": "DEST",

"postProcessingApplyToGroup": "",

"postProcessingFileContent": "",

"postProcessingFileName": "",

"postProcessingFileUsage": "existing_file",

"postProcessingState": "DISP",

"postScript": "default",

"acknowledgementApplyToDistribList": "DEST",

"acknowledgementApplyToGroup": "",

"acknowledgementFileContent": "",

"acknowledgementFileName": "",

"acknowledgementFileUsage": "existing_file",

"acknowledgementScript": "default",

"acknowledgementState": "IGNORE",

"errorFileContent": "",

"errorFileName": "",

"errorFileUsage": "existing_file",

"errorScript": "default",

"postProcessingFileContent_button": "Browse",

"acknowledgementFileContent_button": "Browse",

"errorFileContent_button": "Browse",

"enableCustomProperties": false,

"apply": "Apply",

"resetProperties": "Restore default values",

"cancel": "Cancel"

}

},

"middlewareIds": [

"{{CFT_name_Store1_appl}}"

],

"routes": [],

"propertiesForSources": [],

"propertiesForTargets": []

}

}

Set the flow protocol between source and target.

PUT /api/v2/flows/{{Flow_ID-Product_list}}/protocol/1

{

"protocol": "PESIT",

"direction": "SENDER_PUSH_FILE",

"properties": {

   "securityProfile": "NONE",

   "networkProtocol": "TCP",

   "defaultIdentifier": "{{Protocol_1_IDF-Product_list_flow}}"

}

}

Deploy the flow using the flow business id in the body of the API request.

POST /api/v2/flows/deploybox["{{Flow_ID-Product_list}}" ]

Get the deployment status for each Transfer CFT in a flow.

GET /api/v2/flows/{{Flow_ID-Product_list}}/products

{

"name": "{{CFT_name-Product_catalog_appl}}",

"businessId": "{{CFT_ID-Product_catalog_appl}}",

"lastDeploymentStatus": "Deployed",

"flowId": "{{Flow_ID-Product_list}}"

},

{

"name": "{{CFT_name-Store1_appl}}",

"businessId": "{{CFT_ID-Store1_appl}}",

"lastDeploymentStatus": "Deployed",

"flowId": "{{Flow_ID-Product_list}}"

}

Add an application and redeploy

Add a new application to the Stores group and redeploy the flow.

Create the Store2 application.

POST /api/v2/applications

{

"name": "Appl_name-Store2",

"host": "{{Appl_host-Store2}}",

"productTypes": [ "Transfer CFT" ],

"groups":[ ],

"products":[

"name": "{{CFT_name-Store2_appl}}"

}

]

}

Retrieve the Store2 application's business id.

GET /api/v2/applications?name=Store2

The Store2 application has the businessId = {{CFT_ID-Store2_appl}}.

Add the Store2 application to the Stores group. Set _forced=true so that the flow that contains the group is updated.

POST /api/v2/applicationgroups/{{Group_ID-Stores_group}}/applications/{{CFT_ID-Store2_appl}}?_forced=true

Get the deployment status for each Transfer CFT in a flow.

GET /api/v2/flows/{{Flow_ID-Product_list}}/products

{

"name": "{{CFT_name-Product_catalog_appl}}",

"businessId": "{{CFT_ID-Product_catalog_appl}}",

"lastDeploymentStatus": "Deployed",

"flowId": "{{Flow_ID-Product_list}}"

},

{

"name": "{{CFT_name-Store1_appl}}",

"businessId": "{{CFT_ID-Store1_appl}}",

"lastDeploymentStatus": "Deployed",

"flowId": "{{Flow_ID-Product_list}}"

},

{

"name": "{{CFT_name-Store2_appl}}",

"businessId": "{{CFT_ID-Store2_appl}}",

"lastDeploymentStatus": "NotDeployed",

"flowId": "{{Flow_ID-Product_list}}"

}

Redeploy the flow using the flow's business id in the body of the API request.

POST /api/v2/flows/deploybox

["{{Flow_ID-Product_list}}"]

Get the deployment status for each Transfer CFT in a flow.

GET /api/v2/flows/{{Flow_ID-Product_list}}/products

All Transfer CFTs have the Deployed status.

Add a Transfer CFT relay and redeploy the flow

Add a Transfer CFT as a relay in the flow.

POST /api/v2/flows/{{Flow_ID-Product_list}}/relays

{

"product" : {

"name" : "{{CFT_name-Relay}}",

}

}

The properties of the protocol source-target and now set to the protocol source-relay. The business id of the protocol source-relay is 1 and the business id of the protocol relay-target is 2.

Set the flow protocol between relay and target.

PUT /api/v2/flows/{{Flow_ID-Product_list}}/protocol/2

{

"protocol": "PESIT",

"direction": "SENDER_PUSH_FILE",

"properties": {

"securityProfile": "NONE",

"networkProtocol": "TCP",

"defaultIdentifier": "{{Protocol_2_IDF-Product_list}}"

}

}

Redeploy the flow by giving the flow business id in the body of the API request.

POST /api/v2/flows/deploybox

["{{Flow_ID-Product_list}}"]

Get the deployment status for each Transfer CFT in a flow.

GET /api/v2/flows/{{Flow_ID-Product_list}}/products

All Transfer CFTs have the Deployed status.

 

Central Governance | Document Directory

Related Links