Exercise 1.3 - Create Business Object Card with Initial Mapping

Modified on Mon, 04 Dec 2023 at 12:22 PM

In this exercise, you are going to define the Business Object Card. This exercise is quite simple, but rather illustrative.

You are also going to map some Target Fields, the simple ones. The rest of the Target Fields will need some further introduction before we proceed with these later on.  

Create Business Object Card and define Interface Fields

Create the Business Object

  • Project Explorer -> Right click on the folder tree view node Business Object and select New in the context menu
  • The new Business Object is now created and opened on the Document Canvas. Change the name to Card, and provide this description: Handling debit card only
  • Click on the Interface tab to view the list of Interface Fields on your new Business Object and proceed to create the Interface Fields
  • You will notice that Studio has already created an Interface Field called PartitionId. Hopp requires all root Business Objects to have a Partition field. You can read more about this here. In our case, the Partitions of interest are the banks being migrated, so we will use the BankId to do the partitioning:
    • Rename the PartitionId field to BankId
    • Check Key because the BankId is part of what identifies a single Card instance
    • Change the format to Num and the Length to 5 
  • Enter the remaining Interface Fields listed below (Name, Key, Format, Length, Scale, Nulls and Description). While you're not required to provide a description, doing so will avoid validation warnings further on
  • Save your work (ctrl-s)

Add Target Object Card to BO Card

This is a key point in the Target Map! You are now going to create a Target Object to link the Business Object Card to a metadata structure in the Target System. By doing this, you are specifying that the Card Business Object will deliver a (one) row to the structure in the Target System and you are creating the Target Object Tgt.Card to do this job.

  • Open Business Object Card if it is not already open
  • Click on the Target tab
  • Click the Add button to show the Select Target dialog
  • In the dialog, select the first (and only) item Target [Tgt] in the Metadata drop-down and then select Card from the list of metadata structures (if metadata for Card is not available, then maybe you missed Exercise 1.2 – Import Target Metadata? Did you mark the metadata for Card and CardStatus Active?).

    For now, leave the rest of the dialog as-is and click the Ok button to add the Target Object. Read here for more information on the Select Target dialog
  • Note that you have now created the Target Object Card. It is listed as Tgt.Card because it is delivering a row to a structure in the metadata Target with the alias Tgt. The Target Object is visible both in the list on the Target tab in the Business Object Card, but also in the Project Explorer treeview as a child under Business Object Card

  • Also note that Business Object Card and Target Object Tgt.Card both are marked with a little green cross. This indicates they have been added to your project locally, but not checked into the repository yet. So nobody in your team can see them right now apart from you

  • Save your work (ctrl-s)

Map (the easy) part of Target Object Tgt.Card

The new Target Object Card lists all the fields in the metadata structure Card, that it will deliver a row to. We call these Target Fields. Initially they have the value None. This means that no value has been decided and in fact, if you validate the Target Map, the value None will generate an Error.

Now you are going to map the easy part of the Target Fields in Tgt.Card. The others we will leave for later - you will know a bit more and along the way you will have created stuff you will need to assign the remaining values.

  • Open Tgt.Card on Canvas, either from Project Explorer (Business Object Card > Tgt.Card), or from Business object Card open on the Document canvas
  • Select the Fields tab on Tgt.Card
  • Map the following fields selecting Interface in the Value dropdown on each row
    • Target Field BankId to Card Interface Field BankId
      • Select Interface from Value drop down
      • Tab right (or click in the Content cell for the Target Field)
      • Select Business Object Card from Business Object drop down
      • Select BankId from the Interface Field drop down. Note that only Interface Fields with Data Type compatible to the Data Type of the Target Field appears in the dropdown
      • Then Ok. You have now instructed the Target Map to take the value of the Interface Field BankId and stick it into the Target Field BankId
    • Target Field CardHolderName to Card Interface Field CardHolderName
    • Target Field CardHolderCompanyName to Card Interface Field CardHolderCompanyName
    • Target Field CardPanNumber to Card Interface Field CardPanNumber
    • Target Field PinCode to value Null
    • Target Field CardActiveDate to Card Interface Field CardActiveDate
    • Target Field CardInactiveDate to Card Interface Field CardInactiveDate
    • Target Field CurdStatus using value Literal (= C)
      • Select CrudStatus
      • Select Literal from Value drop down
      • Tab right (or click in the Content cell for the Target Field) 
      • Type C
      • Then Ok
    • Target Field CreatedBy using value Constant (we will get to Constants in a later exercise)
      • Select CreatedBy
      • Select Constant in Value drop down
      • Click on Constant button
      • Tab right (or click in the Content cell for the Target Field) 
      • Select the Constant CreatedBy in drop down 
      • Then Ok

  • Save (ctrl-s)

What happened here?

You are getting started. You have created the Business Object Card and defined the list of Interface Fields you need to receive for a Card in order to create the data for the Target system. On the panel showing the list of Target Fields on the Target Object, you may have noticed the Auto... button. This can be used to automatically create these Interface Fields on the parent Business Object and map the Target Field to them. You can read more about this Auto feature here.

Furthermore, you are now starting to instruct Hopp how to create the rows you want to deliver to the Target system. What you did, was to create the Target Object Tgt.Card on the Business Object Card to instruct Hopp to deliver a row to the Card metadata structure in the Target system. 

After that you have assigned a value to some of the Target Fields on your new Target Object Tgt.Card. Not all of them, before you get to the rest you have to now a bit more about some other concepts in Hopp and Studio. 

But you have already used these Value Types

  • Interface, to use the value of an Interface Field, you have defined on the Business Object Card
  • Literal, meaning that you simply typed a literal value to be assigned to the Target Field
  • Constant, even though we haven't presented you for the Constants yet, you have nevertheless used one of them for the value of one of your Target Fields

Rest assured you will be assigning the values for the rest of the Target Fields as the exercises progress.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article