Skip to content

Mapping DSL?

illyfrancis edited this page Jul 25, 2013 · 7 revisions

For XML like messages

  • does it imply structured, hierarchical messages (CSV could be hierarchical too)

Mapping a ContractCreated message

map type "ContractCreated" 
  of security "InterestRateSwap"
  for client "ABC" (
    header.conversationId to header.conversationId
    header.messageId to header.messageId
    header.sentBy to header.sentBy
    ...
    contract.header.identifier.partyReference[href] to contract.header.identifier.partyReference[href]
    contract.header.identifier.versionedContractId.contractId to contract.header.identifier.versionedContractId.contractId
    ...
    with contract.creditDefaultSwap
      productType to [[how to represent the RHS]]

what about repeating elements? How to represent the mapping? and how would the target message be represented?

<party id="party1">
  <partyId>XYZBICXXX</partyId>
  <partyName>XYZ Bank</partyName>
</party>
<party id="party2">
  <partyId>ABCBICXXX</partyId>
  <partyName>ABC Bank</partyName>
</party>

Validate a ContractCreated message

validate type "ContractCreated"
  of security "InterestRateSwap"
  for client "ABC" (
    header must exist
    contract must exist
    ...
    contract.header.identifier.effectiveDate format should be "YYYY-MM-DD"
    contract.contractDate format should be "YYYY-MM-DD"

  )

Enrich (only apply to normalized message?)

enrich security "InterestRateSwap"
  of type "ContractCreated"
  ... (// it's no longer client specific)

Or perhaps???

  • It doesn't make sense to configure enrichment, because it should be non-client specific. Almost treat it like there's only one predefined message and any validation and enrichment should/can be done in the code level.

For CSV like messages

  • How would the message be structured?
    1. One way would be that the columns define the fields, and each row defines distinct messages?
    2. Another would be hierarchical etc (But this seem to difficult and calls for custom implementation)

Mapping a ContractCreated message

map type "ContractCreated" 
  of security "InterestRateSwap"
  for client "ABC" (
    header.conversationId to header.conversationId
    header.messageId to header.messageId
    header.sentBy to header.sentBy
    ...

How to specify mapping for? Domain language?

Multiple fields into Single field

from(multiple(field1).and(field2).and(field2)).to(target)

Single field split to Multiple fields

split(field).by(CONDITION?) -> produces fields

map( split(field).by(something) ).to -> how do we represent this???

Truncate source field

trim(field)

Clone this wiki locally