{
  "factory": {
    "id": "common-system-profile",
    "type": "entaxy.runtime.profile",
    "description": "Factory common-system-profile of entaxy.runtime.profile",
    "parent": "abstract-route-container-object",
    "displayName": "System profile",
    "isAbstract": false
  },
  "entaxy.runtime.profile": {
    "profileType": "SYSTEM"
  },
  "fields": {
    "systemName": {
      "displayName": "System Name",
      "type": "String",
      "required": true,
      "isHidden": true,
      "defaultValue": {
        "@CALCULATED": {
          "expression": "${objectId}",
          "lazy": false
        }
      }
    },
    "description": {
      "displayName": "Description",
      "type": "String",
      "group": "general"
    },
    "profileProperties": {
      "type": "Map",
      "required": true,
      "isHidden": true,
      "defaultValue": {
        "profile": {
          "@CALCULATED": {
            "expression": "${properties.systemName}",
            "lazy": true
          }
        }
      }
    },
    "in-flow-pre-route": {
      "displayName": "In-flow pre-route",
      "type": "xml:route",
      "required": true,
      "group": "in-flow",
      "description": "Customize the message processing before further routing within the esb. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_%D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B8_in_flow\">Entaxy docs</a>",
      "@RESOURCE": {
        "_provider": "entaxy-file-internal",
        "endType": "String",
        "format": "base64",
        "postprocess_bak": [
          {
            "processor": "xslt",
            "source": "entaxy-file-internal:factories/common-system-profile/profile-pre-route.xslt",
            "parameters": {
              "profileName": {
                "@CALCULATED": {
                  "expression": "${#OWNER#.properties.systemName}",
                  "lazy": false
                }
              }
            }
          },
          {
            "processor": "xslt",
            "source": "entaxy-file-internal:routes-common/common-components.xslt",
            "parameters": {
              "profileName": {
                "@CALCULATED": {
                  "expression": "${#OWNER#.properties.systemName}",
                  "lazy": false
                }
              }
            }
          }
        ],
        "postprocess": [
          {
          	"processor": "component-library"
          }
        ]
      },
      "defaultValue": {
        "@RESOURCE": {
          "provider": "entaxy-file-internal",
          "location": "factories/common-system-profile/in-flow-pre-route.xml",
          "endType": "String",
          "format": "base64"
        }
      },
      "config": {
        "scope": "public"
      }
    },
    "inFlowProcessResponse": {
      "displayName": "Process response",
      "type": "Boolean",
      "description": "Enables response processing before further routing to an input connector. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_%D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B8_in_flow\">Entaxy docs</a>",
      "required": true,
      "group": "in-flow",
      "defaultValue": false
    },
    "in-flow-response": {
      "displayName": "In-flow response",
      "type": "xml:route",
      "required": true,
      "description": "Customize the response processing before further routing to an input connector. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_настройки_in_flow\">Entaxy docs</a>",
      "group": "in-flow",
      "@RESOURCE": {
        "_provider": "entaxy-file-internal",
        "endType": "String",
        "format": "base64",
        "postprocess_bak": [
          {
            "processor": "xslt",
            "source": "entaxy-file-internal:factories/common-system-profile/profile-pre-route.xslt",
            "parameters": {
              "profileName": {
                "@CALCULATED": {
                  "expression": "${#OWNER#.properties.systemName}",
                  "lazy": false
                }
              }
            }
          },
          {
            "processor": "xslt",
            "source": "entaxy-file-internal:routes-common/common-components.xslt",
            "parameters": {
              "profileName": {
                "@CALCULATED": {
                  "expression": "${#OWNER#.properties.systemName}",
                  "lazy": false
                }
              }
            }
          }
        ],
        "postprocess": [
          {
          	"processor": "component-library"
          }
        ]
      },
      "defaultValue": {
        "@RESOURCE": {
          "provider": "entaxy-file-internal",
          "location": "factories/common-system-profile/in-flow-response.xml",
          "endType": "String",
          "format": "base64"
        }
      },
      "config": {
        "scope": "public"
      },
      "@UI": {
        "managedBy": "inFlowProcessResponse"
      }
    },
    "out-flow-pre-route": {
      "displayName": "Out-flow pre-route",
      "type": "xml:route",
      "required": true,
      "group": "out-flow",
      "description": "Customize the message processing before further routing to an output connector. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_настройки_out_flow\">Entaxy docs</a>",
      "@RESOURCE": {
        "_provider": "entaxy-file-internal",
        "endType": "String",
        "format": "base64",
        "postprocess_bak": [
          {
            "processor": "xslt",
            "source": "entaxy-file-internal:factories/common-system-profile/profile-pre-route.xslt",
            "parameters": {
              "profileName": {
                "@CALCULATED": {
                  "expression": "${#OWNER#.properties.systemName}",
                  "lazy": false
                }
              }
            }
          },
          {
            "processor": "xslt",
            "source": "entaxy-file-internal:routes-common/common-components.xslt",
            "parameters": {
              "profileName": {
                "@CALCULATED": {
                  "expression": "${#OWNER#.properties.systemName}",
                  "lazy": false
                }
              }
            }
          }
        ],
        "postprocess": [
          {
          	"processor": "component-library"
          }
        ]        
      },
      "defaultValue": {
        "@RESOURCE": {
          "provider": "entaxy-file-internal",
          "location": "factories/common-system-profile/out-flow-pre-route.xml",
          "endType": "String",
          "format": "base64"
        }
      },
      "config": {
        "scope": "public"
      }
    },
    "outFlowProcessResponse": {
      "displayName": "Postprocess response",
      "type": "Boolean",
      "description": "Enables response postprocessing before further routing within the esb. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_настройки_out_flow\">Entaxy docs</a>",
      "required": true,
      "group": "out-flow",
      "defaultValue": false
    },
    "out-flow-response": {
      "displayName": "Out-flow postprocess",
      "type": "xml:route",
      "required": true,
      "group": "out-flow",
      "description": "Customize the response postprocessing before further routing within the esb. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_настройки_out_flow\">Entaxy docs</a>",
      "@RESOURCE": {
        "_provider": "entaxy-file-internal",
        "endType": "String",
        "format": "base64",
        "postprocess_bak": [
          {
            "processor": "xslt",
            "source": "entaxy-file-internal:factories/common-system-profile/profile-pre-route.xslt",
            "parameters": {
              "profileName": {
                "@CALCULATED": {
                  "expression": "${#OWNER#.properties.systemName}",
                  "lazy": false
                }
              }
            }
          },
          {
            "processor": "xslt",
            "source": "entaxy-file-internal:routes-common/common-components.xslt",
            "parameters": {
              "profileName": {
                "@CALCULATED": {
                  "expression": "${#OWNER#.properties.systemName}",
                  "lazy": false
                }
              }
            }
          }
        ],
        "postprocess": [
          {
          	"processor": "component-library"
          }
        ]         
      },
      "defaultValue": {
        "@RESOURCE": {
          "provider": "entaxy-file-internal",
          "location": "factories/common-system-profile/out-flow-response.xml",
          "endType": "String",
          "format": "base64"
        }
      },
      "config": {
        "scope": "public"
      },
      "@UI": {
        "managedBy": "outFlowProcessResponse"
      }
    },
    "connector-selector": {
      "displayName": "Output connector selector",
      "type": "xml:route",
      "required": true,
      "description": "Defines connector selecting logic based on specified properties and templates. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Custom-tags-system-management.html#_connector_selector\">Entaxy docs</a>",
      "group": "out-flow",
      "@RESOURCE": {
        "_provider": "entaxy-file-internal",
        "endType": "String",
        "format": "base64",
        "postprocess_bak": [
          {
            "processor": "xslt",
            "source": "entaxy-file-internal:factories/common-system-profile/out-flow-connector-selector.xslt",
            "parameters": {
              "profileName": {
                "@CALCULATED": {
                  "expression": "${#OWNER#.properties.systemName}",
                  "lazy": false
                }
              }
            }
          },
          {
            "processor": "xslt",
            "source": "entaxy-file-internal:routes-common/common-components.xslt",
            "parameters": {
              "profileName": {
                "@CALCULATED": {
                  "expression": "${#OWNER#.properties.systemName}",
                  "lazy": false
                }
              }
            }
          }
        ],
        "postprocess": [
          {
          	"processor": "component-library"
          }
        ] 
      },
      "defaultValue": {
        "@RESOURCE": {
          "provider": "entaxy-file-internal",
          "location": "factories/common-system-profile/out-flow-connector-selector.xml",
          "endType": "String",
          "format": "base64"
        }
      },
      "config": {
        "scope": "public"
      }
    },
    /* TO_REMOVE */
    "useDefaultRoute": {
      "displayName": "Use Default Route",
      "type": "Boolean",
      "required": true,
      "isHidden": true,
      "defaultValue": true,
      "__fixedValue": true,
      "group": "in-flow",
      "@UI": {
        "transmitAlways": true
      }
    },
    "__switchOff_useDefaultRoute": {
      "type": "String",
      "required": true,
      "isHidden": true,
      "defaultValue": {
        "@CALCULATED": {
          "expression": "false",
          "targetPath": "$.properties.useDefaultRoute",
          "resultType": "boolean",
          "removeResolved": true,
          "lazy": true
        }
      }
    },    
    "defaultRouteContent": {
      "displayName": "Default profile route",
      "type": "xml:route",
      "required": true,
      "description": "The router that connects the system to other entities in the Entaxy architecture. By default, the message is routed to an entity of the system type. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Entity.html#_маршрут_по_умолчанию_default_route\">Entaxy docs</a>",
      "group": "in-flow",
      "condition": "${useDefaultRoute}",
      "@INTERNAL": true,
      "defaultValue": {
        "@RESOURCE": {
          "provider": "entaxy-file-internal",
          "location": "factories/default-route-2/default-route.xml",
          "endType": "String",
          "format": "base64"
        }
      },
      "@FACADE": {
        "useFacade": true,
        "type": "String",
        "value": "Go to routes to view or edit this value"
      },
      "config": {
        "scope": "public"
      }
    },
    "defaultRoute": {
      "type": "entaxy.runtime.default-route",
      "isRef": true,
      /* actually there's no reference, but the object must be in a model */
      /* so while producing we must check the defaultRoute is found */
      "isBackRef": true,
      /* but only if useDefaultRoute is set to true */
      "condition": "${useDefaultRoute}",
      "required": true,
      "immutable": true,
      "@INTERNAL": true,
      "defaultValue": {
        "type": "entaxy.runtime.default-route",
        "factoryId": "default-route-2",
        "properties": {
          "systemName": {
            "@CALCULATED": {
              "expression": "${#OWNER#.properties.systemName}",
              "lazy": false
            }
          },
          "description": {
            "@CALCULATED": {
              "expression": "Default route for ${#OWNER#.properties.systemName}",
              "lazy": false
            }
          },
          "routeContent": {
            "@CALCULATED": {
              "expression": "${#OWNER_OF_TYPE:entaxy.runtime.profile#.properties.defaultRouteContent}",
              "lazy": false,
              "allowObjects": false
            }
          },
          "profileObjectType": {
            "@CALCULATED": {
              "expression": "${#OWNER_OF_TYPE:entaxy.runtime.profile#.#FACTORY#.factory.type}",
              "lazy": false,
              "allowObjects": false
            }
          }
        }
      }
    },
    "__legacyComponents": {
      "type": "entaxy.runtime.profile",
      "isRef": true,
      "required": true,
      "isHidden": true,
      "isRefByValueOnly": true,
      "@INTERNAL": true,
      "defaultValue": {
        "factoryId": "common-system-profile",
        "type": "entaxy.runtime.profile",
        "outputType": "legacy",
        "scope": "private",
        "properties": {
          "systemProfileName": {
            "@CALCULATED": {
              "expression": "${#OWNER#.properties.systemName}",
              "lazy": false
            }
          }
        }
      }
    },
    "profileType": {
      "type": "String",
      "required": true,
      "isHidden": true,
      "defaultValue": {
        "@CALCULATED": {
          "expression": "${#FACTORY#.#TYPEINFO#.profileType}",
          "lazy": false
        }
      }
    },
    "##publish": {
      "defaultValue": {
        "profileType": {
          "@CALCULATED": {
            "expression": "${#FACTORY#.#TYPEINFO#.profileType}",
            "lazy": false
          }
        },
        "system": {
          "@CALCULATED": {
            "expression": "${properties.systemName}",
            "lazy": false
          }
        },
        "desc": {
          "@CALCULATED": {
            "expression": "${properties.description}",
            "lazy": false
          }
        }
      }
    }
  },
  "outputs": {
    "init": {
      "isDefault": true,
      "fields": {
        "objectId": {
          "displayName": "System Name",
          "description": "Name of system that need to integrate"
        },
        "systemName": {},
        "description": {},
        "useDefaultRoute": {},
        "__switchOff_useDefaultRoute": {},
        "defaultRoute": {
          "isHidden": true
        },
        "defaultRouteContent": {},
        "profileProperties": {},
        "in-flow-pre-route": {},
        "inFlowProcessResponse": {},
        "in-flow-response": {},
        "out-flow-pre-route": {},
        "outFlowProcessResponse": {},
        "out-flow-response": {},
        "connector-selector": {},
        "profileType": {},
        "__legacyComponents": {}
      },
      "config": {
        "configurable": false
      }
    },
    "legacy": {
      "fields": {
        "systemProfileName": {}
      },
      "scopes": [
        "private"
      ],
      "config": {
        "@SKIP_PUBLISH": {},
        "configurable": false
      }
    }
  }
}
