In this exercise, you are going to complete the mapping of the Target Objects in the Business Objects Card and CardStatus (finally...).

You will be using the two Mapping Rules you just created in the last exercise - but also some Mapping Rules already defined in the Target Map by some of your team mates.

Finally you are going to use the 3 Events you created even earlier to handle the Flags raised by your new Mapping Rules.

Map the remaining Target Fields in the Target Object Tgt.Card

  • Open Tgt.Card on the Document canvas, if not open already
  • Map Target Field CardId using the existing Mapping Rule GetNewId to get next available Id Number
    • On field CardId, select Calculated in the Value drop down
    • Tab right to open calculated dialog or click in Content
      • In the first drop down select Rule (default)
      • In the second drop select rule GetNewId
      • Map Parameter 
        • BankId = Target value Card/Tgt.Card.BankId
      • In flag handling, on both Flags: Select System Event from Action drop down and keep defaults in Severity (Reject Root) and Receiver (Migration).
      • The Action System Event means that migFx will handle this Flag by creating a standard text for you in the form of
        MappingRule.GetNewId(BankId: 999).

  • Map Target Field CardTypeId using your new rule GetCardType and the new Event I0024
    • Select Calculated in Value drop down and select rule GetCardType
    • Map Parameters 
      • BankId to Interface Value Card.BankId
      • CardType to Interface Value Card.CardType
    • Set the Not Found Flag to Action User Event, and select the Event I0024 you created earlier.
    • As event parameters, map Interface Value Card.CardType
  • Map Target Field CreatedTs using existing rule GetNewTs.
    • Rule GetNewTs
    • Parameters 
      • TsInterval = Literal 4
      • TsDate = Constant TsDate

Now the complete mapping of Target Object Tgt.Card should look like this

  • Save (ctrl-s)

Map the remaining Target Fields in Target Object Tgt.Card_Status.

  • Open Target Object Tgt.Card_Status in canvas, if not open already
  • Map StatusId using existing rule GetCardStatus and new Events I0025 and I0026
    • Select Calculated in Value drop down and tab right to open calculated dialog
    • Select rule GetCardStatus
    • Map Parameters 
      • CardStatus = Interface value Card.CardStatus.CardStatus
      • CardActiveDate = Interface value Card.CardActiveDate
      • CardInactiveDate = Interface value Card.CardInactiveDate
    • Handle Flags (both the same)
      • Unknown CardStatus on card in use and Unknown CardStatus on inactive card
        • Action User Event, select the Event I0025 you created earlier. The Event comes with the Severity Reject Root and Receiver Migration, leave these values 
        • Event parameters: Interface values Card.CardStatus.CardStatus

  • Map CreatedTs using existing rule GetNewTs exactly as you did on Tgt.Card above

Now the complete mapping of Target Object Tgt.Card_Status should look like this

  • Save (ctrl-s)

What happened here?

Well, first of all you completed the Target Field mapping of both your new Target Objects Tgt.Card and Tgt.Card_Status. Congratulations!

And you used the Value Type Calculated,  so it has been added your arsenal. 

  • Interface
  • Literal
  • Target
  • Constant
  • Relationship
  • Calculated

The Calculated value means the you use a Mapping Rule to calculate the value of the Target Field. So you have brought into use the 2 Mapping Rules you created earlier. And by doing so you also had to handle the Flags your rules can raise. And that made use of the 3 Events you also created earlier tying all these exercises together in a neat little bundle. 

In addition of course you also used some Mapping Rules that your kind team mates (us) had already created.

Value type Identity

The Target Map has one more Value Type called Identity. Though you will not be using this Value Type in these exercises, for completeness let's explain what it does. If you use the Value Type Identity on a Target Field, migFx will at run time assign a value to the Target Field. This value is an integer and unique for the Target Object. This uniqueness is at run time defined by the values of all the Interface Fields defined as Keys on the Business Object ancestors of the Target Object. In addition the internal id of the Target Object in the Target Map is taken into consideration, so the Identity value is different for each Target Object under the same Business Object.

The beauty of it is that migFx will at run time give the same unique value each time the migration of the same Business Object is iterated.