Feature #28

Enduro/X JSON core extension for field mapping

Added by Madars Vitolins over 2 years ago. Updated 2 months ago.

Status:RejectedStart date:02/23/2016
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

We should add new mapping mechanisms which would allow to map the fields for different contexts.
If contexts are not set, then mapping becomes global.

tpjson2ubfmap(
  /* Internal message mapping context */
  context_internal_key="KL_SRVCNM",
  context_internal_value="ENDUROSVC1",

  /* External message mapping context */
  context_external_key="function",
  context_external_value="ENDUROSVC1",

  /* Actual field mapping: */
  map_internal="C_CUSTOMER_NAME", 
  map_external="customerName" 
)

/* Additional functionality, removing the: */
tpjson2ubfmap(
  /* Internal message mapping context */
  context_internal_key="KL_SRVCNM",
  context_internal_value="ENDUROSVC1",

  /* External message mapping context */
  context_external_key="function",
  context_external_value="ENDUROSVC1",

  map_internal="KL_SRVCNM" 
  map_external="function" 
)

For example, incoming json:
{
"function":"ENDUROSVC1",
"customerName":"Jimbo" 
}

would result in UBF buffer:
KL_SRVCNM ENDUROSVC1
C_CUSTOMER_NAME Jimbo

History

#1 Updated by Madars Vitolins over 2 years ago

  • Description updated (diff)

#2 Updated by Madars Vitolins over 2 years ago

  • Description updated (diff)

#3 Updated by Madars Vitolins over 2 years ago

We could also support field value mapping:

tpjson2ubfmap(
  /* Internal message mapping context */
  context_internal_key="KL_SRVCNM",
  context_internal_value="ENDUROSVC1",

  /* External message mapping context */
  context_external_key="function",
  context_external_value="ENDUROSVC1",

  /* Actual field mapping (optional): */
  map_key_internal="C_CUSTOMER_NAME", 
  map_key_external="customerName" 

  /* Actual field mapping (optional): */
  map_value_internal = "John",
  map_value_external = "Jimbo" 
)

#4 Updated by Madars Vitolins over 2 years ago

  • Description updated (diff)

#5 Updated by Madars Vitolins over 2 years ago

This would apply globally to all messages (translates field name & value):

tpjson2ubfmap(
  /* Internal message mapping context */
  context_internal_key=NULL,
  context_internal_value=NULL,

  /* External message mapping context */
  context_external_key=NULL,
  context_external_value=NULL,

  /* Actual field mapping (optional): */
  map_key_internal="C_CUSTOMER_NAME", 
  map_key_external="customerName" 

  /* Actual field mapping (optional): */
  map_value_internal = "John",
  map_value_external = "Jimbo" 
)

This would apply globally to all messages (translates only field value):

tpjson2ubfmap(
  /* Internal message mapping context */
  context_internal_key=NULL,
  context_internal_value=NULL,

  /* External message mapping context */
  context_external_key=NULL,
  context_external_value=NULL,

  /* Actual field mapping (optional): */
  map_key_internal="C_CUSTOMER_NAME", 
  map_key_external="C_CUSTOMER_NAME" 

  /* Actual field mapping (optional): */
  map_value_internal = "John",
  map_value_external = "Jimbo" 
)

#6 Updated by Madars Vitolins over 2 years ago

The mapping might be done via scripting interface (once scripting is added).

#7 Updated by Madars Vitolins 2 months ago

  • Status changed from New to Rejected

not actual.

Also available in: Atom PDF