|
Rules Guide |
This chapter describes how to use the Pipeline and Binding Editors in Workbench to set up a rules pipeline. It has these sections:
A pipeline is a mechanism for running a set of rules that are associated with specific users or groups, or for running any set of rules in a prescribed sequence.
Basic procedure Here is the basic procedure for setting up a pipeline:
Use the Pipeline Editor to create a pipeline and associate it with one or more of the three binding steps: User, Group, and Pipeline.
Use the Binding Editor to bind rules to a user, group, or pipeline.
Using a pipeline After you set up a pipeline, you fire the rules defined in the pipeline by calling the validate() method in your application component, supplying the pipeline ID:
If the pipeline includes the User or Group step, the Rule subsystem will fire the rules defined in the user or group binding definition when the user or group member is in the current application context.
If the pipeline includes the Pipeline step, the Rule subsystem will fire the rules defined in the pipeline step defined for the pipeline being validated.
What's here The rest of this chapter describes how to create a pipeline in the Pipeline Editor and define a rule binding in the Binding Editor.
For background information about using pipelines in Director applications, see
Rule Development Basics.
You use the Pipeline Editor in Workbench to create a pipeline and associate it with a step or steps.
The General tab of the Pipeline Editor displays:
Enter information on the General tab:
In the Available steps section, select a step and click Add to Selected.
The step is added to the Selected steps section.
If you add more than one step, the rules defined in the corresponding binding will fire in the order of the steps in the Selected steps section.
Select File>Save or press Ctrl-S.
The contents of the pipeline definitions folder display in your project resource set.
The resource set provides access to application resources that are not stored within a subsystem's database or within its configuration and services elements. Such resources include pipeline and rule binding XML definitions.
For more information about resource sets, see the chapter on application architecture in the Core Development Guide.
Exit the editor by choosing the exit icon in the upper-right corner.
In your project Source or Archive layout in Workbench, navigate to the pipeline XML file.
The default location in your project layout is:
ResourceSet/WEB-INF/lib/resource.jar/data/rule-pipeline.
You can also edit the XML descriptor directly outside the Rule Editor. For more information you can access the DTD and sample XML in your Director project source directory at:
library/RuleService/RuleService-conf/DTD/rule-pipeline_3_0.dtd
library/RuleService/RuleService-conf/DTD/rule-pipeline_3_0_sample.xml
You use the Binding Editor to bind a rule to a selected user, group, or pipeline.
Select the Group Bindings, Pipeline Bindings, or User Bindings icon.
The appropriate binding editor displays. The text box at the top of the editor depends on which icon you selected.
Make the appropriate entry in the text box:
In the Available rules section, select a rule and click Add to Selected.
The rule is added to the Selected rules section.
Add other rules as needed. Rules will fire in the order they appear in the list.
Choose File>Save or press Ctrl-S.
This displays a dialog with the contents of the appropriate binding definitions in your project resource set.
The resource set provides access to application resources that are not stored within a subsystem's database, or within its configuration and services elements. Such resources include pipeline and rule binding XML definitions.
For more information about resource sets, see the chapter on application architecture in the Core Development Guide.
Exit the editor by choosing the exit icon in the upper-right corner.
In your project Source or Archive layout in Workbench, navigate to the location of the binding XML definition in your project resource set.
Here are the default locations in your project layout:
You can also edit the XML descriptor directly outside the Rule Editor. For more information, you can access the DTD and sample XML in your Director project source directory at:
library/RuleService/RuleService-conf/DTD/rule-pipeline-bindings_3_0.dtd
library/RuleService/RuleService-conf/DTD/rule-pipeline-bindings_3_0_sample.xml
library/RuleService/RuleService-conf/DTD/rule-user-bindings_3_0.dtd
library/RuleService/RuleService-conf/DTD/rule-user-bindings_3_0_sample.xml
library/RuleService/RuleService-conf/DTD/rule-group-bindings_3_0.dtd
library/RuleService/RuleService-conf/DTD/rule-group-bindings_3_0_sample.xml
|
Rules Guide |
Copyright © 2002, SilverStream Software, LLC, a wholly owned subsidiary of Novell, Inc. All rights reserved.