BEA Systems, Inc.

Class WorkflowExample


public class WorkflowExample
extends java.lang.Object

Workflow example. This example shows the use of a Business Smart Component that has a workflow associated to it The workflow states and transitions are modeled with Rational Rose. For this examples, we'll use the EBusinessSession Component. This component has a workflow that guides it through the different stages of an online e-business session. If you look at the Rose model file for the ebusiness.session package, you will find that EBusinessSessionWorkflow has a state diagram associated to it. The workflow logic can be implemented in any way you want; however, Theory Center provides a reference implementation. For the reference implementation, for each component with the BSC.Workflow stereotype, all the states and transitions in the Rose model are generated into a complete state machine by the SmartGenerator, so you can use it immediately, without any hand-coding of the workflow states or transitions. Please note that the SmartGenerator is NOT included in the JumpStart Kit. In this example, we also use the EBusinessSessionManager and show how a "manager" session bean can simplify the usage of an entity bean

See Also:
EBusinessSession, EBusinessSessionManager, EBusinessSessionWorkflow, Workflow

Constructor Summary
Method Summary
 EBusinessSession createGuestSession()
          This method creates a new guest session.
 void exitExample(java.lang.String message, java.lang.Exception e)
          Exit program, displaying the exception
 Customer findOrCreateCustomer(java.lang.String customerKey)
          Finds or Creates a customer with customerKey
static javax.naming.Context getInitialContext()
          Gets an initial context for the current user, password and url.
static void main(java.lang.String[] args)
          Main driver.
 void playWithWorkflow(EBusinessSession session)
          This method takes a guest session and moves it thru its workflow
 void run()
          This method runs the example.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public WorkflowExample()
Method Detail


public EBusinessSession createGuestSession()
This method creates a new guest session. It uses the EBusinessSessionManager to quickly make a session key, create the entity, and set its workflow to "guest"
EBusinessSession the newly created session


public void exitExample(java.lang.String message,
                        java.lang.Exception e)
Exit program, displaying the exception
message - the exit message
e - the exception that was raised


public Customer findOrCreateCustomer(java.lang.String customerKey)
Finds or Creates a customer with customerKey
customerKey - the primary key for out customer


public static javax.naming.Context getInitialContext()
                                              throws java.lang.Exception
Gets an initial context for the current user, password and url.
java.lang.Exception - if there is an error in getting the Context


public static void main(java.lang.String[] args)
Main driver. The comman line arguments are optional, but if any are supplied, they are interpreted in this order: customerKey Customer Key, default "TerrySmith" url URL such as "t3://localhost:7601" of Server user User name, default null password User password, default null You can also get the usage by passing -?


public void playWithWorkflow(EBusinessSession session)
This method takes a guest session and moves it thru its workflow
session - the guest EBusinesSession


public void run()
This method runs the example. First, it creates a new EBusiness guest session using the EBusinessSessionManager Then, it moves the workflow of the session around, registering a customer, authenticating, etc Finally, it deletes the session to clean up.
See Also:
EBusinessSession, EBusinessSessionManager, Workflow

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved