Importing UML model information from spreadsheets

You can import a spreadsheet that contains model information into a UML model in the workspace.

Before you begin

You must have the Structured Data Importer features installed.

You must export the spreadsheet contents into a comma-separated value (.csv) file. You must also identify the model to update with the contents of the .csv file. If you are importing into a domain-specific model, it must have the corresponding profiles applied. Otherwise, the import may fail. It is not necessary to open the model before you import the spreadsheet information.

A JET transformation project with the following characteristics must exist in the workspace:
  • In the plugin.xml file, on the Extensions page: The modelLoader field must be set to com.ibm.xtools.jet.loaders.csv, and the startTemplate field must be set to the entry point to the transformation. Depending on the complexity of your project, this template might also be the template that contains the code to parse the spreadsheet information.
  • The JET tag library to use must be defined as importLibrary on the Extensions page, or in the JET template, as in the following example:
    <%@taglib prefix="uml" id="com.ibm.xtools.taglib.jet.uml.umlTags" %>
You can create a JET transformation project that has these characteristics, or you can import a sample that contains a JET transformation and corresponding JET template. See the related links at the end of this topic.

About this task

You can import the contents of multiple spreadsheets into a model, but you must complete the following steps for each spreadsheet. This procedure assumes that the spreadsheet columns are in the same order in each spreadsheet.

Procedure

  1. Click File > Import > Modeling > JET-based model import; then click Next.
  2. In the Import a Model window, complete the following fields:
    1. In the Source file field, specify the file that contains the spreadsheet information to import.
    2. From the Target domain list, select the domain of the model to update. The JET transformation uses the tags in the JET library that corresponds to the selected domain.
    3. In the Target model field, specify the destination for the imported model elements.
    4. From the JET transformation ID list, select the JET transformation that contains the JET templates that parse the spreadsheet and create the model elements by using the JET tags from the appropriate JET tag library or libraries.
  3. Click Finish. The selected JET transformation parses the model information in the spreadsheet and creates the corresponding model elements in the target model.
  4. In the message window that is displayed when the import operation is complete, click OK. If the message indicates that errors occurred, check the Error Log view for more information.
  5. Verify that the target model contains the elements that you expect, and save the updated model.

What to do next

If you import the spreadsheet information again, or if another file that you import contains an element that is already in the target model, the transformation updates that model element.


Feedback