{
  "factory": {
    "id": "abstract-route",
    "type": "entaxy.runtime.route",
    "description": "Factory abstract-route of entaxy.runtime.route"
  },
  "entaxy.runtime.route": {
  	"targetRouteContainerType": "ANY",
  	"routeType": "CUSTOM",
  	"routePattern": "ABSTRACT",
  	"routeIsCallable": false
  },
  "fields": {
  	"objectId": {
  		"isHidden": true
  	},
  	"routeId": {
  		"type": "String",
  		"displayName": "Route ID",
		"description": "Unique identifier assigned to each route",
		"isHidden": false,
  		"required": true,
		"@UNIQUE": {
			"filterByParentFieldValues": true
		},
		"@TYPEINFO": {
			"validation": {
				"rules": {
					"length": {
						"min": 3
					},
					"content": {
						"regex": "^[a-zA-Z][a-zA-Z0-9-]*$",
						"errorMessage": "Value can contain only latin letters, numbers and hyphen and should start with a letter"
					}
				}
			}
		}
  	},
  	"__objectId": {
  		"type": "String",
  		"isHidden": true,
  		"required": true,
  		"@INTERNAL": true,
  		"defaultValue": {
			"@CALCULATED": {
				"expression": "${#OWNER#.objectId}__${properties.routeId}",
				"targetPath": "$.objectId",
				"removeResolved": true,
				"resultType": "string",
				"lazy": false,
				"blacklistContent": ["TEMP-*", "GEN-*"]
			}  			
  		}
  	},
  	"routeProperties": {
  		"type": "Map",
		"description": "Optional metadata",
  		"displayName": "Route properties"
  	},
	"routeContent": {
		"displayName": "Route",
		"type": "xml:route",
		"description": "Set of processing steps that are applied to a message as it travels from a source to a destination. A route typically consists of a series of processing steps that are connected in a linear sequence. For more details see <a target=\"_blank\" href=\"https://camel-docs.entaxy.ru/manual/${camel-docs.version}/routes.html\">Camel docs</a>",
		"required": true,
		"@RESOURCE": {
			"endType": "String",
			"format": "base64",
			"location": {
				"@CALCULATED": {
					"lazy": true,
					"expression": "${#OWNER_OF_TYPE:+entaxy.runtime.route-container#.#FACTORY#.factory.type}.${#OWNER_OF_TYPE:+entaxy.runtime.route-container#.objectId}/${#OWNER#.#FACTORY#.factory.type}.${#OWNER#.properties.routeId}/routeContent.xml"
				}
			},
			"postprocess": [
				{
					"processor": "component-library"
				}
			]
		},
		"defaultValue": {
	        "@RESOURCE": {
	          "provider": "entaxy-file-internal",
	          "location": "factories/abstract-route/routeContent.xml",
	          "endType": "String",
	          "format": "base64"
	        }
      }
	},
	"__routeOwner": {
		"type": "String",
		"isHidden": true,
		"required": true,
		"note": "for the case when we need explicitly set route container id, e.g in xslt",
		"@INTERNAL": true,
		"defaultValue": {
			"@CALCULATED": {
				"expression": "${#OWNER_OF_TYPE:+entaxy.runtime.route-container#.objectId}:${#OWNER_OF_TYPE:+entaxy.runtime.route-container#.#FACTORY#.factory.type}",
				"lazy": false
			}
		}
	},	
	"displayName": {
		"required": true,
		"defaultValue": {
			"@CALCULATED": {
				"expression": "${properties.routeId}",
				"lazy": false
			}
		}
	},
	"##publish": {
		"type": "Map",
		"required": true,
		"isHidden": true,
		"defaultValue":{
			"relation": [
				{
					"@CALCULATED": {
						"expression": "${#OWNER_OF_TYPE:+entaxy.runtime.route-container#.objectId}:${#OWNER_OF_TYPE:+entaxy.runtime.route-container#.#FACTORY#.factory.type}:subroute:-composition:routes",
						"lazy": true
					}
				}
			],
			"owner": {
				"@CALCULATED": {
					"expression": "${#OWNER_OF_TYPE:+entaxy.runtime.route-container#.objectId}:${#OWNER_OF_TYPE:+entaxy.runtime.route-container#.#FACTORY#.factory.type}",
					"lazy": true
				}
			},
			"routeId": {
				"@CALCULATED": {
					"expression": "${properties.routeId}",
					"lazy": false
				}
			},
			"routeType": {
				"@CALCULATED": {
					"expression": "${#FACTORY#.#TYPEINFO#.routeType}",
					"lazy": false
				}
			},
			"routePattern": {
				"@CALCULATED": {
					"expression": "${#FACTORY#.#TYPEINFO#.routePattern}",
					"lazy": false
				}
			},
			"routeIsCallable": {
				"@CALCULATED": {
					"expression": "${#FACTORY#.#TYPEINFO#.routeIsCallable}",
					"lazy": false,
					"resultType": "string"
				}
			},
    		"routeGlobalCallMode": "NONE",
			"routeLocalCallMode": "NONE",
			"name": {
				"@CALCULATED": {
					"expression": "${properties.routeId}"
				}
			}
		}
	}    
  },
  "outputs": {
    "init": {
      "isDefault": true,
      "fields": {
      	"__objectId": {},
      	"__routeOwner": {},
      	"routeId": {},
      	"routeContent": {},
      	"routeProperties": {}
      },
      "scopes": ["private"],
      "config": {
      	"configurable": false
      }
    }
  }
}
