Adding a Business object

Let's understand how rules are defined. You have implemented the SalesToContract process for quote fulfillment. You have quote data to be entered while the sales representative user initiates the process. You have to mention the Customer Type while filling the quote data. Customers are categorized as—Premium, Gold, Silver, and New.

Business Users have defined some rules, such as:

  • Rule 1, Check Customer: If a customer is new and the quantity entered meets the defined range of values, the process will move ahead for management approval.

    Level 1 and Level 2 approval in the management chain is also defined in the rule. The level of management approval is defined by the rule itself. The discount is calculated in the rule, based on quantity.

  • Rule 2, Check Discount: If the discount offered to a customer is greater than the specified threshold value, and if it's a Premium customer, then Business Analyst Review is not required.
  • However, if it's not a Premium customer, then a Business Analyst Review is required.

Have a look at Rule 1, Check Customer. You need to have a Business object to hold values of Level 1 and Level 2 flags, level details, modified discount, and so on.

Look at Quote.xsd, which you have used for the implementation of the process. You can find the ApprovalFlow element of the complex type ApprovalFlowType, as shown in the following screenshot:

Adding a Business object

You will add this Business object to the process.

How to do it...

In this section, you will deal with the creation of Business objects:

  1. Start Oracle JDeveloper, select Default Role, and click OK.
  2. Go to BPM Project navigator | Project | Business Catalog.
  3. Right-click Data Module | New and select Business Object.
    How to do it...
  4. In the Create Business Object dialog, enter the Business object name as ApprovalFlow, check Based on external schema, and select ApprovalFlow from Quote.xsd schema:
    How to do it...
  5. Click on the process name in the Application navigator. You can find a structure window in the lower-left corner of JDeveloper. You have a Business object created. Let's create a Process Data object based on this Business object.
  6. In the Structure window, right-click Process Data object and select New.
  7. In the Create Data Object dialog, enter name of process Data object as ApprovalFlow, select Type as Component, and select ApprovalFlow as the component.
    How to do it...
  8. When finished, Save.

How it works...

When you implement business rules, such as Check Customer and Discount Check, you will use the Business and Process objects as output facts. In the Rule designer, you make Business objects and their methods known to Oracle Business rules, using fact types that are part of a data model. You can create fact types and Bucketsets before you create rules. The fact that you have created just now is an XML fact, as it's imported from existing sources by specifying XML Schema (Quote.xsd).

In Oracle Business rules, facts that you can run against the rules are Data objects that have been asserted. Each object instance corresponds to a single fact. Elements and types defined in XML Schema can be imported into the data model so that instances of types can be created, asserted, modified, and retracted by rules.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.79.176