E Lti B I L I Encapsulating Business Logic With Business Rules Components

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

Encapsulating
E l ti Business
B i Logic
L i
with Business Rules Components

s a
h
) ฺa
o m
c l eฺc Guide
o ra ent
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X u a
s f er
i n
Bu n-tra
no
Objectives

After completing this lesson, you should be able to:


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Describe the concepts of business rules


• List the artifacts of business rules
• Explain how business rules are defined
• Describe the usage patterns for Business Rule service
components
• Integrate the Business Rule service component in the a
BPEL process h a s
m ) ฺ
• Edit business logic at run time by using SOA ฺc o ide
leComposer a c t Gu
r
o den
an Stu@
x u
ฺ b ui- e this
o a n us
( h t o
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X u a
s f er
i n
Bu n-tra
no

Oracle SOA Suite 12c: Essential Concepts 8 - 2


Roadmap

• Introducing business rules


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Defining business rules


• Using Business Rule service components in SOA
Composites
• Editing business rules by using SOA Composer

s a
h
) ฺa
o m
c l eฺc Guide
o ra ent
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X u a
s f er
i n
Bu n-tra
no

Oracle SOA Suite 12c: Essential Concepts 8 - 3


Introducing Business Rules

• Business rules:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

– Are used to separate business logic from the process flow


– Are expressed declaratively
– Can be edited by business users
• Oracle Business Rules include:
– A rule authoring tool
– A rules engine
s a
– A development kit a
)h ฺ
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a
s f er
u logic contained
u i
The business
r a n in a SOA Composite application is used to describe and
B
implement n - t
o validations,
Usuallynthis
derivations, business-oriented calculations, and other business rules.
logic is defined by the business analysts, and then implemented by developers as
part of the programs they write. It is common to find that the business logic is implemented in
the application using hard-coded values and references. Code is not easy for nontechnical
users to read, and is often difficult to understand and modify. Companies frequently change
their policies, which in many production environments results in the developer modifying
affected applications, recompiling, and redeploying the application.
A better practice is using business rules to separate business logic from the process flow. By
doing this
this, the process of modifying business rules and policies can be simplified without the
software development lifecycle implications.
The business logic is implemented by using an almost declarative rule language that can be
executed in the business rule engine, which is specially equipped for the task of executing
such business logic.

Oracle SOA Suite 12c: Essential Concepts 8 - 4


Oracle Business Rules include:
• An authoring tool that presents an English-like paradigm for declaring rules that can be
used by both programmers and business analysts
• A fast and efficient JSR
JSR-94–compliant
94 compliant, RETE
RETE-based
based rules engine written in Java
• A development kit that enables rules generation by custom rules-editing applications
With Oracle Business Rules, business users can make changes to the business logic at any
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

time, and these changes take effect immediately. This gives your business processes agility
without having to make changes to your code, test, redeploy, and go through the usual IT life
cycle.

s a
h
) ฺa
o m
c l eฺc Guide
o ra ent
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le lic
n B ab
- X u a
s f er
i n
Bu n-tra
no

Oracle SOA Suite 12c: Essential Concepts 8 - 5


Declarative Rule Concepts

Rule statements are easier to maintain than procedural code


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

because they:
• Declare intent instead of coding logic
• Exclude control flow that is determined by the rules engine
• Relate well to business user drivers
Examples:

If a customer is a Premium customer, offer them a 10% discount. as


a
m )h ฺ
l e ฺco uide
If a customer is a Gold customer, offer them a a
r 5%c discount.
t G
@ tudeo n
a n
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a
u nature
s f er
i
u -tran of rules makes them easier to maintain than code because rules:
The declarative
B
non
• Declare intent of business drivers
• Exclude flow control that is typical of procedural logic
• Are constructed in a way that is not very technical and is accessible to nonprogramming
personnel
The examples in the slide are declarative statements expressed as IF-THEN conditions that
drive business policies with the intent of providing discounts to loyal customers based on the
customer status.

Oracle SOA Suite 12c: Essential Concepts 8 - 6


Benefits of Using Business Rules

• Agility:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

– Rules are easier to change.


– Rules are more responsive.
• Reuse

s a
)h ฺa
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a f er
u of simplementing
The key i
u -tran
benefits business logic using business rules are:
B
• Agility: n An agile application enables it to be more adaptable to change. Rules can be
naoged
cchanged sepa
separately
ate y from
o thet e flow,
o , even
e e when e the t e process
p ocess is sa already
eady dep
deployed.
oyed That
at
makes it easier to meet the changing needs of the business, enabling the applications to
be more responsive to business requirements.
• Reuse: The same rules implementing a specific piece of business logic can be used in
many different processes and SOA composite applications. This enables rules to be
accessible throughout an enterprise so that any application can consistently execute the
same rule and polices that have been declaratively expressed and receive the same
outcome for the same set of factual information
information.

Oracle SOA Suite 12c: Essential Concepts 8 - 7


Guidelines for Using Business Rules

• Avoid either overuse or underuse of business rules.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Consider implementing rules that are likely to change


frequently.
• Examples for using business rules:
– Dynamic processing
– Data validation and constraint checks
– Business rules externalized from the process
s a
a
)h ฺ
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a
uto implement
s f er
u i
It is possible
r a n most business logic in BPEL, XPath, and XSLT, or in Java.
B t
on- canoccurrences
However, you
includenfrequent
overdo the amount of business logic in the programs you create. Examples
of hard-coded values, business-oriented calculations and
conversions, and abundant usage of IF-THEN branches. If you see these signs, you should
consider engaging a decision service. But inappropriate use of business rules can also occur.
For example, using business rules for logic that does not change frequently can introduce
complexity and overhead that serves no good purpose.
Examples for using business rules include:
• Dynamic processing: Rules can determine intelligent routing paths within a business
process based on service
service-level
level agreements or other guidelines
guidelines.
• Data validation and constraint checks: Rules can validate input documents or apply
additional constraints on requests.
• Externalize business rules in the process: Rule conditions evaluated as part of a
business where parameters can be changed are best implemented separately from the
process.

Oracle SOA Suite 12c: Essential Concepts 8 - 8


Roadmap

• Introducing business rules


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Defining business rules


• Using Business Rule service components in SOA
Composites
• Editing business rules by using SOA Composer

s a
h
) ฺa
o m
c l eฺc Guide
o ra ent
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X u a
s f er
i n
Bu n-tra
no

Oracle SOA Suite 12c: Essential Concepts 8 - 9


Artifacts of Business Rules

• Facts: Are data or business objects that get aggregated,


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

created, or manipulated in business rules


• Rules: Are declared as: “If Condition Then Action”
• Ruleset: Has a collection of rules
• Dictionary: Has a collection of fact types, global
variables/constants, functions, and rulesets
Business Rule Dictionary
s a
Facts Globals Functions )h ฺa
m
l e ฺco uide
rac ent G
Functions
Decision

Consumers Ruleset @ tud o


a n
Match customer
u i - xustatushis SIF condition1 THEN action
ฺb range
Match price
e t
o a n u s IF condition2 THEN action
(h se t o
a n
u © 2014, n and/or its affiliates. All rights reserved.
i - X
Copyright l i c eOracle
B u ble
u an fera
X
i- raRules
OracleuBusiness n s are contained in a rule dictionary, which is stored in the Metadata
B (MDS)
Services
o n -t repository. A rule dictionary contains one or more definitions of:
nu esets A ruleset
• Rulesets: u eset is
s a co
collection
ect o o of o
one
eoor more o e related
e ated rules u es tthat
at a
are
e see
seen as a u
unitt o
of
execution and can be chained together to yield an outcome. Each rule is declared as a
conditional expression (also known as test) with an action. The condition evaluates and
compares facts. If the evaluation of facts is true, then one of the following actions is
performed:
- Assigning values to other facts or results
- Asserting values
- Calling functions (or Java methods) to execute procedural code
• Facts: The data or business objects on which the rule engine evaluates rule conditions.
A fact can be defined based on an XML type in an XSD document, a Java type in class
definitions, or a Rule Language fact.
• Globals: The variables/constants that are centrally defined in the dictionary and can be
accessed among several rules and functions. They are similar to a public static variable
in the Java language.
language

Oracle SOA Suite 12c: Essential Concepts 8 - 10


• Functions: They are defined using the Java-like Rule Language. Similar to a Java
method, the functions can take one or more input arguments and typically return a
result. They can be used in a rule condition or in a rule action. With functions, business
rules become simpler, more readable, and maintainable.
• Decision Functions: The decision function is a specific type of function, which defines
the way rulesets are exposed to consumers. It is the only gateway into the business
logic held in business rules.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

s a
h
) ฺa
o m
c l eฺc Guide
o ra ent
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le lic
n B ab
- X u a
s f er
i n
Bu n-tra
no

Oracle SOA Suite 12c: Essential Concepts 8 - 11


Defining a Ruleset

A ruleset can contain:


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Plain IF-THEN rules


• A decision table, which is a special collection of IF-THEN rules

s a
a
)h ฺ
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a er
ucontainsfeither
A ruleset i
u -tran
can plain IF-THEN rules or a decision table.
B
nes ton match
• An o IF-THEN rule consists of two parts: The test (IF) and the action (THEN). The test
ttries atc the
t e asserted
asse ted facts
acts in the
t e rule
u e engine’s
e g e s working o g memory.
e o y When
e tthe
e test
evaluates to true, a match is made and the action part of the business rule will be
triggered. Actions usually create result data—the output of the business rule. When the
result is false, nothing will happen for this rule.
• A decision table contains a collection of related business rules with condition rows,
rules, and actions, and displays them in a single spreadsheet-style view.

Oracle SOA Suite 12c: Essential Concepts 8 - 12


Example of a Ruleset Containing IF-THEN Rules
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

<operand>

s a
a
)h ฺ
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
u a f er
i-X ramanual
In thisuexample, s
n approval is required for orders with an amount greater than or equal
B n- t
to $5,000; otherwise, the order should be automatically approved.
n o
A rule has a specific structure to be meaningfully evaluated. The parts are shown in the slide.
• The IF area displays the rule pattern tests. At run time, when this rule is processed, the
rule engine checks the facts against rule pattern tests that you defined to find matching
facts. The IF area of a rule includes a left-side <operand> and a right-side <operand>.
The left-side <operand> enables you to select the fact. The right-side <operand>
enables you to select the value to match with the fact for pattern test matching in the
rule.
• The THEN area displays the action associated with a pattern test match in a rule. At run
time, when the IF portion of a rule matches, the rule engine activates the THEN portion
and prepares to run the action. As shown in the example, in ManualApproval rule, when
the orderValue.price fact matches (greater than or equal to $5,000), the rule Engine
asserts that a manual approval is required.

Oracle SOA Suite 12c: Essential Concepts 8 - 13


Example of a Ruleset Containing a Decision Table

A decision table contains a collection of related business rules


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

with condition rows, rules, and actions.

s a
a
)h ฺ
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a
u enables s f er
A decision
u i table
r a n you to create and use business rules in an easy-to-understand
B
format thatn - t
o provides
intuitivenfor
an alternative to the IF-THEN rule format. The decision table format is
business analysts who are familiar with spreadsheets. The formal structure of a
decision table makes it easier to author, understand, and change multiple similar rules.
To help understand decision table concepts, consider the example in the slide that presents a
set of if-then rules that determine if a driver is eligible for a license, and an equivalent decision
table. Note that if a driver has taken a driver training class, then the driver has training
certification.
The if-then rules follow:
• if driver.age < 20 and driver.has_training = true
then driver.eligible = true
• if driver.age < 20 and driver.has_training = false
then driver.eligible = false
• if driver.age >= 20
then driver.eligible = true (do not care about training for this case)

Oracle SOA Suite 12c: Essential Concepts 8 - 14


Working with Decision Functions

A decision function:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Is the gateway to access business rules


• Provides a web service interface for consumers
• Can be invoked from multiple business processes,
processes such as
a Java application or BPEL process
Business Rule Dictionary

s a
a
)h ฺ
Decision Funcction
BPEL
process Ruleset m
co uide
Match A leฺ
r a c tG
Java Web
@ o
Match B
d e n
application Service
x u an Stu Match C

ฺ b ui- e this
o a n us
( h t o
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X u a
s f er
u i
A decision function
r a n mechanism for publishing rules and rulesets as a reusable service
is a
B - t
that can beninvoked from multiple business processes. It is the only gateway into the business
noin business rules because neither business rules nor rulesets are accessible from
logic held
the outside.
A decision function is a function that is configured declaratively. A decision function performs
the following operations:
• Collects rulesets under a single executable umbrella
• Determines input facts—the data against which the initial rule matches are performed
• Collects the consequent actions to be executed
• Runs rulesets
• Returns results

Oracle SOA Suite 12c: Essential Concepts 8 - 15


Quiz

A rule dictionary provides persistent storage for rulesets and


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

rules.
a. True
b False
b.

s a
a
)h ฺ
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X u a
s f er
Answer: i
u a -tran
B
on A rule dictionary provides persistent storage for rulesets, other metadata (such
Explanation:
n
as the data model)
model), and rules
rules. The dictionary is a file in the local file system with a .rules rules
extension.

Oracle SOA Suite 12c: Essential Concepts 8 - 16


Roadmap

• Introducing business rules


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Defining business rules


• Using Business Rule service components in SOA
Composites
• Editing business rules by using SOA Composer

s a
h
) ฺa
o m
c l eฺc Guide
o ra ent
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X u a
s f er
i n
Bu n-tra
no

Oracle SOA Suite 12c: Essential Concepts 8 - 17


Business Rule Service Components
in SOA Composites
The Business Rule service component (also known as Decision
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

Service component) wrapped around the business rule can be:


• Invoked from a:
– BPEL or BPMN process component
– Mediator component
• Exposed as a web service that external partners can call
• Implemented in a separate composite application that a
would be available for reuse from other composites has
m ) ฺ
o
c l eฺc Guide
o ra ent
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a
u the business
s f er
You can
u i create
r a n rule components inside a composite application. In a SOA
B
composite n - t
application, the BPEL Process, Business Rules, and the Human Task components
no
are complementary technologies where:
• The BPEL Process component performs the orchestration of systems, services, and
people
• The Business Rule component evaluates decision making and policies
• The Human Tasks component models a workflow for people to perform as part of an
end-to-end business process flow
Alternatively, we could implement the business rule in a separate composite application that
would
ld b
be available
il bl ffor reuse ffrom other
th composites
it and d would
ld allow
ll ffor llow-impact
i t
redeployment.

Oracle SOA Suite 12c: Essential Concepts 8 - 18


Using Business Rule Service Components with
Other Service Components
Business Rule service components can be used in the
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

following ways within a composite:


• Integrated in a BPEL process for executing rules as part of
approcess flow
• Used to implement dynamic routing for a Mediator
• Configured in advanced routing rules of a Human Task
component for managing human workflow
s a
a
)h ฺ
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a
u how Business
s f er
u i
The slide lists
r a n Rule service components can be used within a composite
B
application.nThe t
- Business Rule service components can be:
n o
teg ated in a BPEL process
• Integrated p ocess for o executing
e ecut g rules u es as pa partt oof a pprocess
ocess flow
o
• Wired to a Mediator component for dynamic routing. Mediators have dynamic routing
rules, which means that the target for the routing rule is determined at run time. When
you create a dynamic routing rule in a Mediator, an associated Business Rule service
component is created along with the wiring from the Mediator. The Business Rule
service component uses a decision table to determine the target endpoint to which a
message is routed through a dynamic external service interface. Even better, business
analysts can use the SOA Composer to edit this decision table for dynamic routing and
thereby determine through easily editable business logic what target services a Mediator
should address.
• Implemented as advanced routing rules in Human Task definitions. Rules can be used
to perform:
- Policy-based task assignments dispatch tasks to specific roles or users
- Load balancing g of tasks among g users to control the task assignment
g load

Oracle SOA Suite 12c: Essential Concepts 8 - 19


Integrating the Business Rule Service Component
in the BPEL Process
Integrate Oracle Business Rules in a BPEL process by adding
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

a Business Rules activity into your BPEL flow.

s a
2 3 a
)h ฺ
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a
u Rules s f er
u i
Integrate Business
r a n in your BPEL process by simply dragging a Business Rule activity
B t
n- flow in the BPEL editor. For the Business Rule activity, you:
into your BPEL
n
1. Spec
o
Specify y tthee bus
business
ess rule
u e by seselecting
ect g tthe e Business
us ess Rule ued dictionary
ct o a y tthat
at you want
a t to use
2. Assign BPEL variables to business rule input facts
3. Assign business rule output facts to BPEL variables
Note: Mapping business rule facts is all it takes to enlist the services of a business rules
component in a BPEL process.

Oracle SOA Suite 12c: Essential Concepts 8 - 20


Quiz

Business Rule service components can easily be integrated


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

with the following components in a composite.


Select all that apply:
a Mediator
a.
b. OSB
c. BPEL process
d. Human Workflow a
h a s
e. Adapter service )
ฺ c om ideฺ
r a cle t Gu
@ o den
x u an Stu
ฺ b ui- e this
o a n us
( h t o
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X u a
s f er
Answer: i
u a, c,-tdran
B
on OSB is not an SCA component in a composite application; adapter services are
Explanation:
n
typically linked to Mediators that perform forwarding and transformation of the XML messages
produced by the adapter services.

Oracle SOA Suite 12c: Essential Concepts 8 - 21


Roadmap

• Introducing business rules


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Defining business rules


• Using Business Rule service components in SOA
Composites
• Editing business rules by using SOA Composer

s a
h
) ฺa
o m
c l eฺc Guide
o ra ent
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X u a
s f er
i n
Bu n-tra
no

Oracle SOA Suite 12c: Essential Concepts 8 - 22


Introducing SOA Composer

You can edit business rules by using the SOA Composer, a


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

browser-based runtime application, accessed at:


http://host:port/soa/composer

s a
a
)h ฺ
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a f er
u is asbrowser-based
u i
SOA Composer
r a n application that allows you to edit business rules at run
B
time. With n t
- tool, a business analyst or an application administrator can easily make the
this
nobusiness logic changes without modifying and redeploying the composite application.
required
You can access the SOA Composer in a web browser with the URL
http://host:port/soa/composer, where host is the server that runs your Oracle SOA; port is
WebLogic Server listen port for the managed SOA server.
Note: SOA Composer rules editing is read-only with the Quick Start installation. This is
because SOA composer does not allow editing when a file-based MDS is used.

Oracle SOA Suite 12c: Essential Concepts 8 - 23


Editing Business Rules in SOA Composer
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

s a
a
)h ฺ
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a
s f er
u the Business
u i
After opening
r a n Rule dictionary, you can edit the ruleset in an interface very
B
similar to the t
-Rule editor in JDeveloper (as shown in the slide). For example, if the finance
nondecides to decrease the automatic approval amount from $5,000 to $3,000, the
department
business analyst just needs to open the SOA Composer and change the value.
After modifying the ruleset, you can either save or commit the changes. The Commit option
will immediately activate the changed business logic, meaning that any call (including from
composite instances that have already started) to the business rule will from now on execute
according to this new logic. The Save option will only save the changes to the MDS
repository. It does not have any impact on the running or to-be-initiated composite instances.
N t At thi
Note: this point,
i t th
the rule
l ddefinition
fi iti iin your d
design-time
i ti environment
i t (JDeveloper)
(JD l ) iis outt off
sync with the definitions in the runtime environment (SOA Suite).

Oracle SOA Suite 12c: Essential Concepts 8 - 24


Summary

In this lesson, you should have learned how to:


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Describe the concepts of business rules


• Describe the artifacts of business rules
• Explain how business rules are defined
• Describe the usage patterns for Business Rule service
components
• Integrate the Business Rule service component in the a
BPEL process h a s
m ) ฺ
• Edit business logic at run time by using SOA ฺc o ide
leComposer a c t Gu
r
o den
an Stu@
x u
ฺ b ui- e this
o a n us
( h t o
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X u a
s f er
i n
Bu n-tra
no

Oracle SOA Suite 12c: Essential Concepts 8 - 25


Practice 8 Overview:
Implementing a Business Rule
This practice covers the following topics:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Creating a business rule


• Integrating the Business Rule component in the BPEL
process

s a
a
)h ฺ
m
l e ฺco uide
o rac ent G
a n @ tud
u i -xu this S
a n ฺb se
h o t o u
(
u an ense
u i-X le
Copyright licOracle and/or its affiliates. All rights reserved.
© 2014,

n B ab
- X
a
u you s f er
In these
u i practices,
r a n will integrate a Business Rule service component in the
B t
- SOA composite. The ManualApproval business rule is accessed by the
ValidatePayment
non BPEL process to make the decision of whether the order requires manual
ValidatePayment
approval. The rule stipulates that when the order’s total amount is marginally over the daily
limit, it needs to go through a manual approval process.

Oracle SOA Suite 12c: Essential Concepts 8 - 26

You might also like