Running models

 

In this topic ...

Running a Named Model

Running the Model in the Active Model Editor

Running a Model From a Browser

Executing a Specific Method in the Model

Running a Model with Profiles

Related Topics ...

Passing Arguments Via URL

Generating Model URLs

Before we can run (launch) a model, have created at least one WebSphere Portlet Factory Model launch configuration. Depending on how you defined the launch configuration, we can:

  • run a named (specific) model

  • run the model that is in the current active Model Editor

We can also run a model by entering its URL into a browser window.

 

Running a Named Model

If you have created a launch configuration with a named model, we can run it at any time from the Designer.

To run a named model:

  1. Choose Run... from the Run menu.

  2. In the Launch Configurations dialog, choose the named model from the Launch Configurations list.

  3. Click the Run button.

If the named model is in the pull-down menu of the Run icon [Run icon] in the toolbar, we can run the model by clicking on its name.

 

Running the Model in the Active Model Editor

To run the model in the active Model Editor, click the Run icon [Run icon] in the toolbar or choose Run... from the Run menu.

If you are running a model for the first time in your current Eclipse session, the Launch Configurations dialog may be displayed. In this case, choose a WebSphere Portlet Factory model from the Launch Configurations list and click the Run button.

Eclipse keeps a history of the launched programs. To rerun the most recent launch, do one of the following:

  • Click the Run icon [Run icon] in the toolbar.

  • From the Run menu, choose Run Last Launched.

  • Use Control-F11 from the keyboard.

 

Running a Model From a Browser

We can run a model by entering its URL into a browser window. We can find the URL for the model in the Model Properties dialog, which we can display by right-clicking on the model name in the Navigator view and choosing the Properties option.

 

Executing a Specific Method in the Model

Running the model by specifying the URL also allows you to call specific actions in the model and pass explicit profiles to the model. If you do not specify an action in the URL for a model, the Factory servlet executes the model's main method or action list. We can force the Factory servlet to execute a different action by specifying that action in the URL.

For example, to execute a method named "GetCustomers," the URL would be:

http://localhost:7001/mymodels/CustomerModel/Action!GetCustomers

We cannot use a URL to execute a method that takes arguments. For information about passing arguments to a method via URL, see Passing Arguments Via URL.

 

Running a Model with Profiles

We can specify the profiles to apply to a model in the URL with a URL similar to the following example:

http://localhost:7001/factory/webengine/URLTester/Action!main/Profile!ProfileSet1!ProfileB$ProfileSet2!ProfileA

Alternatively, we can use the Applied Profiles view to apply a combination of profiles to the model in the active Model Editor and then run the active model.