Saturday, May 26, 2012

Working with Packages

Working with Packages

Introduction to Packages

The Package is the largest unit of execution in Oracle Data Integrator. A Package is made up of a sequence of steps organized into an execution diagram.
Each step can either succeed or fail its execution. Depending on the execution result (success or failure), a step can branch to another step.

Introduction to Steps


Type Description See Section
Flow (Interface)
Executes an Interface.
Section 10.3.1.1, "Executing an Interface"
Procedure
Executes a Procedure.
Section 10.3.1.2, "Executing a Procedure"
Variable
Declares, sets, refreshes or evaluates the value of a variable.
Section 10.3.1.3, "Variable Steps"
Oracle Data Integrator Tools
These tools, available in the Toolbox, enable to access all Oracle Data Integrator API commands, or perform operating system calls
Section 10.3.1.4, "Adding Oracle Data Integrator Tool Steps"
Models, Sub-models, and Datastores
Performs journalizing, static check or reverse-engineering operations on these objects
Section 10.3.1.5, "Model, Sub-Models and Datastore Related Steps"
Description of Figure 10-1 follows
Description of "Figure 10-1 Sample Package"
For example, the "Load Customers and Invoice" Package example shown in Figure 10-1 performs the following actions:
  1. Execute procedure "System Backup" that runs some backup operations.
  2. Execute interface "Customer Group" that loads the customer group datastore.
  3. Execute interface "Customer" that loads the customer datastore.
  4. Execute interface "Product" that loads the product datastore.
  5. Refresh variable "Last Invoice ID" step to set the value of this variable for use later in the Package.
  6. Execute interface "Invoice Header" that load the invoice header datastore.
  7. Execute interface "Invoice Lines" that load the invoices datastore.
  8. If any of the steps above fails, then the Package runs the "Send Alert" step that sends an email to the administrator using an Oracle Data Integrator tool.

 

Introduction to the Package editor

The Package editor provides a single environment for designing Packages. Figure 10-2 gives an overview of the Package editor.
Figure 10-2 Package editor
Description of Figure 10-2 follows


Creating a new Package

To create a new Package:
  1. In the Project tree in Designer Navigator, click the Packages node in the folder where you want to create the Package.
  2. Right-click and select New Package.
  3. Type in the Name of the Package.
  4. Go to the Diagram tab.
  5. Add steps as described in Section 10.3, "Working with Steps"
  6. From the File menu, click Save.

10.3 Working with Steps

Packages are an organized sequence of steps. Designing a Package consists mainly in working with the steps of this Package.

10.3.1 Adding a Step

Adding a step depends on the nature of the steps being inserted. See Table 10-1 for more information on the different types of steps. The procedures for adding the different type of steps are given below.

10.3.1.1 Executing an Interface

To insert a Flow (Interface) step:
  1. Open the Package editor and go to the Diagram tab.
  2. Select the interface to add to the Package from the Designer Navigator Projects tree.
  3. Drag and drop the interface into the diagram. A flow Step appears.
  4. Click the step icon in the diagram. The properties panel opens.
  5. In the General tab, edit the Step Name field.
  6. From the File menu, click Save.

10.3.1.2 Executing a Procedure

To insert a Procedure step:
  1. Open the Package editor and go to the Diagram tab.
  2. Select the procedure to add to the Package from the Designer Navigator Projects tree.
  3. Drag and drop the procedure into the diagram. A procedure step appears.
  4. Click the step icon in the diagram. The properties panel opens.
  5. In the General tab, edit the Step Name field.
  6. In the Options tab, set the procedure options if needed.
  7. From the File menu, click Save.

10.3.1.3 Variable Steps

There are different variable steps within Oracle Data Integrator:
  • Declare Variable: When a variable is used in a Package (or in elements of the topology which are used in the Package), it is strongly recommended that you insert a Declare Variable step in the Package. This step explicitly declares the variable in the Package.
  • Refresh Variable: This step refreshes the variable by running the query specified in the variable definition.
  • Set Variable: There are two functions for this step:
    • Assign sets the current value of a variable.
    • Increment increases or decreases a numeric value by the specified amount.
  • Evaluate Variable: This step compares the value of the variable with a given value according to an operator. If the condition is met, then the evaluation step is true, otherwise it is false. This step allows for branching in Packages.
Declaring a Variable
To insert a Declare Variable step:
  1. Open the Package editor and go to the Diagram tab.
  2. In Designer Navigator, select the variable to add to the Package from the Projects tree for a project variable or from the Others tree for a global variable.
  3. Drag and drop the variable into the diagram. A variable step appears.
  4. Click on the step icon in the diagram. The properties panel opens.
  5. In the General tab, fill in the Step Name field. Select Declare Variable in the Step Type.
  6. From the File menu, click Save.
Refreshing a Variable
To insert a Refresh Variable step:
  1. Open the Package editor and go to the Diagram tab.
  2. In Designer Navigator, select the variable to add to the Package from the Projects tree for a project variable or from the Others tree for a global variable.
  3. Drag and drop the variable into the diagram. A variable step appears.
  4. Click on the step icon in the diagram. The properties panel opens.
  5. In the General tab, fill in the Step Name field. Select Refresh Variable in the Step Type.
  6. From the File menu, click Save.
Setting a Variable
To insert a Set Variable step:
  1. Open the Package editor and go to the Diagram tab.
  2. In Designer Navigator, select the variable to add to the Package from the Projects tree for a project variable or from the Others tree for a global variable.
  3. Drag and drop the variable into the diagram. A variable step appears.
  4. Click on the step icon in the diagram. The properties panel opens.
  5. In the General tab, fill in the Step Name field. Select Set Variable in the Step Type.
  6. Select Assign or Increment depending on the operation you want to perform on the variable value.
  7. Type in the Value field the value to set or the increment. This value may be another variable.
  8. From the File menu, click Save.
Evaluating a Variable
To insert an Evaluate Variable step:
  1. Open the Package editor and go to the Diagram tab.
  2. In Designer Navigator, select the variable to add to the Package from the Projects tree for a project variable or from the Others tree for a global variable.
  3. Drag and drop the variable into the diagram. A variable step appears.
  4. Click on the step icon in the diagram. The properties panel opens.
  5. In the General tab, fill in the Step Name field. Select Evaluate Variable in the Step Type.
  6. Select the Operator used to compare the variable value.
  7. Type in the Value field the value to compare with your variable. This value may be another variable.
    Note:
    You can specify a list of values in the Value field. When using the IN operator, use the semicolon character (;) to separate the values of a list.
  8. From the File menu, click Save.

No comments:

Post a Comment