Samples and tutorials
Contents
- Site map: Getting started tutorials
- Site map: Tutorials
- Site map: Samples
- Use the Sample Server
- Overview: Sample Server
- Start and stopping the Sample Server
- Checking the server port number
- Troubleshooting the Sample Server
- Restoring the Sample Server
- Restoring the databases
- Opening the administrative console
- Use the Samples Console
- Overview: Samples Console
- Opening the Samples Console
- Importing samples
- Running samples from the Samples Console
- Running samples from the Ant view
- Restoring the sample databases
Samples and tutorials
You can compile and run all the samples using the Samples Console and Sample Server. Most of the samples take less than 10 minutes to compile and run. Some of the tutorials are also integrated into the Samples Console, and others use the Sample Server. Tutorials can take 30 to 45 minutes to complete.
The rule projects for the samples are available only in American English (en_US). Make sure that you start the Samples Console in the en_US locale, see Use the Samples Console.
Site map: Getting started tutorials
Use this site map to help you locate the getting started tutorials that are of interest to you.
You need the Sample Server to complete the getting started tutorials. The Sample Server runs on WebSphere Application Server Network Deployment. For more information, see Use the Sample Server.
The getting started tutorials are aimed at beginners and users who want to learn the basic workflows of Operational Decision Manager. They are designed to give you quick exposure to the products and give you an introductory understanding of the steps required to create a decision service. The tasks in each tutorial are to be completed in the order they are listed, because subsequent tasks often rely on the results of the previous task.
Table 1. Site map for getting started tutorials Getting started tutorials Where to find them Decision Server Rules Decision Server V8.0.1 > Decision Server Rules > Getting started with business rules Decision Server Events Decision Server V8.0.1 > Decision Server Events > Getting started with event rules Decision Center Enterprise console Decision Center V8.0.1 > Decision Center for business users > Tutorial: Getting started with the Decision Center Enterprise console Decision Center Business console Decision Center V8.0.1 > Decision Center for business users > Tutorial: Getting started with the Decision Center Business console
Use this site map to help you locate the tutorials that are of interest to you.
You run the distributed platform tutorials using the Sample Server. The Sample Server runs on WebSphere Application Server Network Deployment. For more information, see Use the Sample Server.
The following tutorials are designed to transfer knowledge and should be used as an aid in the learning process. The tutorials seek to teach by example and provide instructions to complete a set of tasks.
Table 1. Site map for tutorials Tutorials Where to find them Decision Server Rules Decision Server V8.0.1 > Decision Server Rules > Tutorials Develop your technical skills with tutorials for Decision Server Rules.
Decision Server Events Decision Server V8.0.1 > Decision Server Events > Tutorials Develop your technical skills with tutorials for Decision Server Events.
Decision Center and Decision Center for z/OS Decision Center V8.0.1 > Decision Center for business users > Managing business rules > Tutorials Develop your technical skills with tutorials for Decision Center.
Decision Server for z/OS Decision Server for z/OS V8.0.1 > Tutorials Develop your technical skills with tutorials for Decision Server for z/OS.
Site map: Samples
Use this site map to help you locate the samples that are of interest to you.
You run the distributed platform samples using the Sample Server. The Sample Server runs on WebSphere Application Server Network Deployment. For more information, see Use the Sample Server.
The following samples make use of example code and example applications to help you to learn how to use the Operational Decision Manager APIs, and accelerate your own development or administration tasks.
Table 1. Site map for samples Samples Where to find them Decision Server Rules Decision Server V8.0.1 > Decision Server Rules > Samples These samples demonstrate features developed in Decision Server Rules.
Decision Center Decision Center V8.0.1 > Samples These samples show how to customize Decision Center and test your business rule applications.
Decision Server for z/OS Decision Server for z/OS V8.0.1 > Samples Decision Server for z/OS provides a Miniloan sample that demonstrates how to call a server instance to execute rules. The sample is available as a batch, CICS, and IMS application.
Decision Center for z/OS Decision Center for z/OS V8.0.1 > Samples This sample demonstrates the use of a VSAM file with Decision Center for z/OS.
Use the Sample Server
To run the samples and the tutorials, you must start the Sample Server.
Overview: Sample Server
You run the samples and tutorials using the Sample Server. The Sample Server runs on WebSphere Application Server Network Deployment.
Operational Decision Manager contains a sample server. The sample server provided is a profile on WebSphere Application Server.
WebSphere Application Server is installed as part of Decision Server. It provides a default, pre-configured execution environment for Rule Execution Server and for Operational Decision Manager samples and tutorials, for the convenience of Operational Decision Manager users.
The sample server is only installed on distributed platforms.
Note:
For Decision Server Rules, if you do not want to use the provided sample server, it is not mandatory to use of WebSphere Application Server. All Java EE-dependent features can use an alternative Java EE application server from the list of Operational Decision Manager supported platforms. However, the event runtime requires WebSphere Application Server Network Deployment.
You can start and stop the Sample Server from the start menu shortcuts, directly from the command prompt, or from the Samples Console in Rule Designer.
The Samples Console also displays message traces produced by the Sample Server (see Start and stopping the Sample Server).
Single sign-on (SSO) authentication is activated for the Sample Server. SSO allows users to log in once and gain access to all applications without being prompted to log in again for each of them. If you use different sign-on credentials for the applications on the Sample Server, for example when performing certain samples and tutorials, you get an error message when you attempt to sign in to the second application.
To avoid this issue, you must sign out of the first console and then sign in to the second console. Alternatively, you can sign in to all of the applications on the server using the credentials that you entered at installation time.
Start and stopping the Sample Server
You can start and stop the sample server through the start menu shortcuts, from the command prompt, or from the Samples Console. You can also start the Sample Server in debug mode from the Samples Console.
Starting the Sample Server
To run some samples and tutorials, you must start the sample server. The first time that you start the sample server, a profile for the sample server is created on WebSphere Application Server. The profile creation takes a while to complete. After starting the server, wait until the build has completed successfully.
To start the sample server through the start menu shortcut or on the command line:
- From the start menu, click All Programs > IBM > package_group > Sample Server > Start server.
package_group is the package group specified in IBM Installation Manager during installation. The default package group is Operational Decision Manager V8.0.1.
- In a command line, change to the directory <InstallDir>/shared/bin and type startserver.
To start the Sample Server from the Samples Console:
- Click the Start the Sample Server icon in the Sample Server view. This action sends a startserver message to the sample server.
It can take a while for the server startup procedure to complete. The command window displays server trace messages as the server starts. A message indicates when the server has finished loading and how long it took to start:
[samples.echo] GBRPS0029I: start.server is completed. BUILD SUCCESSFUL Total time: 50 minutes 3 seconds Press any key to continue . . .Note:
On Windows 7, if you have installed the product in the Program Files or Program Files (x86) directories, you must be an administrator to start the Sample Server. You can run the Sample Server as an administrator, or obtain the write permissions on the Operational Decision Manager installation directory.
Setting the server in debug mode
To use certain samples and tutorials, you must start the Sample Server in debug mode.
To start the Sample Server in debug mode:
- In the Samples Console, click the Start the Sample Server in debug mode icon.
In debug mode, an debugging tool connects to the Sample Server and steps into the Java code and the rules.
Clicking the icon starts the server, sets the debug property on WebSphere Application Server, stops the server, and restarts the server to take the modifications into account. It can take a while for the server startup procedure to complete. The Console view displays feedback messages as the server starts.
Note:
After setting the debug mode, the debug property remains activated on WebSphere Application Server. Therefore, you can now start the server using the Start the Sample Server icon, or the start menu shortcut, and the server is already in debug mode.
Stopping the Sample Server
When you have completed the samples and tutorials, and you are done with the sample server, you can stop the Sample Server from the Samples Console, from the command prompt or through the start menu shortcut.
You can stop the Sample Server in one of the following ways:
Stopping the Sample Server from the start menu
- From the start menu, click All Programs > IBM > package_group > Sample Server > Stop server.
package_group is the package group specified in IBM Installation Manager during installation. The default package group is Operational Decision Manager V8.0.1.
- In a command line, navigate to the directory <InstallDir>/shared/bin and type stopserver.
Stopping the Sample Server from the Samples Console
- Click the Stop the Sample Server icon in the Sample Server view.
It can take a while for the server shutdown procedure to complete. The Console view shows the progress of the shutdown procedure.
A message indicates when the server has finished shutting down.
Checking the server port number
To run Rule Execution Server, Decision Center, and other applications on the sample server, you must verify the port number is correct.
You must use the correct port number in the URLs. For example, when the documentation indicates the URL http://localhost:<PORT>/teamserver, you must replace <PORT> with the value used by your server.
The default port number for WebSphere Application Server is 9080, but it can be different depending on your installation.
The first time that you start the sample server, a was.properties file is created along with the WebSphere Application Server profile. The was.properties contains the information about the server host and port, and the path to the installation of WebSphere Application Server.
Procedure
To check the port number:
- Open <WAS_InstallDir>/profiles/ODMSample<version>/data/was.properties.
- Check the value of the server.port property.
For example, if the value is 9081, you must add this value to the URLs of the applications that run on the sample server:
- Rule Execution Server: http://localhost:9081/res
- Decision Center Enterprise Console: http://localhost:9081/teamserver
- Decision Center Business Console: http://localhost:9081/decisioncenter
- Event Widgets: http://localhost:9081/EventWidgets/widgets/
- You can also look at the preferences in the Samples Console to view the URLs for Rule Execution Server and Decision Center. On the Window menu, click Preferences, and expand Operational Decision Manager > Samples Console.
Troubleshooting the Sample Server
If the server does not start, or if the applications that run on the sample server do not run as expected, you can restore the sample server or the databases.
- Restoring the Sample Server
You can restore the server to its initial state. Restoring the sample server re-creates the profile and the databases.- Restoring the databases
You can delete the existing sample server databases and restore them to their initial state.
Restoring the Sample Server
You can restore the server to its initial state. Restoring the sample server re-creates the profile and the databases.
Before you begin
To run the following commands, you must define the ANT_HOME variable. For more information, see Setting up your environment to use Ant.
Important:
When you restore the sample server, all the deployed applications are deleted. Before restoring the server, verify you have done a backup of the existing profile and databases.
Restoring the server has the following effects:
- Stops the server.
- Deletes the profile and all the files that it contains.
Note:
On Linux, you might get a message indicating that the profile was removed but that some errors occurred. These errors are in fact warnings about Linux services and you can ignore them.
- Deletes all existing databases, and restores the databases to their initial state.
- Restarts the server and creates a profile for the sample server.
Procedure
To restore the sample server:
- Open a command prompt, and go to <InstallDir>/shared/bin/.
- Type ant recreateserver, and press Enter.
Restoring the databases
You can delete the existing sample server databases and restore them to their initial state.
Before you begin
To run the following commands, you must define the ANT_HOME variable. For more information, see Setting up your environment to use Ant.
Important:
To keep the modifications that you have done to the existing databases, create a backup of the existing databases located in <InstallDir>/shared/data/derby.
Procedure
To restore the databases:
- Stop the sample server if it is running.
- Open a command prompt, and go to <InstallDir>/shared/bin/.
- Type ant restoredb and press Enter.
- Start the sample server.
Opening the administrative console
The first time that you start the sample server, a specific profile is created on WebSphere Application Server. The applications and projects for samples and tutorials are deployed on this profile.
You can open the administrative console to configure the sample server, and to view and manage the applications deployed on the sample server.
Procedure
To open the administrative console:
- From the Start menu, click All Programs > IBM WebSphere > IBM WebSphere Application Server <version> > Profiles > ODMSample<version> > Administrative console.
- Enter your user ID and password.
- Click Log in.
The Integrated Solutions Console opens.
Use the Samples Console
Samples illustrate particular features or functions of the various decision management products. Use code samples to learn how to use and extend the APIs provided with your product.
- Overview: Samples Console
You can import the sample projects, then compile and run the samples using the Samples Console and Sample Server.- Opening the Samples Console
You can open the Samples Console from the start menu shortcuts or from the Samples Console perspective.- Importing samples
You import samples in Rule Designer using the Samples Console or the Import wizard.- Running samples from the Samples Console
You can run samples directly from the Samples Console.- Running samples from the Ant view
You can run the Ant targets on the projects that you have imported into your workspace.- Restoring the sample databases
You can restore the sample databases provided with the Sample Server to their original state.
Overview: Samples Console
You can import the sample projects, then compile and run the samples using the Samples Console and Sample Server.
The Samples Console provides a simple graphical interface that you can use to build and run code samples. You can use the Samples Console as a convenient alternative to using Ant directly from the command prompt. You can also manage the Sample Server using the Samples Console. You require the Sample Server to use many of the samples. The Samples Console displays traces produced by both the server and the samples.
Note:
See Setting up your environment to use Ant for more information about how to set up Ant on your system.
Use the Samples Console to:
- Explore the samples hierarchy.
- View documentation pages for each sample.
- Start and stop the Sample Server.
- Run available Ant targets to build and execute the samples.
- Import the projects.
- Open Decision Center Enterprise console, Decision Center Business console and Rule Execution Server console.
- Display all traces produced by the server and the samples in a resizable window.
You can import the projects of a sample and run the sample from the Samples Console perspective in Eclipse. The sample lists indicate the samples available from the Samples Console:
Opening the Samples Console
You can open the Samples Console from the start menu shortcuts or from the Samples Console perspective.
The Samples Console perspective opens the Samples Commands view and the Samples and Tutorials view. From the Samples and Tutorials view, you can import the projects to explore sample code. The Samples Console perspective also opens the Sample Server view which you can use to start and stop the Sample Server.
Procedure
To open the Samples Console, do one of the following:
- On the start menu, click All Programs > IBM > package_group > Sample Server > Samples Console (en_US). package_group refers to the package group specified in IBM Installation Manager during installation. The default package group is Operational Decision Manager V8.0.1.
This shortcut opens Designer in the en_US (American English) locale.
- In Rule Designer, select Window > Open Perspective > Other, select Samples Console, and then click OK.
Important:
To run samples and tutorials, the locale of your Eclipse must be set to en_US.
Importing samples
You import samples in Rule Designer using the Samples Console or the Import wizard.
To import a sample from the Samples Console perspective:
- In the Samples and Tutorials view, locate the required sample and click Import projects.
To import a sample using the Import wizard:
- Click File > Import.
- In the Import wizard, select Operational Decision Manager > Samples and Tutorials and click Next.
- Locate the required sample and click Finish.
To view the source files for these samples and modify or debug them, import the sample from the Samples Console perspective, or with the Import wizard, and switch to the Java perspective.
The source files of these code samples are also available in the following directories:
- <InstallDir>/studio/samples
- <InstallDir>/executionserver/samples
- <InstallDir>/teamserver/samples
Running samples from the Samples Console
You can run samples directly from the Samples Console.
Procedure
To run a sample from the Samples Console:
- Open Rule Designer and switch to the Samples Console perspective.
- In the Sample Server view, click the Start the Sample Server icon.
- When the startup of the Sample Server is complete, click the Samples and Tutorials view to locate the sample or tutorial that you want to run.
- Click View instructions to display the relevant documentation.
- The Decision Center and Rule Execution Server samples provide Ant targets to compile and run the sample. Click View sample commands to open the Samples Commands view.
- When instructed to execute an Ant target, double-click the appropriate Ant target node. The Ant targets are identified by a green target icon.
Running samples from the Ant view
You can run the Ant targets on the projects that you have imported into your workspace.
If you prefer not to use the Samples Console, you can run the code samples using Ant directly from a Windows command prompt or a UNIX shell. See Setting up your environment to use Ant for information about how to set up Ant on your system.
Procedure
To run the Ant targets from the Samples Console:
- Switch to the Java perspective.
- In the Window menu, click Show View > Other, select Ant > Ant, and then click OK.
- In the Package Explorer view, expand the project, then drag the build.xml file and drop it in the Ant view.
- Click the Hide Internal Targets icon.
- In the Ant view, expand the project to view the Ant targets.
- Follow the instructions to run the sample and execute the targets from the Ant view instead of the Samples Commands view.
Restoring the sample databases
You can restore the sample databases provided with the Sample Server to their original state.
The Sample Server provides the following databases:
- resdb contains the Rule Execution Server sample database.
- resdb-customdw contains the custom datawarehouse and custom scenario provider.
- rtsdb contains the Decision Center sample database.
- rtsdb-serverextendedbrm contains the Decision Center sample database for the serverextendedbrm sample (which needs a specific database schema).
- rtsdb-serverworkflow contains the Decision Center sample database for the serverworkflow sample.
- rtsdb-tutorials contains the database for the Decision Center tutorials.
Procedure
To restore the databases to their original state (as when you first installed Decision Server):
In the Samples Console, click the Restore the Sample Server database icon.
It can take a while for the database restore process to complete. The Console view displays feedback messages as the database is being restored.