Fix Migrations

This commit is contained in:
Ram Narayan Balaji 2025-09-25 02:21:36 +05:30
parent 25c8abb729
commit 7bf3668dd9

View File

@ -470,11 +470,12 @@ public class MigrationUtil {
"""
{
"type": "automatedTask",
"subType": "setGlossaryTermStatusTask",
"subType": "setEntityAttributeTask",
"name": "SetGlossaryTermStatusToInReviewForUpdate",
"displayName": "Set Status to 'In Review' (Update)",
"config": {
"glossaryTermStatus": "In Review"
"fieldName": "status",
"fieldValue": "In Review"
},
"inputNamespaceMap": {
"relatedEntity": "global",
@ -507,8 +508,7 @@ public class MigrationUtil {
"addReviewers": true
},
"approvalThreshold": 1,
"rejectionThreshold": 1,
"supportsSuggestions": true
"rejectionThreshold": 1
},
"inputNamespaceMap": {
"relatedEntity": "global"
@ -518,7 +518,7 @@ public class MigrationUtil {
""",
WorkflowNodeDefinitionInterface.class);
nodes.add(unifiedApprovalNode);
LOG.info("Added new node: ApprovalForUpdates (unified task with suggestions)");
LOG.info("Added new node: ApprovalForUpdates");
nodesAdded = true;
} catch (Exception e) {
LOG.error("Failed to add ApprovalForUpdates node", e);
@ -561,11 +561,12 @@ public class MigrationUtil {
"""
{
"type": "automatedTask",
"subType": "setGlossaryTermStatusTask",
"subType": "setEntityAttributeTask",
"name": "SetGlossaryTermStatusToApprovedAfterReview",
"displayName": "Set Status to 'Approved' (After Review)",
"config": {
"glossaryTermStatus": "Approved"
"fieldName": "status",
"fieldValue": "Approved"
},
"inputNamespaceMap": {
"relatedEntity": "global",
@ -837,15 +838,17 @@ public class MigrationUtil {
boolean triggerModified = false;
// Check if there's an entityType field (old format)
if (configObj.has("entityType") && !configObj.has("entityTypes")) {
if (configObj.has("entityType")) {
String entityType = configObj.get("entityType").asText();
configObj.remove("entityType");
// Create entityTypes array with the single value
ArrayNode entityTypesArray = mapper.createArrayNode();
entityTypesArray.add(entityType);
configObj.set("entityTypes", entityTypesArray);
// Remove the old entityType field
configObj.remove("entityType");
LOG.info(
"Updated trigger from entityType='{}' to entityTypes=['{}']",
entityType,