Taskflows > Taskflows > Modifying taskflow attributes with the update resource
  

Modifying taskflow attributes with the update resource

If you are assigned the Administrator, Deployer, Designer, or Operator role, you can use the update resource to update the values of the API Name, Allowed Users, and Allowed Groups fields of a taskflow.
Use the request body to pass the values. The updates can be applied to one or more taskflows using the update resource.
To perform the updates, use the following URI with the updated values included in the request body:
PUT<Informatica Intelligent Cloud Services URL>/active-bpel/asset/v1/update?assetType=<Taskflow>

PUT request

The following HTTP header shows a PUT request to update the API Name, Allowed Users, and Allowed Groups fields:
PUT <Informatica Intelligent Cloud Services URL>/active-bpel/asset/v1/update?assetType=Taskflow
Content-Type: application/json
Accept: application/json
INFA-SESSION-ID: <Your_Session_ID>

Example

Use the following sample PUT request to update the API Name, Allowed Users, and Allowed Groups fields of a taskflow:
PUT <baseApiUrl>/active-bpel/asset/v1/update?assetType=Taskflow
Content-Type: application/json
Accept: application/json
INFA-SESSION-ID: <Infa-Session-ID>

{
"taskflows": [
{
"guid": {
"$t": "<guidvalue>"
},
"deployment": [
{
"key": {
"$t": "API Name"
},
"value": {
"$t": "<new-api-name>"
}
},
{
"key": {
"$t": "Allowed Users"
},
"value":[ {
"$t": "user1"
},
{
"$t": "user2"
}]
},
{
"key": {
"$t": "Allowed Groups"
},
"value":[ {
"$t": "group1"
},
{
"$t": "group2"
}]
}
]
}
]
}
Send a JSON payload in the body of the PUT request that contains a list of taskflows and the fields that you want to update, such as API Name, Allowed Users, and Allowed Groups.
Use the following sample PUT request to update the API Name, Allowed Users, and Allowed Groups fields of multiple taskflows:
{
"taskflows": [
{
"guid": {
"$t": "{{guid1}}"
},
"deployment": [
{
"key": {
"$t": "API Name"
},
"value": {
"$t": <<"apiname">>
}
},
{
"key": {
"$t": "Allowed Users"
},
"value": [
{
"$t": "user1"
},
{
"$t": "user2"
}
]
},
{
"key": {
"$t": "Allowed Groups"
},
"value": [
{
"$t": "user_Group1"
},
{
"$t": "user_Group2"
}
]
}
]
},
{
"guid": {
"$t": "{{guid2}}"
},
"deployment": [
{
"key": {
"$t": "API Name"
},
"value": {
"$t": <<"apiname1">>
}
},
{
"key": {
"$t": "Allowed Users"
},
"value": [
{
"$t": "user1"
},
{
"$t": "user2"
}
]
},
{
"key": {
"$t": "Allowed Groups"
},
"value": [
{
"$t": "user_Group1"
},
{
"$t": "user_Group2"
}
]
}
]
}
]
}

PUT response example

If the fields are successfully updated, you receive the following response:
// Success Response
{
"status": {
"$t": "SUCCESS"
}
}
If the fields include invalid data, you receive the following error response:
// Failure Response
{
"status": {
"$t": "FAILED"
},
"errorDetails": {
"error": {
"$t": "Update failed for assets"
},
"failedAssets": {
"updateAssetFaultInfo": {
"xmlns": "https://com.informatica.icrt/2021/08/updateAssets.xsd",
"xmlns$aetgt": "https://com.informatica.icrt/2021/08/updateAssets.xsd",
"name": {},
"GUID": {
"$t": "<Incorrectguidvalue>"
},
"fault": {
"$t": "The Api Name is not valid. Specify a valid Api Name."
}
}
}
}
}