Professional Documents
Culture Documents
Users Guide
ModelMaker
ModelMaker
Users Guide
CONTENTS
iii
Contents
INTRODUCTION ........................................................................................ 1 What is ModelMaker? ..........................................................................1 Before You Read On ............................................................................1 Other Resources .................................................................................1 MODELMAKER BASICS ............................................................................... 2 Objects .............................................................................................2 Attributes ..........................................................................................2 Domain Models...................................................................................2 MODELMAKER USER INTERFACE ................................................................... 4 TUTORIAL: CREATING A DOMAIN MODEL ........................................................ 5 Creating the Object.............................................................................5 Adding Attributes................................................................................6 Validating the Domain Model ................................................................7 Previewing the Object .........................................................................8 Saving the Domain Model ....................................................................8 Creating the Database Table .............................................................. 10 EXAMPLE DOMAIN MODELS ....................................................................... 13 FEATURES IN DEPTH ................................................................................ 14 Database Output Objects Explained ..................................................... 14 Validating Domain Models .................................................................. 15 Configuring Objects .......................................................................... 15 Configuring Attributes ....................................................................... 16 Modifying an Existing Object .............................................................. 17 Creating and Deleting Database Tables ................................................ 18 INDEX.................................................................................................. 19
INTRODUCTION
Introduction
What is ModelMaker?
ModelMaker is an application for modeling the objects used by a robot, such as the objects that the robot extracts and the objects that it accepts as input objects.
Other Resources
Additional, mostly referential documentation on ModelMaker is available in the ModelMaker entry in RoboHelp, which is accessible from the Help menu in ModelMaker. You should also check out the support site at this URL: http://support.kapowtech.com/
ModelMaker Basics
ModelMaker is an application for creating the objects that are used by robots. This chapter introduces you to the key concepts in ModelMaker. With ModelMaker, you are able to design objects that are modeled after realworld data. In the most common case, an object is designed to hold the data that a robot collects or extracts from a data source. In RoboMaker, you are able to build your robots using the objects you create with ModelMaker. See the RoboMaker Users Guide for more information about how RoboMaker uses the objects created by ModelMaker.
Objects
Objects can be used by robots for different purposes. For example, a robot can extract objects, return error or status objects, or it can receive objects as input, known as input objects. An object has an object type that determines how the object can be used. The following object types are available: Input Object this is an object that can be given as input to a robot, to provide information that the robot needs to perform its task. Output Object this is an object that can be extracted by a robot. This type can also be used for other objects to be returned by a robot, such as error or status objects. Database Output Object this is an object that can be extracted by a robot and stored in a database. In essence, objects are used as data carriers, either as input to a robot in the form of input objects, or as output from a robot in the form of output objects or database output objects.
Attributes
An object has a number of attributes. The attributes are where the data is held inside an object. For example, a news article object could have attributes such as title, author, date, and content. An attribute has an attribute type, which determines what kind of data the attribute can contain. For example, the title attribute of a news article object could have the type Short Text. There are many different attribute types available, such as Short Text, Long Text, Character, Integer, Number, Date, Boolean, and Binary. The data in an attribute is called an attribute value.
Domain Models
Objects are organized into domain models. A domain model defines one or more objects. A domain model typically models a specific domain, such as
MODELMAKER BASICS
news, stocks, or airline information, by defining the objects that are relevant for that domain. ModelMaker is an application for creating domain models, just as RoboMaker is an application for creating robots. In ModelMaker, you are always working on a current domain model. A domain model must satisfy certain requirements to be used in the other applications of Kapow Mashup Server. The domain model is said to be valid if it satisfies these requirements. Checking whether a domain model is valid is called validating the domain model.
Figure 1: ModelMaker Main Window To the left in the window is the Object List. This is the list of objects in the domain model that you are working on. You can add new objects, remove objects, change the order of the objects, and preview objects (to see how they will appear in RoboMaker), using the buttons below the Object List. The currently selected object is configured in the right part of the main window. Among other things, you can configure the attributes of the object. This is done in the Attribute Table. You can add new attributes, remove attributes, change their order, and configure attributes using the buttons below the Attribute Table.
Note that a number of attributes have already been added to the object, such as robotId, robotRunId, etc. These attributes are for administration purposes and are required for a database output object. Therefore, you should not remove or change these attributes. They are shown in gray as a reminder that they are required and should not be modified.
Adding Attributes
Now, let us add a title attribute to the article object. Click the button below the Attribute Table. The Attribute Configuration window will pop up. Configure the attribute as shown below:
Click the OK button. As you return to the main window, notice that the title attribute has been added to the Attribute Table.
Add another attribute for the body text of the article, and configure it as shown below. Note that you should set the attribute type to Long Text:
Click OK to return to the main window. Of course, a real-world article object would have more attributes than these, but let us skip those in this example.
As you can see, your domain model is not yet valid, since you havent given the object a name. Therefore, set the name of the object to MyArticle.
Then try to validate the domain model again by clicking the should see this message:
This can be especially useful if you want to verify that attributes that are not marked as Visible are indeed hidden inside the object. Note that in our case, only our two new attributes are shown. The six attributes that were grayed when we created our database output object all have the Visible property unchecked in their configurations.
you are currently working on. For more information on robot libraries and robot projects, see the RoboMaker Users Guide. To save your domain model, click the icon, and choose the folder to save the domain model in. ModelMaker will default to the robot library folder of the current robot project, which is where we want to save the domain model in this tutorial. Enter MyArticle as the file name and click Save. Your domain model will now be saved as the file MyArticle.model. Now, let us check that the domain model is accessible in RoboMaker. To use a newly created domain model in another Kapow Mashup Server application that is already running, you must reload the domain models in that application by clicking the icon in the application. If you already have RoboMaker running, reload its domain models now to make it use the new domain model, otherwise start RoboMaker now. In RoboMaker, go to the Output Objects tab of the Objects View, located in the lower right corner of the RoboMaker Main Window, and shown below.
10
Click the Add/Remove... button to open the Add/Remove Output Objects icon to add a new output object to the robot. You should window. Click the now be able to select your MyArticle object in the drop-down box. Do that, and then click OK to close the window. You can now view your object in the Output Objects tab, which should look like this:
As you can see, the MyArticle object has the title and body attributes that you defined in ModelMaker, and looks as when we previewed it in ModelMaker. Note also that the administration attributes (robotId, robotRunId, etc.) are not visible or accessible. Important Note: You cannot have two objects with the same name in the same robot library, even if the objects are in two different domain models in the robot library.
11
To see how to create the database table for the MyArticle object, select Create Database Table ( ) in the Tools menu of ModelMaker. This will open the Create Database Table Window. Select the MyArticle object in the Object property, as shown below:
Next, select the database name along with the relevant database vendor type for that database. Click Generate SQL. This will generate a suggestion for an SQL statement for creating the table, similar to the one shown below:
You can edit the SQL statement to fit your needs, and then execute it or save it. However, in this tutorial, just click Close in the two windows to close them without doing anything with the statement.
12
This completes the tutorial. Youve now learned how to create a new domain model with an object from scratch, and make it ready for use in robots you create with RoboMaker.
13
14
Features in Depth
This chapter discusses the features of ModelMaker in more detail. For more specific information about configuring domain models, objects, and attributes, please consult the online RoboHelp entries for ModelMaker.
When storing an object in a storage location, an important issue is what to do if the storage already contains the particular object. A simple mechanism is used for refinding existing objects in storage and updating these instead of inserting multiple copies of the object. When a database output object is ready to be added to storage, a search is made for an existing object with the same refindKey in the storage. If such an object exists, it will be updated, and if not, the extracted object will be inserted. You must select the attributes to include in the comparison when refinding objects, by setting the Part of Refind Key option of those attributes. As for the remaining attributes required, the firstExtractedDate is the date and time when the object was extracted for the first time, and the latestExtractedDate is the date and time when the extracted object was most recently inserted or updated. The extractedInLatestRun attribute will be true if the object was extracted in the latest robot run. The way in which your extracted objects are physically stored depends on the Storage Environment that is used when the robot is run. See the RoboServer Users Guide or the RoboRunner Users Guide for more on running
FEATURES IN DEPTH
15
robots with environments. Note that not all storage environments support refinding of objects. In the case of saving a database output object to database storage using the Database Storage Environment, it is of course necessary that the appropriate database table exists in a database that is available. This means that it is a requirement that the table contains columns that match the attributes listed above, as well as columns for all of the attributes specific to the object. See the Creating and Deleting Database Tables section for more information on how ModelMaker can assist you in setting up the appropriate database tables. Consult the Installation Guide for more information on setting up database connections. For more information about environments, see the RoboRunner Users Guide and the Environments section of the RoboRunner section in the online RoboHelp.
Configuring Objects
When working with an object within a domain model, it is important that you configure all of the relevant properties of the object. Otherwise, the domain model will be invalid, or the object will not behave as expected when used in RoboMaker. To configure an object, you must first select it in the Object List. The selected object is then displayed in the right side of the main view of ModelMaker, where you can make changes. All objects within a domain model must have a valid name. If a domain model contains only one object, it is common practice to give the same name to both the domain model and the object. This will not cause any problems, and can in fact help simplify things in many cases. You can set the name of an object above the Attribute Table in the object configuration view. Also, as mentioned previously, all objects must have an object type, which indicates how the object will be used. You can choose the object type for an object using the Type drop-down box below the Attribute Table.
16
Configuring Attributes
The attributes within an object must also be correctly added and configured in order for the object to be valid. You must specify both a name and a type for each attribute. The available attribute types are shown in Figure 2. Attribute Type Integer Number Boolean Character Short Text Long Text Password Description An integer, e.g. 12. A number, e.g. 12.345. A boolean value, i.e. either "true" or "false". A single character, e.g. "A". A short text. Will be displayed in a one-line text field. A long text. Will be displayed in a multi-line text box. A password. Will be diplayed in a password field that shows asterisks instead of the characters in the password. An HTML clip. This is the same as a Long Text, except that you can preview the clip in a browser window. An XML document. This is the same as a Long Text, except that only well-formed XML documents are allowed. A date. The date must be of the form yyyy-mm-dd hh:mm:ss.n, e.g. "1992-04-25 10:33:06.0". Binary data, i.e. any sequence of bytes. An image. This is the same as Binary Data, except that you can preview the image. A PDF document. This is the same as Binary Data, except that you can preview the PDF document. A session (containing cookies, authentications, etc.). A currency code, as defined by the ISO-4217 standard, e.g. "EUR" for Euro. A country code, as defined by the ISO-3166 standard, e.g. "DE" for Germany.
HTML
XML
FEATURES IN DEPTH
17
Description A language code, as defined by the ISO-639 standard, e.g. "de" for German. A special refind key used for refinding objects. Figure 2: Attribute Types
The Refind Key attribute type is used when storing database output objects see the section Database Output Objects Explained for more information. An attribute has a number of other configurable properties, such as whether or not the attribute is visible from within RoboMaker, and whether or not the attribute is required to contain data before the object can be stored. Refer to the online RoboHelp entries in ModelMaker on attribute configuration for more information.
You may perform the following changes to an object, but some of the existing robots may generate errors when they are executed (you can subsequently fix these errors): Change the name of an attribute. Change the Required property of an attribute from false to true. Add a new attribute that has the Required property set to true. Delete or rename an attribute that has its default value in the Robot Configuration.
18
Change the type of an attribute that has its default value in the Robot Configuration.
You can always make the following changes, without affecting the existing robots: Change the Required property of an attribute from true to false. Change the name and revision of a domain model. Change a comment (no matter where). Add a new object with a new name. Add a new attribute that has the Required property set to false.
INDEX
19
Index
A
attributes, 2 adding to object, 6 configuring, 17 types, 2, 17
O
objects, 2 adding attributes, 6 configuring, 15 creating, 5 database output, 2, 14 input, 2 modifying existing, 18 naming, 10 output, 2 previewing, 8 refinding, 14 storing extracted, 15 types, 2 output object, 2
C
current robot project, 9
D
database output object, 2 database tables creating, 10, 19 deleting, 19 domain models, 3 saving, 9 validating, 7, 15
R
refind key, 14 robot library, 9
E
example domain models, 13
S
Storage Environment, 15
I
input objects, 2
V
validation, 7, 15
M
ModelMaker, 1, 2