CanvasFrameworkJson.json


The purpose of this JSON file is to control the Request Modeler base activities by enabling/disabling any specific activity based on the requirement. The Request Modeler base activities such as auditing, entitlement, publishing etc. can be controlled via this JSON.


The base activities should be controlled efficiently to achieve the desired application response else it will lead to logical errors and the request will not complete its workflow cycle.

For example, enabling/disabling the auditing or duplicate check activities will not affect the request workflow. But, controlling the activities like entitlement, client response etc. will affect the request workflow cycle.
The following snippet shows you the complete JSON structure of the CanvasFrameworkJson.json file that controls the Request Modeler base activities:

{
	"model": {
		"id": "DATA_MAINT_FRAMEWORK",
		"description": "State Model that defines the states for a typical Data Maintenance application",
		"imageUrl": "/images/dataMaint.png",
		"version": "1.0",
		"bundle": "maintenance",
		"globals": {
			"evaluators": [
			{
				"id": "equals",
				"imageUrl": "images/activities/equals.png",
				"class": "com.intellectdesign.canvas.rules.impl.EqualsEvaluator"
			} 
			],
			"activities": [
			{
				"id": "deriveProductSubProdFunction",
				"imageUrl": "images/activities/deriveProductSubProdFunction.png",
				"class": "com.intellectdesign.canvas.reqmodel.activity.base.ReqModelDerivePSFDataActivity"
			},
			{
				"id": "transformDataClientToServer",
				"imageUrl": "images/activities/transformDataClientToServer.png",
				"class": "com.intellectdesign.canvas.reqmodel.activity.base.ReqModelDataTransformationActivity"
			},
			{
				"id": "preProcessData",
				"imageUrl": "images/activities/preProcessData.png",
				"class": "com.intellectdesign.canvas.reqmodel.activity.base.ReqModelSetSystemFieldsActivity"
			},
			{
				"id": "deriveKeysForTransaction",
				"imageUrl": "images/activities/deriveKeysForTransaction.png",
				"class": "com.intellectdesign.canvas.reqmodel.activity.base.ReqModelKeyGenerationActivity"
			},
			{
				"id": "preProcessingChecks",
				"imageUrl": "images/activities/preProcessingChecks.png",
				"class": "com.intellectdesign.canvas.reqmodel.activity.base.ReqModelEntitlementChecksActivity"
			},
			{
				"id": "performDuplicateChecks",
				"imageUrl": "images/activities/performDuplicateChecks.png",
				"class": "com.intellectdesign.canvas.reqmodel.activity.base.ReqModelDuplicateCheckActivity"
			},
			{
				"id": "executeStateEngine",
				"imageUrl": "images/activities/executeStateEngine.png",
				"class": "com.intellectdesign.canvas.reqmodel.activity.base.ReqModelStateEngineExecutor"
			},
			{
				"id": "raiseEvent",
				"imageUrl": "images/activities/raiseEvent.png",
				"class": "com.intellectdesign.canvas.reqmodel.activity.base.ReqModelAuditingActivity"
			},
			{
				"id": "publishToHost",
				"imageUrl": "images/activities/publishToHost.png",
				"class": "com.intellectdesign.canvas.reqmodel.activity.base.ReqModelPublishToHostActivity"
			},
			{
				"id": "prepareResponse",
				"imageUrl": "images/activities/prepareResponse.png",
				"class": "com.intellectdesign.canvas.reqmodel.activity.base.ReqModelPrepareClientResponse"
			} 

			],
			"errorHandlers": {
				"invalidState": {
					"activityChain": [
					{
						"id": "CT.INVSTATE",
						"type": "set",
						"context": {
							"error": "true"
						},
					"response": {
						"processingStatus": "failure",
						"errorCodes": [
						"ERR_INVALID_STATE"
						],
						"errorMessages": [
							"$ctbundle.ERR_INVALID_STATE"
						]
					}
				}
				]
			},
			"invalidAction": {
				"activityChain": [
				{
					"id": "CT.INVACTION",
					"type": "set",
					"context": {
						"error": "true"
					},
					"response": {
						"processingStatus": "failure",
						"errorCodes": [
							"ERR_INVALID_ACTION"
						],
						"errorMessages": [
							"$ctbundle.ERR_INVALID_ACTION"
						]
					}
				}
				]
			},
			"exception": {
				"activityChain": [
				{
					"id": "CT.EXCEPTION",
					"type": "set",
					"context": {
						"error": "true",
						"propagateException": "true"
					},
					"response": {
						"processingStatus": "failure",
						"errorCodes": [
						"SYSERROR"
						],
					"errorMessages": [
					"$ctbundle.SYSERROR"
					]			
				}
			}
			]
		}
	}
},
	"states": [
		{
			"id": "CANVAS_STATE",
			"description": "InitialState",
			"isDefault": "true",
			"actions": [
			{
				"id": "CANVAS_ACTION",
				"description": "When a new request is submitted for pre confirmation",
				"transactionRequired": "true",
				"isInEditMode": true,
				"activityChain": [
				{
					"id": "A01",
					"type": "deriveProductSubProdFunction"
				},
				{
					"id": "A02",
					"type": "transformDataClientToServer"
				},
				{
					"id": "A03",
					"type": "preProcessData"
				},
				{
					"id": "A04",
					"type": "deriveKeysForTransaction"
				},
				{
					"id": "A05",
					"type": "preProcessingChecks"
				},
				{
					"id": "A06",
					"type": "performDuplicateChecks"
				},
				{
					"id": "A07",
					"type": "executeStateEngine"
				},
				{
					"id": "A08",
					"type": "raiseEvent"
				},
				{
					"id": "A09",
					"type": "publishToHost"
				},
				{
					"id": "A10",
					"type": "prepareResponse"
				}
			]
			}
		]
		} 
	]
	}
} 


For example:
If the auditing activity is required only for specific actions and not for all the actions within the Request Modeler, then do the following steps:

  1. The highlighted (blue) JSON code in the above code snippet should be deleted to disable it completely from the Canvas framework side.
  2. In the stateModelLibrary.json, insert the highlighted (green) JSON code as shown in the following snippet to enable the auditing only for the specific activity.

{
	"id": "DELETE",
	"description": "Delete the request",
	"transactionRequired": "true",
	"activityChain": [
	{
		"id": "IN_DE_CHK",
		"type": "rule",
		"condition": {
			"id": "equals",
			"field": "$context.LIVE_MODE",
			"value": "DELETE"
		},
		"success": {
			"activityChain": [
			{
				"id": "IN_DA",
				"type": "moveToState",
				"state": "DA"
			},
			{
				"id": "IN_DA1",
				"type": "raiseevent"
			}
			]
		},
		"failure": {
			"activityChain": [
			{
				"id": "IN_DE",
				"type": "moveToState",
				"state": "DE"
			}
			]
		} 
	}
]
}