About Importing Data Entry Plans
Data entry plans are created by the system when route operations are defined to collect a
set of variables. When importing a route to a target system that contains data entry
plans as part of its definition, the data entry plans must exist in the target system.
You can import a data entry plan using the Plant Application ERP Scheduler service in
two ways:
- Export a Plant Applications data entry plant from a source system via the ERP Export service and use the JSON of the response as input to the ERP Scheduler service /importOrders/importDataEntryPlantJobs.
- Create an import data entry plant JSON from a third-party system.Note: To successfully import a data entry plan, all entities of the data entry plan must exist, including::
- Variables
- Materials (the context of a variable)
- Lines and units (the context of a variable)
The data import JSON consists of two parts.
exportMetaData
: This is data specific to the definition of what is being imported and how the data maps between a source and the final Plant Application destination. The meta data consists of two parts:.modelProperties
: A collection of propertyName and propertyValue pairs to define the set of model properties and their values for the data entry plant import. For example:
You must define the name/value pairs for setting a data entry plan name and data entry plan release status. To successfully import a data entry plan, the following propertyNames are supported:{ "propertyName": "name", "propertyValue": "e152218b-8f13-4dbb-8f2a-d2c75162f212" }, { "propertyName": "isReleased", "propertyValue": "true" }
name
isReleased
Note: The system assigns data entry plan names using GUIDs. Data entry plan names must be unique in the Plant Applications database..sourceProperties
: A collection of name-to-ID mappings required to update the data entry plan content from a source to the target IDs:.propertypath
: The JSON path of the entity within the data entry plan JSON structure. E.g.,:groups[0].variables[0].variableId
..sourceValue
: The value in the JSON that represents the entity in the path. E.g.,: 2846 is the variable ID..sourceName
: The description name of the value. E.g.,: BB Drop is the variable name..transformation
: How the source-to-destination data is to be transformed. Example:targetValueLookup
is a supported value that indicates the target can be mapped using lookup..context
: the context as to how to find the variable name. E.g.,:productCode
,lineName
andunitName
are contexts to define where and how the variable can be mapped in the destination system.
.content
: A JSON escaped string used directly by the core service API to create the plan. See Activities Service API documentation for data entry creation and the content of this parameter. For example:
The above example identifies that the first variable in the first group, variable id of the source is"content": "{\n \"createdByUserId\": 53,\n \"createdOn\": \"2022-07-14T21:37:08.005Z\",\n \"eventSubtypeId\": 6,\n \"eventType\": \"UserDefined\",\n \"groups\": [\n {\n \"name\": \"Length\",\n \"variables\": [\n {\n \"isMandatory\": true,\n \"variableId\": 2846\n },\n {\n \"isMandatory\": false,\n \"variableId\": 2835\n },\n {\n \"isMandatory\": false,\n \"variableId\": 2843\n },\n {\n \"isMandatory\": false,\n \"variableId\": 2836\n },\n {\n \"isMandatory\": false,\n \"variableId\": 2845\n },\n {\n \"isMandatory\": false,\n \"variableId\": 2844\n }\n ]\n },\n {\n \"name\": \"Angle\",\n \"variables\": [\n {\n \"isMandatory\": false,\n \"variableId\": 2847\n },\n {\n \"isMandatory\": false,\n \"variableId\": 2834\n }\n ]\n }\n ],\n \"id\": 15,\n \"isReleased\": false,\n \"lastModifiedByUserId\": 53,\n \"lastModifiedOn\": \"2022-07-14T21:37:08.005Z\",\n \"name\": \"e152218b-8f13-4dbb-8f2a-d2c75162f212\"\n}", "contentMediaType": "application/vnd.ge.mes.v1.full+json"
2846
, its name isBB Drop
and the transformation istargetValueLookup
. The import service will use a lookup from a service within the target system searching for name =BB Drop
whose context is a material variable for product codeL_AT_Yellow
and finding the ID. The import service will then replace the value2846
ingroups[0].variables[0].variableId
to create the data entry for the target.Note: Most transformations aretargetValueLookup
, which identifies the need to use a lookup to obtain a target value.
Note: All Plant Applications entities must exist in the target system prior to running the
data entry plant import.