Академический Документы
Профессиональный Документы
Культура Документы
Module objective:
In this module, you will learn how to compose and deploy business rules.
Overview
The Microsoft BizTalk Server Business Rule Engine allows business users
to work with developers to create and maintain policies containing business
rule sets. These policies can be quickly updated and immediately applied
without the need to recompile and redeploy a BizTalk assembly. Policies can
be called from within a BizTalk orchestration and from other Microsoft .NET
applications. This module provides an overview of the Business Rule Engine
and describes the use of policies, rules, and vocabularies. This module also
covers execution of business policies from BizTalk Server 2010.
Lesson objective:
Describe the concepts and terminology used when working with business rules in
BizTalk Server 2010.
Lesson Overview
Describe business rules and explain how they can be used to make business
decisions.
Business Rules
Business rules are statements that govern the conduct of business processes.
A policy is a collection of related rules that are evaluated together, for
example, a banks loan approval policy might be composed of several
different rules that need to be evaluated. The policy is executed, and each
rule is evaluated and possibly applied.
Each rule consists of a condition (an if clause) and a resulting action (a then
clause). The conditions and actions can be quite simple or very complex. The
condition is evaluated, and if it evaluates to True, the specified actions are
performed by the rule engine. Unlike in most programming models, there is
no else action. For example, if you want to perform an action on all purchase
orders, but the action varies based on the total order amount, you would
need to create two rules, one for purchase orders with a total of less then
$1,000 and one rule for purchase orders with totals greater than or equal to
$1,000. These two rules would make up the discount policy.
Within a policy, the various rules can have different priorities assigned. These
priorities do not modify the order of evaluation but rather the order that the
rules are fired in. That is, if multiple rules are to be fired (on the agenda), the
priority will determine the order that the rules are applied. In this case, the
rule that has the highest assigned priority will be fired.
Example
Consider the following example business rule from the preceding illustration.
A manufacturer has received a purchase order from a customer and needs to
fulfill the purchase order request. In order to process the purchase order, the
manufacturer must answer a series of questions:
Notice in the example that each question can be answered either True or
False. These rules apply basic business logic to find out whether or not a
purchase order can be fulfilled.
Business rules can be used to:
Since business rules embedded in applications can change over time, BizTalk
Server 2010 provides the Business Rule Engine (BRE) to enable you to create
and modify sets of business rules. These rules can be created graphically
using a tool called the Business Rule Composer or can be written using the
Business Rule APIs. Once published, the policy can be called from a BizTalk
orchestration and executed by the Business Rule Engine.
The BRE enables business rule policies to be changed in real time. Any
orchestrations that use (call) the business rules need not be recoded or
rebuilt when the business policy changes. Business rules are versioned
Business rules are statements that govern the conduct of business processes.
Business rules consist of a condition and one or more consequent actions.
Conditions are true/false, otherwise known as Boolean expressions, that
consist of one or more predicates applied to facts. Multiple conditions can be
combined to provide for complex computations. Complex conditions can be
constructed by joining multiple simple conditions using AND, OR, and NOT
modifiers. For example, when evaluating a customer order, you could have a
rule such as: If customer exists AND total order amount > 1000 OR if
customer exists AND customer rating = excellent THEN set discount amount
= 10%.
Policy
Policies are logical rule sets. You compose a version of a policy, save it, test it
by applying it to facts, and when you are satisfied with the results, publish it
Vocabularies are user-defined names for the facts used in rule conditions and
actions. Vocabulary definitions render rules easier to read, understand, and
share for the various workers within a particular business domain. For
example, the source location for a particular fact might be a field in a
particular record within a database, represented as an SQL query. Instead of
employing the SQL query (an abstract procedural statement, difficult for most
people to memorize or recognize) in the rule, a name meaningful to all the
relevant parties in the development and deployment process can be
associated with the query by creating a vocabulary definition. When you
create a new vocabulary definition, you can choose from one of the following:
The rule store is a repository for business policies and vocabularies. Policies
and vocabularies are deployed to the rule store. The rule store is by default
the Business Rule Database (BizTalkRuleEngineDb). This database is created
when configuring business rules for the BizTalk group. Additionally, policies
and vocabularies can be exported to an XML file to simplify modification and
deployment between test and production environments.
Facts are the data that rules use to make decisions. Facts can be derived
from multiple data sources and must be fed into the rule engine through predefined vocabularies, XML schemas, .NET classes, or database row sets. Many
facts are instance facts that will be different for each firing of the rules. For
example, the customer name and account number fields in a PO message are
instance facts. Other facts may be long term. For example, interest rates
usually change infrequently and do not need to be looked up each time a rule
is fired. Long-term facts are determined once and then held in the cache until
refreshed, whereas instance facts are determined for each rule execution. A
fact can be configured as a long-term fact by setting the Fact Retriever
property for each version of the policy in the properties window for the
version of the policy. A fact retriever object must be created to be able to
fetch the facts from a persistent storage and present them to the policy
object.
For More InformationFor more information on creating a long-term fact, refer
to the BizTalk Server 2010 documentation Creating a Fact Retriever and
Short-Term Facts vs. Long-Term Facts.
The Business Rule Engine uses a three-stage algorithm for policy execution.
The stages are as follows:
Match. In the match stage, facts are matched against the predicates that use
the fact type (object references maintained in the rule engine's working
memory) using the predicates defined in the rule conditions. For the sake of
efficiency, pattern matching occurs over all the rules in the policy, and
conditions that are shared across rules are matched only once. Partial
condition matches may be stored in working memory to expedite subsequent
pattern-matching operations. The output of the pattern-matching phase
consists of updates to the rule engine agenda.
Conflict resolution. In the conflict resolution stage, the rules that are
candidates for execution are examined to determine the next set of rule
actions to execute based on a predetermined resolution scheme. All
candidate rules found during the matching stage are added to the rule
engine's agenda.
You can integrate business rules into your orchestrations to support a variety
of scenarios:
five minutes before executing, the following time, the rule would wait
30 minutes before executing, and so on.
You can use rules to determine the execution path for a business
process, basing the determination on the results of the rule execution.
For example, if the customer submitting the purchase order does not
exist in the database, you could route the document to another
business process to add the customer to the database before
continuing to process the purchase order.
Create the orchestrations from which the business rules will be called,
and they define the action to be taken when a decision is returned to
the orchestration. As long as the decision path within the orchestration
does not change, the orchestration will not need to be redeployed.
recompile and redeploy the BizTalk assembly. The BRE always calls the
latest deployed version of the policy.
Administrators can:
Lesson objective:
Compose, publish, and deploy business rules.
Overview
BizTalk provides several tools for developing and deploying business rules
and for applying them to business processes. In this lesson, you will learn
how to integrate a business rule policy into an orchestration and how to use
the Business Rule Composer to create easy-to-understand vocabularies and
policies. These policies can then be versioned and deployed before being
called from an orchestration. You can also track business rules to find out the
true or false outcome of a rule.
4. Test and debug the policy by using sample facts. (You can create a
PolicyTester object in your application. Testing a policy before
integrating it in an orchestration allows you to ensure that the policy is
working correctly before testing it from an orchestration.
Troubleshooting a policy is much easier if you will test the policy before
integrating it with an orchestration. For more information on creating a
PolicyTester object to test a business policy, refer to the BizTalk Server
2010 documentation Testing Policies and Creating a Fact Creator.)
5. Publish and deploy the policy version to the rule store. After a policy
version is published, it is immutable but still not available for other
applications to use the policy. Deploying the policy version makes the
policy available to other applications.
6. Call the policy from a BizTalk orchestration.
The Business Rule Composer is a graphical user interface that allows you to
create business rule policies, which contain one or more business rules.
These rules can evaluate facts to determine if specific actions should be
performed. To assist in humanizing these rules, vocabularies can be created
that provide a user-friendly alias to the terms and conditions. Multiple
versions of the policies and vocabularies can be created, tested, published,
and deployed using the Business Rule Composer to make management of
these artifacts easier.
Create Business Rule Policy
Facts and actions are added by dragging them onto the Rule Composer
design surface. Actions will modify nodes in the document specified. This is
one notable exception to the immutability of messages in BizTalk
orchestrations because the actions can update or even add new nodes and/or
nodelists to the provided message(s). The Business Rule Engine (BRE) makes
changes to the messages that it passes in the call to the engine. For this
reason, you may want to create a specific message that is sent to the engine
rather than having the BRE change the original document.
In the earlier example, the give the customer a 10 % discount action will
update the Discount Amount node in the
AdventureWorks.Orders.CustomerOrder message.
Additional actions (such as asserting and retracting facts) can be added by
right-clicking the Actions node and then clicking the appropriate action.
Testing, Publishing, and Deploying a Policy
Then
Company.Namespace.Customer.DiscountAmount =
Company.Namespace.ShoppingCart.PurchaseAmount * .1
Although rules can be created and used without the use of vocabularies,
creating vocabularies makes the creation and maintenance of rules much
easier. Vocabularies abstract difficult concepts by defining an alias to be
associated with schema nodes, database fields, or .NET classes. With
correctly defined vocabularies, policies can be maintained by (if not initially
created) by information workers.
Two vocabularies, Predicates and Functions (which are used in the creation of
all rules), are built into the Business Rule Composer. It is possible to extend
these vocabularies as needed. For example, the phrase The Shopping Cart
contains more than $ 1000 worth of items is actually a greater than
comparison: (ShoppingCart > 1000). The built-in Greater Than function in
the functions vocabulary could have an additional vocabulary term defined
that represents this relationship. This may make it easier for information
workers to understand the relationship.
Publishing Business Rule Vocabularies
Although the examples here are using the English language, vocabularies can
be written in various languages, making data defined in databases and
schemas more accessible to non-English speakers.
The two policy versions have identical rules, except that Version 1.0
is in readable English because it uses vocabularies. Version 1.1
does not use vocabularies, and it is more difficult to understand the
contextual sense of what each rule is doing.
9. In the Facts Explorer pane, under LoanProcess, expand Version 1.0
Published.
A vocabulary is a collection of definitions that provide simple-toread aliases for complex message values or fields in a database.
10. Click Base Income.
The Update Loan Status definition is used to update the Status field
of the message.
13. In Policy Explorer, under Version 1.1 Deployed, click Approved.
Although this rule performs the same action as the Approved rule is
version 1.1, its much more readable. The rule is applied when
Monthly Base Income + Monthly Secondary Income is greater than
Requested Loan Amount, and Months Employed is greater than or
equal to 6, or Months in Current Home is greater than or equal to 6.
Examine both versions of the other three rules and determine what
each rule does.
To Test the Business Rule Policy
You are using the copy of the original message because the
Business Rule Engine will alter the test message.
27. In the Select Facts dialog box, click Test.
28. In the Output pane, notice that are three RULE FIRED events, one for
the Loan to Salary Ratio rule, one for the Denied Income rule, and
one for the Denied Residency or Employment rule.
29. In Windows Explorer, navigate to and open
C:\AllFiles\DemoCode\Module11\Copy of LoanApplication
Denied.xml, and notice that the LoanStatus field now reads Denied,
and the LoanToIncome field now reads 1.2.
30. Pause the bt10d-demos virtual machine.
Deploy policies.
Overview
Adding a call rules shape inside the orchestration and setting the
Configure Policy property to specify the business rule you are calling.
You specify only the name of the business policy you will be calling and
not the version number of the policy. The most current version of the
policy will always be used when calling from an orchestration.
Using a decision shape (or other shape) to process the response from
the Business Rule Engine. Other shapes at this step that could be used
instead include the Delay shape and the Call Orchestration shape,
depending on what you want to do after receiving the results of the
business policy.
You can monitor business rule activities and track the overall progress of an
orchestration that uses the Business Rules Framework by using the BizTalk
Server 2010 Administration Console. You can view a list of the deployed
business rule policies, and you can view and change the current tracking
configuration for any currently deployed policies.
To set tracking options for a policy, select the application associated with the
rule, and then click Policies. All polices that are associated with this
application (and all versions of these policies) are displayed. If the policy that
you want to manage is not displayed, right-click Policies to add the policy to
the application.
Tracking Options
To configure tracking properties for a policy, right-click the policy to access its
properties and to configure tracking. There are four options for tracking
business rules from the BizTalk Server Administration Console:
Fact Activity. Select this check box when tracking the instance data on
which the policy operates.
36. Condition Evaluation. This check box allows you to track the True/False
result of the conditions in the selected policy.
37. Rule Firings. This check box allows you to track the actions triggered as
a result of the policy.
38. Agenda Updates. Select this check box when you want to track
updates to the agenda, which contains a list of actions that evaluated
to True and a list of rules that fired.
Once you have turned on tracking for your business policies, execute your
queries as normal in the BizTalk Server Administration Console. You should
see a link to access the business rule execution for each message that was
processed by the Business Rule Engine. You can then see the True/False
values of policies that were executed in the BRE along with the If/Else
condition that was evaluated.
Polices that have been added to an application can be managed with the rest
of the application. This includes the ability to undeploy policies and to include
the policies when the MSI is exported. Undeployed policies will still be visible
within the application. In this way, policies can be managed by undeploying
and redeploying the application as necessary.
The Microsoft Business Rule Engine (BRE) enables you to apply declarative
rules based on messages from BizTalk orchestrations. Using the BRE enables
you to separate the implementation of the business process (orchestration)
from business decisions that are likely to change over time. Vocabularies are
a collection of easy-to-read definitions for the facts used by the BRE. When
vocabularies are used to create rules, the rules can easily be updated and
maintained by business analysts who have little or no understanding of the
BizTalk implementation. In this lab, you will create a vocabulary with several
definitions. You will then create a rule policy by using the vocabulary you
created. Finally, you will integrate the Business Rule Engine policy into an
orchestration.
Procedure List
1. If the Server Manager window is not already open, click on the
Server Manager icon located in the task bar next to the Start button.
2. Expand Roles, Hyper-V, Hyper-V Manager. The last node to appear
displays the machine name. Click on it to see the list of virtual
machines available.
3. Double-click the virtual machine bt10d-11 to open a Virtual Machine
Connection window.
4. Click on the Action menu in the Virtual Machine Connection window
and choose Start.
5. Once the virtual machine starts, press CTRL+ALT+END.
6. Log on using the user name Administrator and the password
pass@word1.
7. At the Windows Activation prompt, click Ask Me Later, then click OK.
Ensure that the BizTalk Services are started
Procedure List
1 In Windows Explorer, navigate to C:\AllFiles.
39. Double click startBtServices.cmd.
40. When prompted, press any key to close the command-line window.
The Business Rule Engine (BRE) makes decisions based on facts derived
from .NET classes, XML schemas, and SQL databases. The sources of these
facts can be difficult for humans to read and understand. Vocabulary
definitions are human-friendly aliases for the facts used by the BRE. In this
exercise, in order to simplify the creation of business rules, you will create a
vocabulary that contains several definitions.
Create a New Business Rule Vocabulary
Procedure List
1 On the Start menu, click All Programs, click Microsoft BizTalk
Server 2010, and then click Business Rule Composer.
41. In the Open Rule Store dialog box, click OK.
42. In the Facts Explorer pane, on the Vocabularies tab, right-click
Vocabularies, and then click Add New Vocabulary.
43. Rename the new vocabulary to LoanProcessing.
Procedure List
1 Under LoanProcessing, right-click Version 1.0 (not saved), and then
click Add New Definition.
44. On the Welcome to the Vocabulary Definition Wizard page, click
XML Document Element or Attribute, and then click Next.
45. In the Definition name box, type Primary Income.
46. In the Definition description box, type Amount of principal
income.
47. Click the Browse button, navigate to
C:\AllFiles\LabFiles\Lab11\AdvWorks\LoanApproval\LoanApplica
tion.xsd, and then click Open.
48. In the Select Binding dialog box, expand LoanApp and Income, click
BasicSalary, and then click OK.
49. Click Perform Get operation.
50. In the Display name box, type Monthly Primary Income, and then
click Finish.
51. Under LoanProcessing, right-click Version 1.0 (not saved), and then
click Add New Definition.
52. On the Welcome to the Vocabulary Definition Wizard page, click
XML Document Element or Attribute, and then click Next.
53. In the Definition name box, type Employment (months).
Procedure List
1 Under LoanProcessing, right-click Version 1.0 (not saved), and then
click Add New Definition.
83. On the Welcome to the Vocabulary Definition Wizard page, click
XML Document Element or Attribute, and then click Next.
84. In the Definition name box, type Update Loan Status.
85. Click the Browse button, navigate to
C:\AllFiles\LabFiles\Lab11\AdvWorks\LoanApproval\LoanApplica
tion.xsd, and then click Open.
86. In the Select Binding dialog box, expand LoanApp and
LoanConditions, click LoanStatus, and then click OK.
87. Click Perform Set operation, and then click Next.
88. In the Display format string box, type Update the Loan Status for
this loan to {0}, and then click Finish.
Create the Set Loan to Income Ratio Set Operation Definition
Procedure List
1 Under LoanProcessing, right-click Version 1.0 (not saved), and then
click Add New Definition.
89. On the Welcome to the Vocabulary Definition Wizard page, click
XML Document Element or Attribute, and then click Next.
90. In the Definition name box, type Set Loan to Income Ratio.
91. Click the Browse button, navigate to
C:\AllFiles\LabFiles\Lab11\AdvWorks\LoanApproval\LoanApplica
tion.xsd, and then click Open.
92. In the Select Binding dialog box, expand LoanApp and
LoanConditions, click LoanToIncome, and then click OK.
93. Click Perform Set operation, and then click Next.
94. In the Display format string box, type The loan to income ratio
for this loan is: {0}, and then click Finish.
Create the Month Range Definition
Procedure List
1 Under LoanProcessing, right-click Version 1.0 (not saved), and then
click Add New Definition.
95.
On the Welcome to the Vocabulary Definition Wizard page,
click Constant Value, Range of Values, or Set of Values, and then
click Next.
96.
In the Definition name box, type Month Range, click Set of
Values, and then click Next.
97.
98. Add the following values by typing each in the Use constant value
box, and then clicking Add after each entry: 3, 6, 9, 12, 18, 24. Click
Finish.
Create the Status Range Definition
Procedure List
1 Under LoanProcessing, right-click Version 1.0 (not saved), and then
click Add New Definition.
99. On the Welcome to the Vocabulary Definition Wizard page, click
Constant Value, Range of Values, or Set of Values, and then click
Next.
100. In the Definition name box, type Status Range, click Set of
Values, and then click Next.
101.
102. Add the following values by typing each in the Use constant value
box, and then clicking Add after each entry: Approved, Denied, and
Pending. Click Finish.
Publish the LoanProcessing Vocabulary
Procedure List
1 In the Facts Explorer pane, under the LoanProcessing vocabulary,
right-click Version 1.0 (not saved), and then click Save.
Saving the vocabulary saves the definitions to the Business Rule
Engine Database, making them immutable, but the vocabularies
are not available for use until published.
103.
Procedure List
1 In Policy Explorer, right-click Policies, and then click Add New Policy.
104.
Procedure List
1 Right-click Version 1.0 (not saved), and then click Add New Rule.
105.
106. In the IF pane, right-click Conditions, and then click Add logical
AND.
107.
108.
109. Drag Primary Income from the Facts Explorer pane to value1, and
then drag Secondary Income to value2.
110.
111.
118. Drag Update Loan Status from the Facts Explorer pane to
Actions in the THEN pane.
119. Drag Status Range from the Facts Explorer pane to <empty
string>.
120. Click Status Range, and then in the drop-down list, click
Approved.
Procedure List
1 Right-click Version 1.0 (not saved), and then click Add New Rule.
121.
124. Drag Primary Income from the Facts Explorer pane to value1, and
then drag Secondary Income to value2.
125.
126. Drag Update Loan Status from the Facts Explorer pane to
Actions in the THEN pane.
127. Drag Status Range from the Facts Explorer pane to <empty
string>.
128.
Click Status Range, and then in the drop-down list, click Pending.
Procedure List
1 Right-click Version 1.0 (not saved), and then click Add New Rule.
129.
130.
131.
134.
137. Drag Update Loan Status from the Facts Explorer pane to
Actions in the THEN pane.
138. Drag Status Range from the Facts Explorer pane to <empty
string>.
139.
Click Status Range, and then in the drop-down list, click Pending.
Procedure List
1 Right-click Version 1.0 (not saved), and then click Add New Rule.
140.
142. Drag Loan Amount from the Facts Explorer pane to argument1,
click argument2, and then type 100.
143.
144.
145.
Procedure List
1 Under LoanApprovalProcess, right-click Version 1.0 (not saved), and
then click Publish.
148.
Notice that the loan amount is greater than the income amount,
and that the time at residence and the time at employer are both
three months. This loan will be denied by the policy you created.
150.
151.
152. In Windows Explorer, copy BRE-Denied.xml and BREApproved.xml to the Lab11 folder to create duplicates to use for
testing purposes.
162.
163.
164.
165.
BizTalk orchestrations use the Call Rules shape to invoke business rule
policies. In this exercise, you will create a new orchestration that is called by
the ProcessOrder_Credit orchestration. This orchestration calls the
LoanApprovalProcess policy and has steps for the manual processing of the
loans that are not approved by the Business Rule Engine. You will then deploy
and test the application.
Create the ApproveLoan Orchestration
Procedure List
1 In Windows Explorer, navigate to
C:\AllFiles\LabFiles\Lab11\AdvWorks, and then double-click
AdvWorks.sln to open the solution.
166. In Solution Explorer, right-click the LoanApproval project, point to
Add, and then click New Item.
167. In the Add New Item dialog box, click Orchestration Files, in the
Name box, type ApproveLoan.odx, and then click Add.
168. Right-click the ApproveLoan orchestration design surface, click
Properties Window, and in the Properties window, in the Type Modifier
list, click Public.
Create Orchestration Parameters
Procedure List
1 In Orchestration View, right-click Orchestration Parameters, and
then click New Message Parameter.
169. In the Message_1 Properties window, in the Identifier box, type
parSalesOrder, in the Message Type list, expand Schemas, and
then click <Select from referenced assembly>.
170. In the Select Artifact Type dialog box, in the left pane, click
AdvWorks.Messaging, in the right pane, click SalesOrder, and then
click OK.
171. In Orchestration View, right-click Orchestration Parameters, and
then click New Message Parameter.
172. In the Message_1 Properties window, in the Identifier box, type
parFinalLoan, in the Direction list, click Out, in the Message Type
list expand Schemas, and then click
AdvWorks.LoanApproval.FinalLoanDocument.
Create Messages
Procedure List
1 In Orchestration View, right-click Messages, and then click New
Message.
Procedure List
1 In Orchestration View, expand Types, right-click Correlation Types,
and then click New Correlation Type.
176. In the Correlation Properties dialog box, in the left pane, expand
AdvWorks.LoanApproval.PropertySchema, click Amount, click
Add, click Customer, click Add, and then click OK.
177. In the CorrelationType_1 Properties window, in the Identifier box,
type ManualApprovalCorrType.
Create a Correlation Set
Procedure List
1 In Orchestration View, right-click Correlation Sets, and then click
New Correlation Set.
178. In the Correlation_1 Properties window, in the Identifier box, type
ManualApprovalCorrSet, and then in the Correlation Type list,
click AdvWorks.LoanApproval.ManualApprovalCorrType.
Add a Transform Shape
Procedure List
1 Right-click Drop a shape from the toolbox here, point to Insert
Shape, and then click Transform.
179. Configure the construct message and transform shapes with the
properties shown in the following table.
Value
Name
Construct msgLoanApp
Messages Constructed
msgLoanApp
Transform Shape
Property
Value
Name
Map to LoanApp
AdvWorks.LoanApproval.SalesOrder_To_
LoanApp
Map Source
parSalesOrder
Map Destination
msgLoanApp
Procedure List
1 Drag a Call Rules shape from the Toolbox to the orchestration, directly
below the construct message shape.
180. In the Properties window, in the Name box, type Call Loan
Approval Process, and then click the ellipsis () button in the
Configure Policy box.
181. In the Select the business policy you wish to call list, click
LoanApprovalProcess, set the Parameter Name to msgLoanApp,
and then click OK.
Add a Decide Shape
Procedure List
1 Right-click the arrow below the call rules shape, point to Insert
Shape, and then click Decide.
182. In the Properties window, in the Name box, type Is the Loan PreApproved?, and then click the Rule_1 branch.
183. In the Properties window, in the Name box, type Approved, and
then click the ellipsis () button in the Expression box.
184. In the BizTalk Expression Editor window, type the following
expression, and then click OK.
msgLoanApp.LoanConditions.LoanStatus==Approved
Procedure List
1 Drag a Transform shape from the Toolbox to the Approved branch of
the decide shape.
2
185.
Value
Name
Construct parFinalLoan
Message Constructed
parFinalLoan
Transform Shape
Property
Value
Name
Map to FinalLoan
AdvWorks.LoanApproval.SalesOrder_To_Fi
nalLoan
Map Source
parSalesOrder
Map Destination
parFinalLoan
Message Assignment Shape
Property
Value
Name
Procedure List
1 Right-click the Construct parFinalLoan construct shape, and then
click Copy.
187. Below the Else branch of the decide shape, right-click Drop a
shape from the toolbox here, and then click Paste.
188. Change the configuration to the Construct Message, Transform,
and Message Assignment shapes to represent the following table.
Value
Name
Construct msgInterimLoan
Message Constructed
msgInterimLoan
Transform Shape
Property
Value
Name
Map to FinalLoan
AdvWorks.LoanApproval.SalesOrder_To_Fi
nalLoan
Map Source
parSalesOrder
Map Destination
msgInterimLoan
Message Assignment Shape
Property
Value
Name
189. Change the Expression in the Add Loan Properties shape below
the Else branch to the following expression (four lines).
msgInterimLoan.Loan.Amount=msgLoanApp.LoanConditions.LoanAmount;
msgInterimLoan.Loan.LoanToIncomeRatio =
msgLoanApp.LoanConditions.LoanToIncome;
msgInterimLoan.Loan.Status=msgLoanApp.LoanConditions.LoanStatus;
msgInterimLoan.Loan.Term=msgLoanApp.LoanConditions.Term;
190. Right-click below the construct message shape in the Else branch,
point to Insert Shape, and then click Send.
191. Right-click below the send shape in the Else branch, point to Insert
Shape, and then click Receive.
192. Configure the Send and Receive shapes as shown in the following
table.
Send Shape
Property
Value
Initializing
Correlation Set
ManualApprovalCorrSet
Message
msgInterimLoan
Name
SharePoint Processing
Receive Shape
Property
Value
Following
Correlation Set
ManualApprovalCorrSet
Message
parFinalLoan
Name
SharePoint Processing
Procedure List
1 Right-click the right Port Surface, and then click New Configured
Port.
193.
Value
Name
SharePointReq
SharePointType
Direction
Send
Binding
Specify later
194. Right-click the right Port Surface, and then click New Configured
Port.
195.
Value
Name
SharePointResp
SharePointType
Direction
Receive
Binding
Specify later
196. Connect the Send shape to the SharePointReq port, and then
connect the Receive shape to the SharePointResp port.
197. In Solution Explorer, right-click the AdvWorks solution, and then
click Build Solution.
Procedure List
Click OK.
Procedure List
1 Right-click the arrow below the Approve Loan call orchestration
shape, point to Insert Shape, and then click Decide.
204. Rename the decide shape to Is Loan Approved?, and then click
the Rule_1 branch.
205. In the Properties window, in the Name box, type Approved, and
then click the ellipsis () button in the Expression box.
206. In the BizTalk Expression Editor window, type the following
expression, and then click OK.
msgFinalLoan.Loan.Status=="Approved"
207. Drag a Send shape from the Toolbox to the Else branch of the Is
Loan Approved? decide shape.
208. In the Properties window, in the Name box, type Loan Denial, and
then in the Message list, click msgSalesOrder.
209. Drag the Loan approved so several things need to be done
group shape to the Approved branch of the Is Loan Approved?
decide shape.
Configure a Send Port
Procedure List
1 Right-click the right Port Surface, and then click New Configured
Port.
210.
Property
Value
Name
LoanDenial
LoanDenialType
Direction
Send
Binding
Specify later
211. Connect the Loan Denial send shape to the LoanDenial send
port.
212. In Windows Explorer, navigate to C:\AllFiles\LabFiles\Lab11, and
then open ProcessOrder_Credit.png.
Close ProcessOrder_Credit.png.
Procedure List
1 In Solution Explorer, right-click the AdvWorks solution, and then click
Build Solution.
214. In Solution Explorer, right-click the AdvWorks solution, and then
click Deploy Solution.
Configure Port Bindings
Procedure List
1 On the Start menu, click All Programs, click Microsoft BizTalk
Server 2010, and then click BizTalk Server Administration.
215. In the BizTalk Administration Console, expand BizTalk Server
Administration, BizTalk Group, Applications, and Adventure
Works.
216.
217.
Click OK.
Procedure List
1 To extend the expiration period of the Microsoft Office installation on
this virtual machine, in Windows Explorer, navigate to C:\AllFiles and
double-click extend.cmd.
2
226.
Close InfoPath.
229.
230.
231.
Close InfoPath.
234.
235.
236.