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]]

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)

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