Back
 

Automate Warehouse Builder Task using Experts

iWare Logic > Blog  > Automate Warehouse Builder Task using Experts

Automate Warehouse Builder Task using Experts

ExpertAutomate Warehouse Builder Task using Experts

If you are a knowledgeable developer of Warehouse Builder, you can design solutions that simplify routine tasks and implement best practices. You can develop these solutions, called experts, in the Expert Editor. To develop experts, you should have a working knowledge of OWB, the Warehouse Builder scripting language, and Tool Command Language (Tcl), which is an open-source programming language.


Now we will see the steps to implement the same.

Creating the EXP_DEMO Expert:

1. A common requirement within Experts is an error handler for example, trapping the fact that a user hit the ‘Cancel’ button on a dialog and exiting gracefully with a message. I logged in as OWB user, from the Design Center expanded OWB_DEMO project, right-click the Experts node from the short-cut menu select New. In the Create Expert Module dialog, enter exp_mod (OWB automatically converts to uppercase) as the name. In the Description field enter description. Ensure the Proceed to Expert Wizard checkbox is clicked. Click OK.

image001

2. In the Create Expert dialog, I enter exp_demo (OWB automatically converts to uppercase) as the name. In the Description field I enter An Expert to handle errors. Click OK. The Expert Editor launches. The Expert Editor canvas by default contains two tasks, START_TASK and an END_TASK.

Automate Warehouse Builder Task

3. Add a Custom Dialog task onto the canvas. A custom dialog helps to get some information from the user. You can also use this dialog to provide some instructions to users. In the Expert Editor Window, from the Palette (lower left hand panel), drag and drop onto the Expert (canvas) a Custom Dialog.

Automate Warehouse Builder Task

4. Draw a transition line from the START_TASK to CUSTOM_DIALOG_TASK to CUSTOM_DIALOG_TASK to END_TASK. You canvas must look as follows:

Automate Warehouse Builder Task

5. With the CUSTOM_DIALOG_TASK task clicked, click the Dialog Builder tabbed page from the Task Editor panel. On the Dialog Builder tabbed page, in the Title field enter Error Handler as the title for the custom dialog task. Make note of the two buttons OK and Cancel; these buttons appear in the custom dialog.

Automate Warehouse Builder Task

6. To specify some information message to be displayed to the user, create a label. Click the Add button located on the bottom right hand corner of the Task Editor panel. Clicking on the Add button adds a new row in the Task Editor panel for the selected custom dialog task.

Automate Warehouse Builder Task

7. On the Task Editor panel, in the Content field for the newly created row enter “Hello from the Error Handler”.

Automate Warehouse Builder Task

8. To get an early preview of how this appears when the expert is run, click the checkbox Show Preview. The preview of the dialog is shown inside the Custom Dialog Preview panel. Note: Sometimes, the Custom Dialog Preview panel could appear on the right of the Task Editor panel.

image014

Here I have finished with creation of an expert.
After the completion we now start with the validation of the Expert. Validation is necessary for assuring successful Execution of the Expert. Following are the steps.

Validating the Expert

1. Validating the Expert helps you to ensure that there are no syntax errors and you can correct any errors before execution. Validate is an optional step. In the Expert Editor, from the Expert menu, select Validate. Ensure there are no errors. You can ignore warnings about goals and instructions not specified.

Automate Warehouse Builder Task

2. In the Compilation Results panel, the validation results are displayed. You can ignore the warnings. In this example you receive one warning. You can ignore any warnings about goals and instructions not being specified.

Automate Warehouse Builder Task


Executing an Expert

1. Click the Start button from the toolbar in the Expert Editor window.

Automate Warehouse Builder Task

2. When you run an expert the Expert Warning dialog is displayed, click Yes to proceed with executing the expert.

Automate Warehouse Builder Task

3. When the Expert runs, this is what you see on your screen. The title that you specified appears in the title bar of the custom dialog, the message that you specified appears as the main dialog text, and the two buttons. Click OK in the Error Handler dialog.

Automate Warehouse Builder Task

4. The Expert Information dialog appears. This dialog is displayed every time an expert is completed successfully. Click OK in the Expert Information Dialog to go back to the Design Center.

Automate Warehouse Builder Task

Here we have seen the detailed steps of implementing Warehouse Experts. I hope this article will help you to understand how and why Experts are used and how you can implement it in different real time scenarios.


Vishwajit

Share