What You May Need to Know About Testing a Standalone Decision Service Component

25 Using Declarative Components and Task Flows 25-1 25 Using Declarative Components and Task Flows This chapter describes how to use different Oracle Business Rules declarative components and task flows to develop high-performance, interactive, and multitiered applications that are also easy to maintain. This chapter includes the following sections: ■ Section 25.1, Introduction to Declarative Components and Task Flows ■ Section 25.2, Using the Oracle Business Rules Editor Declarative Component ■ Section 25.3, Using the Oracle Business Rules Dictionary Editor Declarative Component ■ Section 25.4, Using the Oracle Business Rules Dictionary Task Flow ■ Section 25.5, Localizing the ADF-Based Web Application

25.1 Introduction to Declarative Components and Task Flows

Declarative components are reusable, composite User Interface UI components that comprise other existing Application Development Framework ADF Faces components. Consider an application that contains multiple JSF pages. On a particular page, a set of specific components is used in multiple parts of that page. In this scenario, if you make any changes to any of the components in the set, you typically must replicate the changes in multiple parts of the page. This approach makes it difficult to maintain the consistency of the structure and layout of the page. However, by defining a declarative component that comprises the given set of components, you can reuse that composite declarative component in multiple places or pages. Declarative components, thereby, save time and ensure integrity across pages, because when you make any changes to the components, the JSF pages using them automatically get updated. ADF task flows are reusable components that provide a modular and transactional method in specifying the control flow in an application. You can use a set of reusable task flows as an alternative to representing an application as a single large JSF page flow, thereby providing modularity. Each task flow contains a part of the entire navigational plan of the application. The nodes in a task flow are called activities. Apart from navigation, task flow activities can also call methods on managed beans or call another task flow without invoking any particular page. This facilitates reuse because business logic can be invoked independently of the page being displayed. 25-2 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite

25.2 Using the Oracle Business Rules Editor Declarative Component

This section discusses the Oracle Business Rules Editor declarative component. It also provides information on how to create and run an application using the Rules Editor component, and then deploy the application. In addition, this section lists the supported tags and the localization process for the application.

25.2.1 Introduction to the Oracle Business Rules Editor Component

Oracle Business Rules Editor is a declarative component that can be embedded in any ADF-based Web application. The component renders the user interface for rules editing and handles all events associated with rules editing. Rules Editor uses the Rules SDK2 API to create and edit rules. Using Rules Editor, you can edit rules and decision tables that are part of a single ruleset. You require to specify a RuleSetModel object, which is a wrapper around the Rules SDK ruleset object, as a parameter to the Rules Editor component. If multiple rulesets are required to be modified, multiple Rules Editor components must be instantiated, one for each ruleset. The Rules Editor component performs the following functions: ■ Creates, updates, and deletes: – Rules in a ruleset, as shown in Figure 25–1 : Figure 25–1 Rules in a Ruleset – Simple tests or conditions in a rule, as shown in Figure 25–2 : Note: You should not confuse Rules Editor with Rules Dictionary Editor. Rules Editor is used to edit rules inside a specified ruleset. In fact, Rules Editor is embedded within Rules Dictionary Editor. For more information about Rules Dictionary Editor, see Section 25.3, Using the Oracle Business Rules Dictionary Editor Declarative Component. Using Declarative Components and Task Flows 25-3 Figure 25–2 Simple Tests or Conditions in a Rule – Actions in a rule, as shown in Figure 25–3 . Figure 25–3 Actions in a Rule – Decision tables, as shown in Figure 25–4 . Figure 25–4 Decision Tables ■ Sets effective dates and priorities for rulesets and rules. ■ Provides support for user-defined operators. ■ Provides a Condition Browser pop-up to display the left or right value options, as shown in Figure 25–5 .