Build Data Processing Engine Definitions in a JSON File

Build a Data Processing Engine definition in a JSON file and then upload it to the builder. You can also download the definition, make changes, and then upload the updated definition.

Required Editions

View supported editions.
User Permissions Needed
To create a definition: View permissions information.

Keep these things in mind when you upload and download definition JSONs:

  • Upload a JSON with the status of the definition as inactive.
  • A definition’s process type can’t be changed.
  • A definition’s name can’t be changed.
  • Ensure that the JSON file is structured in a way that’s supported by the BatchCalcJobDefinition Metadata API.
  • The JSON file size is 600 KB or less.
  • The name of the JSON file contains only alphanumerics and underscores.
  1. From Setup, in the Quick Find box, enter Data Processing Engine, and then select Data Processing Engine.
  2. Click New.
  3. Specify the name and the process type of the definition.
  4. Click Create.
  5. Click New Data Source and define the node.
    You can download definitions with at least one Data Source node.
  6. Save your changes.
  7. Click Download definition. The definition is downloaded as a JSON file in your local system.
  8. Edit the downloaded JSON file.
  9. Click Upload definition
  10. Click Upload File.
  11. Select the updated JSON file from your system.
  12. Click Upload.
Example
Example If you name the definition as Test Definition JSON, specify the Process Type as Standard, and select the Order as the data source, here’s what the definition looks like.
{
	"FullName": "Test_Definition_JSON",
	"Metadata": {
		"processType": "DataProcessingEngine",
		"status": "Inactive",
		"label": "Test Definition JSON",
		"datasources": [
			{
				"name": "Order",
				"label": "Order",
				"sourceName": "Order",
				"type": "StandardObject",
				"fields": [
					{
						"name": "Id",
						"dataType": "Text",
						"displaySequence": 1
					},
					{
						"name": "Status",
						"dataType": "Text",
						"displaySequence": 1
					},
					{
						"name": "TotalAmount",
						"dataType": "Numeric",
						"displaySequence": 1
					}
				]
			}
		]
	}
}

Now, the downloaded JSON is edited to ensure that it writes back a discounted amount for orders that are in the Draft status. Here’s what the edited JSON looks like:

{
	"FullName": "Test_Definition_JSON",
	"Metadata": {
		"processType": "DataProcessingEngine",
		"status": "Inactive",
		"label": "Test Definition JSON",
		"isTemplate": false,
		"datasources": [
			{
				"name": "Order",
				"label": "Order",
				"sourceName": "Order",
				"type": "StandardObject",
				"fields": [
					{
						"name": "Id",
						"dataType": "Text",
						"displaySequence": 1
					},
					{
						"name": "Status",
						"dataType": "Text",
						"displaySequence": 1
					},
					{
						"name": "TotalAmount",
						"dataType": "Numeric",
						"displaySequence": 1
					}
				]
			}
		],
		"filters": [
			{
				"name": "Filter_Draft_Orders",
				"label": "Filter Draft Orders",
				"sourceName": "Order",
				"filterCondition": "1",
				"criteria": [
					{
						"sourceFieldName": "Status",
						"operator": "Equals",
						"value": "Draft",
						"sequence": 1
					}
				]
			}
		],
		"writebacks": [
			{
				"name": "Write_Back_Discounted_Amount_for_Orders",
				"label": "Write Back Discounted Amount for Orders",
				"sourceName": "Discounted_Amount",
				"targetObjectName": "Order",
				"operationType": "Update",
				"writebackSequence": 1,
				"writebackUser": "005RM000002CkavYAC",
				"fields": [
					{
						"sourceFieldName": "Id",
						"targetFieldName": "Id"
					},
					{
						"sourceFieldName": "DiscountedAmount",
						"targetFieldName": "Discounted_Amount__c"
					}
				]
			}
		],
		"transforms": [
			{
				"name": "Discounted_Amount",
				"label": "Discounted Amount",
				"sourceName": "Filter_Draft_Orders",
				"expressionFields": [
					{
						"expression": "{TotalAmount} * .8",
						"alias": "DiscountedAmount",
						"dataType": "Numeric",
						"length": 14,
						"decimalPlaces": 2
					}
				],
				"transformationType": "Expression"
			}
		]
	}
}