Sei sulla pagina 1di 342

TIBCO Business Studio Tutorials

Software Release 3.0.0


May 2014

Two-Second Advantage

TIBCO Business Studio Tutorials

Contents
Create and Run Your First BPM Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
How To Design a Simple WelcomeUsers Business Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Creating a New Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Adding a User Task to the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Adding Data to the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Defining the Input Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Defining the Data Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Refactoring the Start Event and Create a Business Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Changing the Start Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Generating the Business Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Defining an Organization Model for the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Adding the Tester Position as a Participant to the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Defining a Participant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Assigning the Participant to the User Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Defining the Generate Message Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Verifying the Design Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
How to Implement and Deploy the WelcomeUsers Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Enabling Solution Design Capability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Implementing the Welcome Message Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Creating a Deployment Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Connecting to the Deployment Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Deploying the WelcomeUsers Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Verifying the Implementation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
How to Map Users to the WelcomeUsers Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Logging into Openspace and Starting the Organization Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Creating an LDAP Container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Mapping a User to the Testers Position in the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Logging Out of TIBCO Openspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Running the WelcomeUsers Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Logging into Openspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Starting the Business Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Logging Out of TIBCO Openspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Creating and Using Business Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42


How to Create Business Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Creating a New Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Creating a Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Saving the Business Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Creating a Class and its Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

TIBCO Business Studio Tutorials

4
Creating and Applying a Primitive Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Creating a Generalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Creating a Composition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Verifying the Results of "How to Create Business Data" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
How to Use Business Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Opening the Business Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Defining a Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Saving the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Creating and Using a Conditional Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Defining Data Fields that Reference Business Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Assigning the Data Fields to User Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Generating Forms for the User Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Verifying the Results of "How to Use Business Data" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63

Using the Organization Modeler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65


How to Use the Graphical Organization Modeler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Creating a New Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Using the Organization Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Setting the Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Saving the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Creating Organization Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Creating Positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Copying and Pasting Organization Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Creating Hierarchical Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Creating an Association . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Verifying the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
How to Add Groups Capabilities and Privileges to an Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Opening the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Creating a Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Saving the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Creating Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Assigning Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Assigning Capabilities to Positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Assigning Capabilities to Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Creating Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Assigning Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Assigning Privilege to Positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Assigning Privileges to Organization Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Updating the Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Deploying the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

Assigning Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

TIBCO Business Studio Tutorials

5
How to Ensure that a Sequence of Tasks is Performed by the Same User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Importing the Initial Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Mapping a Participant to an Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Making Sure a Sequence of Tasks is Performed by the Same User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Deploying and Running the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Verifying the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
How to Ensure Specific Tasks in a Process are Performed by Different Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Importing the Initial Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Making Sure that Specific Tasks are Performed by Different Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Deploying and Running the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Verifying the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
How to Dynamically Define Who Gets Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Creating the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Dynamically Defining Who Gets Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Deploying and Running the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Verifying the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
How to Assign a Task to a User Based on their Job Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Importing the Initial Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Assigning a Task to a User Based on their Job Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Deploying the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Verifying the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
How to Deliver Work by Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Importing the Initial Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Creating the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Creating the Business Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Editing the Email Attributes in the Presentation Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Deploying the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Editing and Using Organizational Entity Push Destinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Verifying the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
How to Tailor Your Own Email Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Importing the Initial Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Importing the Initial Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Updating the Project Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Importing the Template Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Creating an Alternative Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Including the Template Files in Your Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Modifying the Template Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Adding a Graphic to the Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Applying the Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Deploying and Testing the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

TIBCO Business Studio Tutorials

6
Deploying the Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Testing the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Verifying the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

Using Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123


How to Use Default Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Opening the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Importing the FormsTutorialStart Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Importing the EasyAsExtendedOMSolution Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Previewing the Default Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Choosing Fields to Display in a Default Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Specifying Structured Data for a Default Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Previewing the New Default Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Adding Fields to a Default Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Defining Restrictions for a Control on a Default Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Verifying the Tutorial Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
How to Use Structured Data in a Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Opening the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Importing the FormsTutorialStart Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Importing the EasyAsExtendedOMSolution Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Renaming the Project in the Project Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Examining the Form and the Business Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Marking Attributes as Required or Optional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Using Multiplicity to Configure Form Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Using an Enumeration to Specify Choice Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Modifying the Appearance of Fields in a Default Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Changing the Order of Controls and Panes in the Default Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Changing the Labels for Controls in the Default Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Editing an Array of Objects Using a Grid Pane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Verifying the Tutorial Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
How to Customize the Appearance of a Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Opening the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Importing the FormsTutorialStart Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Importing the EasyAsExtendedOMSolution Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Renaming the Project in the Project Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Assigning a CSS Class to a Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Setting a CSS Class at the Form Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Setting a CSS Class at the Pane Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Setting a CSS Class at the Control Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Changing the Style of a Control Based on an Input Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Verifying the Tutorial Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

TIBCO Business Studio Tutorials

7
Using Dynamic Sub-Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
How to Use Dynamic Sub-Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Importing the Initial Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Examining the Starting Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Creating the Process Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Creating a Sub-Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Creating a Second Sub-Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Adding Parameters to the Process Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Tailoring the Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Defining Which Sub-Process is Called . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Setting up the Summary Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Generating the Business Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Deploying and Running the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Deploying the Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Mapping Users to the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Running the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Verifying the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177

Accessing External Data and Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .178


How to Call a Database From a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Importing the GetUserLoginName Analysis Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Importing the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Importing the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Creating a Database Service Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Setting up Data Inputs to and Outputs from the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Creating a JDBC Resource Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Create a JDBC Resource Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Create and Install a Resource Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Creating a System Participant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Deploying the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Deploying the EasyAsExtendedOMSolution Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Deploying the GetUserLoginName Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Testing the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
How to Call an External Web Service From a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Importing the FindAddress Analysis Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Importing the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Importing the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Importing the UKAddressService WSDL Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Creating a Web Service Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Setting up Data Inputs to and Outputs from the Web Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Setting Up a System Participant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191

TIBCO Business Studio Tutorials

8
Creating an HTTP Client Resource Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Create an HTTP Client Resource Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Create and Install an HTTP Client Resource Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Deploying the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Deploy the EasyAsExtendedOMSolution Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Deploy the FindAddress Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Testing the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Importing a Tutorial Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
How to Call a Secured External Web Service From a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Obtaining and Distributing the Required Security Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Generating a Keypair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Exporting the Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Importing the Certificate into the Host Systems Truststore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Creating a Keystore Provider Resource Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Creating an Identity Provider Resource Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Creating the Identity Provider Resource Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Creating the Resource Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Configuring the System Participant in the Calling Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
How to Call a BPM Runtime Service from a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Importing the WSDL that Defines the Required BPM Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Generating the WSDL for the EntityResolverService . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Importing the EntityResolverService WSDL into the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Configuring the Web Service Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Calling the lookupUser Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Identifying the Shared Resource to be Used to Call the Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Configuring how the Call will be Authenticated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Configuring Input Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Creating Required Data Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Initializing Input Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Configuring Input Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Processing Output Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Creating Required Data Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Configuring Output Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Processing the Output Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Configuring Shared Resources to Call the BPM Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Creating an HTTP Client Resource Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Configuring Shared Resources to Identify the Calling User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Creating a Keystore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Creating a Keystore Provider Resource Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Creating an Identity Provider Resource Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

TIBCO Business Studio Tutorials

9
Creating the Resource Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Deploying and Testing the callLookupUser Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
How to Call a Virtualized Service from a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Importing the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Creating the Service Provider Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Creating the Business Objects in the Provider Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Defining the Business Process in the Provider Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Defining the Provider Project Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Defining the Task Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Creating the Service Consumer Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Defining the Consumer Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Configuring the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Defining the Process Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Defining the Web Service Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Generating the Business Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Final Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Checking the System Participant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Mapping the Parameters in the Consumer Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Deploying the Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Deploying the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Deploying the Service Provider Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Deploying the Service Consumer Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Testing the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Installing the Tutorial Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Using Credential Mapping to Associate a Specific Identity with a Process Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Credential Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Process Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Creating a Keystore Containing the Security Credentials to Run the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Creating the Links to the Keystore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Creating and Install a Keystore Provider Resource Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Creating and Installing an Identity Provider Resource Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Creating and Installing an Identity Provider Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Configuring the Credential Mapping Process to Assign the Security Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
How to Send an Email From a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Importing the AcknowledgeClaim Analysis Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Creating an Email Service Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Setting up Dynamic Data Inputs to the Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Populating the Data Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Setting Up a System Participant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Creating an SMTP Resource Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243

TIBCO Business Studio Tutorials

10
Creating an SMTP Resource Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Creating and Install an SMTP Resource Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Deploying the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Testing the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
How to Call TIBCO BusinessEvents from a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Creating the ActiveMatrix BPM Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Creating the Business Object Model Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Defining the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Configuring the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Creating a Data Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Configuring the Web Service Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Creating a Business Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Creating the HTTP Client Shared Resource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Creating the HTTP Client Resource Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Deploying the Business Process Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Creating the BusinessEvents Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Creating a New BusinessEvents Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Importing the TIBCO ActiveMatrix BPM WSDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Creating the Ontology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Creating a Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Configuring the Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Setting Up the Rules and Rule Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Creating a Virtual Rule Functions Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Creating a Virtual Rule Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Configuring the Virtual Rule Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Configuring the Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Configuring the Rule XSLT Request Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Configuring the Rule XSLT Response Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Defining the Decision Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Creating a Decision Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Configuring the Decision Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Specifying the Decision Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Preparing the BusinessEvents Application for Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Creating a Cluster Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Configuring the Cluster Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Deploying the BusinessEvents Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Building the Enterprise Archive File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Starting the BusinessEvents Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Testing the Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
How to Call a TIBCO ActiveMatrix BusinessWorks Service from a BPM Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261

TIBCO Business Studio Tutorials

11
Setting up the Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Importing the TIBCO SOA Project and ActiveMatrix BusinessWorks Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Importing the Simple Organization Model (Optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Creating the BPM Developer Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Importing the ActiveMatrix BusinessWorks Service Engine WSDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Defining the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Configuring the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Creating the Data Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Configuring the Service Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Creating a Business Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Creating a DAA of the SimpleAddressClient Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Deploying the Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Deploying the TIBCO SOA Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Deploying the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Deploying the ActiveMatrix BPM Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Testing the Integration Between Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Using the Schema Construct xsd groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Using Schema Construct xsd choice in a BPM Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Creating the BPM Developer Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Importing the ActiveMatrix BusinessWorks Service Engine WSDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Defining the Type Address in the BOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Defining the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Configuring the Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Creating the Data Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Configuring the Service Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Configuring the Script Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Creating a Business Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Deploying the Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Deploying the TIBCO SOA Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Deploying the Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Deploying the ActiveMatrix BPM Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Running the Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

Integrating Data Using POJO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277


How to Integrate Data into a Process using Plain Old Java Objects (POJO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Importing the Initial Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Creating a Java service task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Setting up Data Inputs and Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Deploying and Running the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279

Providing Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280


Exposing a Process as a Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280

TIBCO Business Studio Tutorials

12
Creating a WelcomeUsersService Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Configuring the Start Event to Receive a Message From a Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Configuring the End Event to Return a Message to the Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Defining the Data Inputs to and Outputs from the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Creating a Script to Generate the Welcome Greeting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Deploying the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Generating the WSDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Testing the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Using Mediation to Transform and Route an Event to TIBCO BPM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Creating a TIBCO SOA Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Importing the WSDL Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Creating and Configuring the Mediation Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Adding a Route Mediation Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Adding Transform Mediation Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Adding Transform Tasks in the Input Path View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Configuring the Throw Fault Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Adding Transform tasks in the Output Path View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Configuring the Fault Path View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Creating the Shared Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Creating Substitution Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Creating the Shared Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Binding Properties of the Shared Resources to the Substitution Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Configuring the Mediation Composite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Creating the Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Creating the References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Creating the Distributed Application Archive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Importing a Tutorial Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

Using Openspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305


How to Get Started with Openspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Logging in to Openspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Adding a Gadget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Starting a Business Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310

Using Pageflows and Business Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .313


How to Model and Run Pageflows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Importing the Initial Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Mapping a Participant to an Organization Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Creating a New Pageflow Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Adding a Sequence of Tasks to the Pageflow Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Associating Existing Data with the Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Adding Further Data to the Pageflow Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

TIBCO Business Studio Tutorials

13
Creating Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Assigning Fields to Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Deploying the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Running the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Verifying the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324

Debugging a Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325


How to Debug a Business Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Understanding the Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Preparing TIBCO Business Studio for Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Preparing the Process for Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Adding Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Adding and Editing Emulation Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Configuring the Tester . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Launching the Tester . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Running a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Debugging the Process with Test Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Performing Batch Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

TIBCO Business Studio Tutorials

14

Create and Run Your First BPM Application


How To Design a Simple WelcomeUsers Business Service
This tutorial shows you how to use TIBCO Business Studio to rapidly design a simple business service.
The business service:

Displays a form to collect a users name and phone number. For example, the user may be
requesting information on a product, or signing up to a service.

Calls a process that runs a script to generate a message containing the name and phone number.

Displays a form requesting that the recipient of the work item call the user.

You should work through each section in turn to complete the tutorial.
Although it uses a very simple example, this tutorial demonstrates some of the fundamental points of
the analysis phase for any business service:

designing the process flow

creating and assigning the data required by the process

creating and assigning the participants who will be involved in the process

placing and describing tasks such as scripts (or services) that will be implemented later by the
solution designer.

After completing the tutorial, you should be familiar with the basic steps involved in creating a process
design.
What to do next
After completing this tutorial, you can follow the How to Implement and Deploy the WelcomeUsers
Application tutorial, which describes how to elaborate your design to turn it into an executable model,
and then to deploy it.

Creating a New Project


A project is the basic container that you use to store all the artifacts needed by your business process.
The project you create here contains a basic organizational model.
Procedure
1. Start Studio for Designers.

TIBCO Business Studio Tutorials

15

2. Click File > New > BPM Developer Project . The New BPM Developer Project wizard is displayed.
If this project is not available, check that you are using the Modeling perspective. You can
see this in the top right hand of your screen. If you are not in this perspective, click on the
Open Perspective icon next to the perspective name, and change it to Modeling.
The perspectives listed depend on the options you chose when you installed TIBCO
Business Studio, and may not be identical to the following.

3. Enter WelcomeUsers as the Project name.


4. In the Destination Environments section, select BPM and click Next.

A destination environment specifies a target runtime environment where the process will execute. If
you model anything that cannot be executed in a selected target environment, TIBCO Business
Studio will display a validation warning or error, allowing you to correct the problem.

TIBCO Business Studio Tutorials

16

5. On the Asset Type Selection dialog, deselect Business Object Model; select Organization Model;
and click Finish.

6. The process opens in the Process Editor, and the new project appears in the Project Explorer.

The project contains a number of folders, each of which contains different types of artifacts. Note
that:

The project contains a single process package, called WelcomeUsers.xpdl.

The process package contains a single process, called WelcomeUsers-Process.

7. Click on Organization and expand it. Right-click on WelcomeUsers.om and click Rename. Rename
it to XYZCompany.om and click OK.
8. Select WelcomeUsers.xpdl in the Project Explorer and press CTRL + S to save the changes you have
made.

TIBCO Business Studio Tutorials

17

Adding a User Task to the Process


The Process Editor is where you create your business process. It includes a Palette that contains the
tools you use to create your process.
A default process is automatically displayed in the Process Editor when you create the project that
contains it. The WelcomeUsers process contains:

a Start Event, which marks the beginning of the process.

an End Event, which marks the end of the process.

a sequence flow, which shows the flow of activities through the process.

Now we need to outline the process by adding a user task to it.

TIBCO Business Studio Tutorials

18

Procedure
1. Click the Show Palette button (at the top right corner of the Process Editor).

The Palette contains a number of drawers, each of which contains a set of tools.

2. Click the Tasks drawer to open it.


Click the Script tool

in the Palette in the Tasks drawer.

3. Position the mouse pointer over the sequence flow between the Start and End events, then click to
add the script task.
4. Change the task name to Generate Message and click away from the field to save the change.
5. Click the User Task tool in the Palette in the Tasks drawer.

TIBCO Business Studio Tutorials

19

6. Add a user task after the Generate Message task.


If you are running out of room to add another task, you can easily move the other tasks
over by dragging and dropping them. If you dont do this, when you add another task, the
task will have a bend in the sequence flow to fit it in.
7. Change the task name to Display Message and click away from the field to save the change. Your
process should now look like this.

Note that the tasks have a problem sign( ) against them. This sign is a validation marker, meaning
that something is either wrong or missing that will prevent the process from being deployed in its
current state to one of its defined destination environments. To see what the error is, hover the
mouse over the validation marker.

The marker on the Generate Message Task Script informs that the grammar selected on the task is
unsupported and reminds you that you will need to update the task to a supported grammar such
as JavaScript.(You will do this in How to Implement and Deploy the WelcomeUsers Application.)

The marker on the Display Message User Task simply reminds you that you will need to assign a
participant - somebody to perform the task - to the user task before you deploy the process. (You
will do this later in this tutorial - see Adding the Tester Position as a Participant to the Process).
8. Press CTRL + S to save the changes you have made to the process.
The first time you do this, you will see the following. Select Dont ask in future to avoid
being asked to confirm every time you save. Then click OK.

TIBCO Business Studio Tutorials

20

Adding Data to the Process


Data is input to a process using parameters. Data fields can be assigned to user tasks to obtain and
display information. They can also be manipulated in script tasks.
To add the data to the process, you must first define the required parameters, then assign them to a
message start event.
Defining the Input Parameters
Input parameters define the data that is input to the process.
Procedure
1. In Project Explorer, drill down and expand to the Parameters entry under Processes.

Click the plus sign

at the right of the Properties view.

2. Click in the Label column and change the name from the default Parameter to UserName.
3. Change the mode of the parameter to In (because it will be input to the process).

4. Similarly, add another input parameter PhoneNumber, using the default text type.
5. Press CTRL + S to save the changes you have made to the process.
Defining the Data Field
Data fields identify inputs to and outputs from user activities.
Procedure
1. In Project Explorer, select the Data Fields entry under Processes.
Click the plus sign

at the right of the Properties view.

2. Click in the Label column and change the name from the default Field to Message.

TIBCO Business Studio Tutorials

21

3. From Project Explorer, drag and drop the Message data field onto the Display Message task. A
popup menu is displayed.
If you do not do it correctly, the popup does not appear. Check that you have a data field
selected, and you are dragging it to the user task.

4. Click Add Data To View. This means that the field contents are displayed as read-only when the
work item is displayed.
5. Check that the Enable Reference Highlighting button in the toolbar is enabled. If it is enabled, it is
highlighted by a frame of green lines.

6. In Project Explorer, select the Message data field. In the Process Editor the task which uses this field
Display Messageis highlighted with a similar frame of green lines). Other tasks and steps in
the process are grayed out.

7. Click elsewhere in the Process Editor to clear the highlight.


You can use the same reference highlighting tool to identify the tasks associated with
parameters and participants.
8. Press CTRL + S to save the changes you have made to the process.

Refactoring the Start Event and Create a Business Service


Data is input to a business process using parameters. Parameters are sent from a business service (send
task) to a message start event in a business process.
Change the start event to a message start event and generate the business service as follows.

TIBCO Business Studio Tutorials

22

Changing the Start Event


Making the start event a trigger type of "message" allows the process to be invoked as a web service
operation.
Procedure
1. Right-click the start event and select Trigger Type > Message Trigger . The start event is now called
Catch Message Event.
2. This generates a validation error that you can see by moving the pointer over the error flag on the
Catch Message Event.

3. Click Clean and build project: WelcomeUsers in the error box, and note that after a short delay, the
error is no longer displayed.
Generating the Business Service
A business service is needed to collect the data needed to start the process.
Procedure
1. Right-click the Catch Message Event and select Business Service > Generate .
2. A business service with a user task and a send task is generated:

The purpose of this business services is to collect the data needed to start the business process
(UserName and PhoneNumber), and send the data to the business process (using the send task).
3. Rename the user task in the business service Collect Data. Similarly, rename the send task Start
Process.
4. In the Project Explorer, rename the business service from the default WelcomeUsers-Catch
Message Event to Request Call.
5. Save the process package.
TIBCO Business Studio Tutorials

23

Defining an Organization Model for the Process


An organization model captures and defines information about how an enterprise is organized. The
model represents the different entities in the organization (such as positions, organizational units or
groups), their organizational structure and the relationships between them.
The model can also describe characteristics that can be possessed by those entities - such as privileges,
capabilities or location.
A process designer can use the information defined by the organization model to ensure that the
process sends the right work to the right people at the right time.
Only entities defined in the organizational model can be assigned (as participants) to perform user
tasks in processes.
An organization model does not define the actual users (resources) who belong to it. Assigning users to
organization model entities is a separate task, performed at runtime using the Organization Browser.
You will do this in a later tutorial (How to Map Users to the WelcomeUsers Organization Model ).
Procedure
1. In Project Explorer, expand WelcomeUsers and drill down to Organization and then
XYZCompany.om and expand that.
2. Expand Organization Model > Organizations , and double-click Organization1 (Organization1)
and the Organization Editor opens.

You use the Organization Editor to produce an organization diagram, showing the structure of an
organization, the organization units and positions it contains, and the relationships between them.
The Organization Editor:

contains a canvas area and a Palette. Note that the Palette contains a different set of tools than
those provided in the Process Editor.

initially shows an empty organization for Organization1.

3. Click the Organization Unit tool

in the Palette.

TIBCO Business Studio Tutorials

24

4. Position the mouse pointer anywhere in the Organization Editor canvas, then click to add an
organization unit to the organization, or select the Organization Unit from the palette and drag and
drop it.

5. Change the organization unit label from OrgUnit1 to Test Department. (Click away from the field
in the Organization Editor or press Enter to save your name change.)
6. Drag and drop Position from the Palette into the Test Department.
7. Click Position1 to allow you to rename it. Change the positions name to Tester. Click away from
the field in the Organization Editor to save your name change.
8. XYZCompany.om contains a number of different folders that are used to store different types of
information about an organization. An asterisk is displayed next to the folders with unsaved
changes.
Now expand Organization, through Organization > Test Department > Tester . Note that the
departmental structure that you have created in the Organization Editor is mirrored in the Project
Explorer.
9. Press CTRL + S to save your changes to the XYZCompany.om model.

Adding the Tester Position as a Participant to the Process


Participants represent the users who perform the work defined in user tasks.
Note that:

Participants must be defined as external references in the organization model used by the process.

Every user task in a process must have a valid participant.

You must first define the participant. Then you assign the participant to each user task that you want
that participant to receive work items from.

TIBCO Business Studio Tutorials

25

Defining a Participant
Often, participants are defined as a group, position, or organization unit (although other types are also
allowed). This allows users mapped to the group, position, or organization unit to receive work items.
Procedure
1. In Project Explorer, expand the WelcomeUsers project ( WelcomeUsers > Process Packages >
WelcomeUsers.xpdl > ProcessPackage .) Expand Process Package to see Participants.

2. Right-click Participants, then select New > Participant . The New Participant dialog is displayed.
3. Change the Label to Process Tester.
Ignore the message part way through saying that Process is an illegal name - it will go away when
you enter the full name.
4. In the Type section, click External Reference. This allows you to select a participant from an
organization model defined outside the process.

5. Click

. The Select Type dialog is displayed.

6. Select Tester, then click OK.


Type the first letters of Tester in the box entitled Saved type(s) (? = any character, * = any
string): to show all external references starting with those letters.
7. Click Finish.
8. Press CTRL + S to save the changes you have made.

TIBCO Business Studio Tutorials

26

Assigning the Participant to the User Task


When a participant is assigned a user task, work items associated with the user task are sent to the
users mapped to the participant.
Procedure
1. Click on the WelcomeUsers process tab from the Process Editor.
2. From Project Explorer, drag and drop the new Process Tester participant onto the Display Message
task.
The validation marker (
defined for it.

) now disappears because the user task has a participant

3. Press CTRL + S to save the changes you have made.

Defining the Generate Message Script


A script task contains a set of instructions (a script) that will be executed in the runtime environment
when the process is deployed and executed. Scripts can be used for many purposes - for example, to
manipulate or validate data in some way, or to perform calculations.
A script task must be implemented as JavaScript before the process is deployed.
During the analysis phase, you can simply add text to a script task to describe the desired behavior of
the script. The script can then be implemented later (as JavaScript) by the solution designer.
Procedure
1. Select the Generate Message script task.
2. In the Properties view, General tab, select Free Text in the Script Defined As field.
3. Enter the following description for the script.
The script task displays an error marker. This is because the script is defined as free text.
You will change this in the next tutorial.

4. Press CTRL + S to save the changes you have made to the process.

Verifying the Design Results


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
1. Find the WelcomeUsersDesignSolution.zip file, in the location where you installed TIBCO
Business Studio (for example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
The Import wizard is displayed.
3. Select General > Existing Studio Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.

TIBCO Business Studio Tutorials

27

5. Browse to WelcomeUsersDesignSolution.zip and click Open.


The WelcomeUsersDesignSolution project is displayed in the Import wizard.
6. Click Finish.
The WelcomeUsersDesignSolution project is installed in your workspace.
Note that the Generate Message script task in this project displays the error message mentioned in
Defining the Generate Message Script.

How to Implement and Deploy the WelcomeUsers Application


This tutorial shows you how to turn the simple WelcomeUsers business service created earlier into an
executable model, then how to deploy and execute it.
Prerequisites
Perform the tutorial How To Design a Simple WelcomeUsers Business Service.
You should work through each section in turn to complete the tutorial.
This tutorial demonstrates the following fundamental points about implementing and deploying a
business service for execution:

You must have Solution Design capability turned on to be able to add implementation details to a
process or be able to create and use deployment servers.

Any script (or service) tasks in a process must have their implementation details completed before
deployment.

You do not have to create any forms for user tasks before you deploy a process. (You can obviously do
so if you wish, but it is not required.) At runtime, a default form will be used for any user task that does
not have a form explicitly created for it.
You should now be familiar with:

the basic steps involved in elaborating a business analysts process design and turning it into an
executable model that can be run by Process and Work Manager.

how to deploy an executable model to the BPM runtime.

Enabling Solution Design Capability


TIBCO Business Studio allows the solution designer to show implementation details of a process that
were previously hidden from the business analyst.
Perform the following procedure to see the parts of the TIBCO Business Studio user interface relevant
to process implementation.
Procedure
1. On the toolbar, click the drop-down next to the Enable/Disable Business Studio Capabilities icon.

2. Ensure the Solution Design capability is selected.


Result

TIBCO Business Studio Tutorials

28
If the Solution Design capability is not available, your installation of TIBCO Business Studio is missing
the Process Implementation feature. (This may be because TIBCO Business Studio was installed using
the Business Analyst installation persona.) You will need to re-install TIBCO Business Studio, this time
using the Solution Designer installation persona.

Implementing the Welcome Message Script


Any script in a process must be implemented as JavaScript before the process is deployed.
Perform the following procedure to replace the business analysts free-text description with the
appropriate JavaScript code.
Procedure
1. Click the Generate Message script task.
2. In the Properties view, General tab, change the Script Defined As field from Free Text to
JavaScript.
3. Replace the existing free text description with the following script:

Process objects (such as data fields or user tasks) have both a Name and a Label. A Label
can contain spaces or non-alphanumeric characters. A Name is generated automatically
from the Label, but strips out any spaces or non-alphanumeric characters.
Business analysts use a Label to name a process object. However, when you are
implementing a script, you must reference an object using its Name rather than its Label.
Note that the Generate Message script task no longer displays an error marker.
4. Save your changes by selecting File > Save .

Creating a Deployment Server


A deployment server defines a connection to a TIBCO BPM runtime.
Prerequisites
Before you start this procedure, you need to find out from your administrator:

What protocol (http or https) and what IPaddress to use in the Runtime Server Parameters dialog.

If your BPM runtime is set up to use https communications, you must obtain the self-signed
certificate provided by the instance hosting the BPM runtime, then register that certificate with the
TIBCO Business Studio JRE. Refer to BPM Implementation > Deploying BPM Applications >
Creating a New Deployment Server for full instructions.

Procedure
1. In the Deployment Server view, right-click Deployment Servers, then choose New > Server . The
New Server wizard is displayed.
2. In the server Name field, enter XYZWorkServer1.

TIBCO Business Studio Tutorials

29

3. In the Runtime field, select Administrator Server from the drop-down list.

TIBCO Business Studio Tutorials

30

4. Click Next. The Runtime Server Parameters dialog is displayed.


Enter the required connection details that you want to deploy the application to.

In the Server URL field, enter the login URL for the Administrator interface in the BPM
runtime. This is in the form:
protocol://host:port
protocol is the communications protocol used by the BPM runtime. It is either http or https.
host is the name or IP address of the server hosting the BPM runtime. This may be localhost if
the BPM runtime is on the same machine as TIBCO Business Studio.
port is the port used by the BPM runtime, and defaults to 8120.
Your administrator may give you specific values for your installation.

The User Name and Password default to root and t. Again, your administrator may give you
different values for your installation.

Select "BPMEnvironment" in the Default Environment field.

Check the Save password checkbox.


The following illustration shows typical values for a premises-based BPM runtime. If you are
given different values by your administrator, enter those.

TIBCO Business Studio Tutorials

31

5. Click Test Connection. The following dialog is displayed, indicating that TIBCO Business Studio
can successfully communicate with the TIBCO BPM runtime.

If the connection is not successful, no message is displayed immediately, but the system
keeps retrying. If it continues to be unsuccessful, eventually you will receive an error
message.
6. Click Finish. The new deployment server now appears in the Deployment Server view.

Connecting to the Deployment Server


You must connect to the deployment server before you can deploy an application.
Procedure
1. In the Deployment Server view, right-click XYZ Work Server1.
2. Click Connect.
A message may be displayed indicating that the server is refreshing. In the Properties view, the
Server State changes to Connected.

Deploying the WelcomeUsers Project


You deploy an application to a TIBCO node by deploying its project to the appropriate deployment
server.
If a project references artifacts in other projects - such as organization models or business object models
- you must also deploy those projects at the same time.

TIBCO Business Studio Tutorials

32

Procedure
1. In the Deployment Server view, right-click XYZ Work Server1 and click Deploy Module. The
Deploy Module(s) wizard is displayed.
2. In the Select Module Type dialog select Deploy BPM Project and click Next.
3. The Select Project dialog is displayed. Select WelcomeUsers as the module to deploy and click
Next. There is a short pause while the necessary files generate.
4. In the Administrator Setup dialog, click Next.
In the Property Configuration dialog, click Finish. A progress dialog displays while deployment
takes place. If you select the Close Dialog checkbox, the dialog closes when it is completed. If not,
click the
button or click Close when deployment has completed.

TIBCO Business Studio Tutorials

33

5. In addition, a Console view opens.This view also displays progress messages.

6. Expand the Deployment Server view. The WelcomeUsers project appears as a deployed
application.

Verifying the Implementation Results


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the WelcomeUsersImplementSolution.zip file, in the location where you installed TIBCO
Business Studio (for example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
The Import wizard is displayed.
3. Select General > Existing Studio Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to WelcomeUsersImplementSolution.zip and click Open.
The WelcomeUsersImplementSolution project is displayed in the Import wizard.
TIBCO Business Studio Tutorials

34

6. Click Finish.
The WelcomeUsersImplementSolution project is installed in your workspace.

How to Map Users to the WelcomeUsers Organization Model


This tutorial shows you how to map a user to a position in the organization model. This enables the user
to log into a BPM application and process work items generated by the WelcomeUsers application.
Prerequisites
Before you try to map resources, make sure that you have carried out the following tasks:

The WelcomeUsers application must be deployed. See the How to Implement and Deploy the
WelcomeUsers Application tutorial.

The example EasyAs Insurance Company data must be available in an LDAP shared resource,
because the BPM runtime retrieves details of resources, that is of users, from such a shared resource.

If, at installation, you chose to install the internal LDAP directory server provided with the BPM
runtime, then the resources needed for these tutorials are automatically made available.

If, at installation, you chose to use an external LDAP server, you must import the data from the
supplied server.xml and easyAsInsurance.ldif files. Consult the documentation supplied by
your LDAP provider to find out how to do this.

You should work through each section in turn to complete the tutorial.
You must map users to either a group or position in the organization model to enable them to:

log into a BPM application.

receive and process work items generated by BPM applications.

After completing this tutorial, you should be familiar with:

how to log into Openspace and start the Organization Browser.

how to create an LDAP container.

how to map a user from an LDAP container to the organization model.

Logging into Openspace and Starting the Organization Browser


Openspace is a web application that allows users to work with process and work management
applications for example, to process work items or start process instances.
The Organization Browser is a function available from Openspace that allows you to map resources
(users) to groups and/or positions in an organization model so that those users can log into BPM
applications, as well as receive work items in their work lists.
Procedure
1. Contact your system administrator to find out how to start Openspace. You may need to enter a
specific URL in your browser, or click a link from a specific web page.
When you start Openspace, the Openspace login screen is displayed:
Openspace recognizes the user name tibco-admin with a password of secret. This is
the only user authorized to login until another user is mapped to the Organization Model
as described in this tutorial.
2. Enter tibco-admin in the User Name field, and secret in the Password field, then click Login.

TIBCO Business Studio Tutorials

35

3. From the row of tabs near the top of the screen, click Organization.
The Organization Browser gadget is displayed.

Creating an LDAP Container


LDAP containers are a collection of one or more LDAP sources. Lightweight Directory Access Protocol,
is an application protocol for querying and modifying directory services. An LDAP source represents
an LDAP server, which holds information about candidate resources (that is, users) who may need to
use or participate in TIBCO BPM applications.
You must create an LDAP container so that you can select the users you want to map to the
organization model. Those users will then be able to log into BPM applications.
Procedure
1. Click the LDAP Container link.
The list of current LDAP containers is display, which in this case should state "No LDAP Containers
defined".
2. Click the Add a new LDAP container button.
3. On the Add a new LDAP Container dialog, enter XYZ Corporate Users in both the Name and the
Description fields.
4. Click the Add Query Source button.
5. On the Add new LDAP Source dialog, select "easyAs" from the Alias field drop-down list.
This identifies the LDAP source from which resources will be obtained.
6. Click the 10 button to the right of Show sample of LDAP Entities.
This causes a list of 10 resources (or fewer if less than 10 satisfy the query) from the LDAP source
you selected in the Alias field to be displayed:

This list contains the resources in the LDAP source that satisfied the filter query in the Query field,
which defaults to "(ObjectClass=person)".
The sample data list also shows you the LDAP attributes, and their respective values for each
resource, that are available to use in the Query and Resource Name Attribute(s) fields. The
available LDAP attributes will vary from LDAP source to LDAP source.
In this tutorial, you will not enter a value in the Base DN field; this causes the search in the LDAP
source to begin at the top level, rather than in a lower branch. Also don't change the default value in
the Query field, as you want only "people" resources listed in the resource list.
7. Use the LDAP attribute values in the sample data to determine the value to enter in the Resource
Name Attribute(s) field.
As the "ou" LDAP attribute contains the full name of the resources in the LDAP source, that is a
good candidate for the resource name.

TIBCO Business Studio Tutorials

36

8. In the Resource Name Attribute(s) field, remove the default value of "cn" and enter "ou".
Notice that when you change a value in one of the fields, the table of sample data is removed, as the
sample data may be different because of the new values in the fields.
9. Click the 10 button to the right of Show sample of LDAP Entities again.
The table of sample data is re-displayed. Note that the 10, 50, and 100 buttons only determines how
many resources to include in the table of sample data it has no bearing on the number of
resources that will be included in the LDAP container.
10. Click Save to save the LDAP source definition and return to the Add a new LDAP Container
dialog.
11. Click Save again to save the LDAP container definition.
The XYZ Corporate Users container you just created is now listed under the lists of containers in
the left pane.
12. Select the XYZ Corporate Users container, then click the Show Resources link in the right pane.
The resource list is shown in the left pane. These are the resources that are available to map to
groups or positions in the organization model.

Mapping a User to the Testers Position in the Organization Model


Work items generated by TIBCO BPM applications are sent to organization model entities, such as
groups, organization units, and positions.
You must assign users to groups or positions in the organization model so that they can receive and
process work items sent to organization model entities that contain those groups and/or positions.
For example, in the WelcomeUsers application, work items generated by the Display Message user
task are sent to the Tester position. You must, therefore, map at least one user to the Tester position to
carry out that work when it is sent out.
A resource must be "created" before the user can log into a BPM application, and before you can map
that user to a group or position. Once created, a resource is considered a "BPM resource". Creating a
resource causes an entry for that resource to be added to the database. Notice the icon displayed to the
left of the names in the Resource List. The appearance of the icon tells you whether or not the resource
has been created:

- The resource has been created, and is a BPM resource.


- The resource is a "candidate" resource. The resource is available to be created, then mapped to
groups or positions.

Procedure
1. In the Organization Browser, click the LDAP Container link, then select the "XYZ Corporate Users"
container from the container list.
2. In the right pane, click the Show Resources link.
The list of candidate resources in the container is displayed in the left pane.
3. From the resource list, select Clint Hill.
4. In the right pane, click the Map to Positions tab.

TIBCO Business Studio Tutorials

37

5. In the right pane, drill down in the organization structure until you can see the Tester position:

The zero shown in parentheses to the right of the Tester position indicates that there are currently
no resources assigned to that position.
6. Click in the check box to the left of the Tester position.
A red "1" appears to the left of the Tester position, indicating that there is currently one resource
selected that is not a member of that position.
7. Click the Grant link in the upper part of the right pane.
The Create Selected Resources dialog is displayed. This dialog is for the purpose of actually
creating the BPM resource. A resource must always for created before it can be mapped to a group
or position.
As part of the creation, you can change the resource's "Resource Name", which is the name that the
resource must use to log into a BPM application.

TIBCO Business Studio Tutorials

38

8. In this particular case, leave the Resource Name as "Clint Hill" and click Create on the Create
Selected Resources dialog.
The display should now appear as follows:

Notice that the icon to the left of Clint Hill in the resource list has changed to a
, indicating that
he is now a "BPM resource". Also, a green "+1" has appeared to the left of the Tester position. This
indicates that the addition of the currently selected resource to that position is pending; the actual
assignment will take place when you click Save. While that assignment is pending, you could make
additional mappings, if desired, before saving.
9. Click Save.
Notice that now there is a green "1" to the left of the Tester position, indicating that the currently
selected resource (which should still be Clint Hill) is mapped to that position. Plus there is now a "1"
in parentheses to the right of the Tester position, indicating that there is one resource mapped to
that position.
Result
Clint Hill is now:

defined as a BPM resource who can log into BPM applications using the unique ID Clint Hill.

assigned to the Tester position in the organization model. This means that he will receive any work
items sent to that positionsuch as those generated from the Display Message user tasks in the
WelcomeUsers application.

Logging Out of TIBCO Openspace


When you are finished working in the application, you should log out. This prevents others from
performing work using your login credentials.
Note that if you just close your browser rather than log out, Openspace will log you out automatically.
However, it is best practice to log out of Openspace manually before you close the browser.

TIBCO Business Studio Tutorials

39

Procedure
Click Logout to log out of Openspace.
You are logged out and the login screen is redisplayed.

Running the WelcomeUsers Application


This tutorial shows you how to start the WelcomeUsers business service using TIBCO Openspace
You should work through each section in turn to complete the tutorial.
This tutorial demonstrates:

how to log in to and log out of Openspace

how to start a business service.

how to open and process work items.

Logging into Openspace


Openspace is a browser-based application that allows you to work with process and work management
applicationsfor example, to process work items or start business services.
Procedure
1. Contact your system administrator to find out how to start Openspace. You may need to enter a
specific URL in your browser, or click a link from a specific web page.
2. On the Openspace login screen, enter a User Name of "Clint Hill" with a Password of "tibco123",
then click Login. The main Openspace user interface is displayed.
The password "tibco123" is a default defined in the LDAP.

Starting the Business Service


Once applications have been deployed, users (who have the appropriate permissions) can start them
using a business service. Starting a business service immediately displays a form, into which you enter
the information required by the underlying business process.
Procedure
1. From Openspace, click the Business Services link on the top menu bar.

TIBCO Business Studio Tutorials

40

2. Expand the entry in the All Categories list, then click on the WelcomeUsers category.
The "RequestCall" business service is shown in the right pane:

3. Double click on the RequestCall business service.


The form associated with that business service is displayed.
4. Enter a name and phone number in the fields on the form, then click Submit.
5. Click Work Views in the top menu bar.
The DisplayMessage work item should appear. If you cannot see it, refresh the contents of the work
list.
6. Double-click the DisplayMessage work item to open it. The following form is displayed in the
bottom-right pane (also called the "preview pane").

7. Click Submit.
Because the DisplayMessage work item is assigned to the Testers position, the work item
is offered to anyone mapped to this position, including Clint Hill.
You can click Event Views to see the events associated with running the business services and
associated business process.

Logging Out of TIBCO Openspace


When you are finished working in the application, you should log out. This prevents others from
performing work using your login credentials.
Note that if you just close your browser rather than log out, Openspace will log you out automatically.
However, it is best practice to log out of Openspace manually before you close the browser.

TIBCO Business Studio Tutorials

41

Procedure
Click Logout to log out of Openspace.
You are logged out and the login screen is redisplayed.

TIBCO Business Studio Tutorials

42

Creating and Using Business Data


How to Create Business Data
This tutorial shows you how to use TIBCO Business Studio to create a business object model and
populate it with business data.
This is my final task topic.
You should work through each section in turn to complete the tutorial.
Before you start this tutorial, you can become familiar with TIBCO Business Studio by completing the
initial WelcomeUsers tutorials.
Post Requisite
After completing this tutorial, you will be familiar with:

Creating a business object model,

Creating business objects and the connections between them.

Creating a New Project


A project is the basic container that you use to store all the artifacts needed by your business processes,
including the business object model.
You can include the business object model in a project together with the organization model and/or the
business processes, or have them in separate projects.
The project that you will now create will be used in a subsequent tutorial (How to Use Business Data)
for business processes. It does not contain an organization model.
Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. Select File > New > BPM Developer Project .
3. In the New BPM Developer Project dialog, enter EasyAsBusinessData as the Project name field.
4. Check BPM in the Destination Environments field and click Next.

TIBCO Business Studio Tutorials

43

5. In the Asset Type Selection dialog, leave the default values selected, and click Next.

The Business Object Model dialog is displayed.

6. Click Finish to accept the default values.


The Process Editor and Business Object Model editor are both displayed.
7. Select the Business Object Model editor

TIBCO Business Studio Tutorials

44

Result

For more information, see "Defining a Business Object Model" in the "Tasks" chapter of TIBCO Business
Studio Modeling Users Guide.

Creating a Package
Packages are containers, which you can use to organize classes and other business objects.
Everything that you create in this tutorial will be included in the claim package. In this task you create
one package, called claim.
Procedure
1. Select the Package tool in the palette.

2. Drag it on to the empty part of the business object model diagram and drop it.
This places a package in the diagram.
The Label field of the new package is automatically selected at this point.

TIBCO Business Studio Tutorials

45

3. Type claim into the selected field. Click away from the field to save the name.

You will see that this is automatically reflected in the Label and Name fields on the Properties tab.
Result
For more information, see "Package" in the "Tasks" chapter of the TIBCO Business Studio Modeling Users
Guide.

Saving the Business Object Model


In this task, you save the business object model.
Select File - > Save , click Ctrl+S, or click on the disk icon

You can also save your business object model at any point while you are creating or editing it. If there
are unsaved changes, an asterisk is displayed in the title of the Business Object Model editor, and also
next to the business object model in the Project Explorer view.
It is advisable to save after completing each procedure.

Creating a Class and its Attributes


A class is a set of properties that belong together. It can contain attributes, each of which represents an
individual piece of information.
In this task you create a class, called Generic Claim, and add attributes to it.
Procedure
1. Select the Class tool in the palette. Drag it over the claims package in the diagram and drop it.
This places a class in the diagram, contained within the package.

TIBCO Business Studio Tutorials

46

2. Label the class Generic Claim.

Note that this is reflected in the Label field but becomes GenericClaim with no space in the Name
field. The Name is used internally in scripts, expressions and so on.
3. Select the Attribute tool in the palette, and drag it over the GenericClaim class in the diagram and
drop it.

4. Select the attribute you have just created, and name it claimSummary.
The Properties view for that attribute is displayed.
Note that the attributes name claimSummary is now displayed in the diagram within the
GenericClaim class. By default it is assigned the type (or superclass) Text, and this is also displayed
after the name, separated by a colon. Since text is the appropriate type for a name, you do not need
to change this.
5. Add a second attribute to the same class and name it claimAmount.
To assign a different type to this attribute, select the attribute in the editor, and click on

6. The Select Type dialog is displayed. Click Bom Primitive Types::Integer and click OK.

TIBCO Business Studio Tutorials

47

Result

For more information, see "Packages" in the "Tasks" chapter of the TIBCO Business Studio Modeling
Users Guide.

Creating and Applying a Primitive Type


Primitive types are data types. Certain commonly-used data types - Text, Integer, Date, and so on - are
delivered with the Business Object Modeler. You can define your own primitive types to add to the
delivered types, in order to suit the specific requirements of your business.
In this task you create a primitive type, and use it to redefine the type of one of the existing attributes.
Procedure
1. Add a third attribute called claimDescription to the existing Generic Claim class.
You will apply your custom Type to this attribute.
2. Select the Primitive Type tool on the palette and click in the business object model.
3. Enter ExtendedText as the name of the primitive type.

On the General tab of the Properties view, click

The Select Type dialog is displayed. You use this to select an existing data type on which to base
your new type. For ExtendedText, you can leave this as the default Text.
4. In the Properties view for the primitive type, click the Resource tab.
5. Expand the Restrictions if it is not already expanded. Specify a Maximum Text Length of 2,000.
This specifies that an attribute of this type can be up to 2,000 characters long, instead of the default
length for the Text type which is 50.
If you see a warning icon in the diagram for the new primitive type, you can ignore it.
6. Select the claimDescription attribute.
On the General tab of the Properties view, click

The Select Type dialog is displayed. Your new ExtendedText type is now listed.
7. Select ExtendedText and click OK to apply it to the attribute.

TIBCO Business Studio Tutorials

48

Result

For more information, see "Primitive Type" in the "Concepts" chapter of the TIBCO Business Studio
Modeling Users Guide.

Creating a Generalization
Relationships indicate connections between objects in a business object model. Connections can be
generalizations or compositions.
In this task you create a new class that is related by generalization to your existing class.
Icons for association and aggregation are also provided in the palette. However these types of
connection are not supported in TIBCO BPM.
A generalization connects two classes, and it indicates that one of the two classes is a more general form
of the other. Another way of describing it is that the more specialised class is a derived version of the
more general class. In this procedure you will add two classes that represent specific types of claim and
are thus derived from the more general Generic Claim class.
Both will inherit the properties of Generic Claim, including the claimSummary, claimDescription and
claimAmount attributes. You will also add an additional attribute to one of the new classes.
Procedure
1. Create a new class within the claim package. Name it No Fault Claim.
You may find it helpful to enlarge the claim package in the diagram. You can do this by
selecting it and dragging the handles that appear at the sides and corners.
2. Add an attribute to the new No Fault Claim class. Name it confirmation and accept the default
Text type.
3. Select the Generalization tool (in the Relationships tool group on the palette).

TIBCO Business Studio Tutorials

49

4. Drag the pointer from the NoFaultClaim class to the GenericClaim class. This creates the
generalization. Note that the General tab in the Properties view indicates the classes linked by the
generalization.

A fault claim differs from a no-fault claim in that a third party, the counterparty, is involved.
5. Create a second class called Fault Claim connected to Generic Claim by a generalization in the
same way as No Fault Claim.
6. Create an attribute, of the default type Text, as described in Creating a Class and its Attributes,
within the Fault Claim class. Call it counterParty.
Both No Fault Claim and Fault Claim inherit the attributes of Generic Claim. Fault Claim also has
the additional attribute counterParty, which No Fault Claim does not possess. Similarly, only No
Fault Claim has the attribute confirmation.
Result
For more information, see "Creating Connections" in the "Tasks" chapter of the TIBCO Business Studio
Modeling Users Guide.

Creating a Composition
A composition connects two classes, and it indicates that one of the two classes contains the other.
In this task you create a new class that is related by composition to your existing class.
Procedure
1. Create a class named Claimant inside the claim package.
2. Create attributes of name and address, both of type Text, within Claimant.
3. Select the Composition tool (in the Relationships tool group on the palette).
TIBCO Business Studio Tutorials

50

4. Click on GenericClaim and drag the pointer to Claimant.


This creates the composition.
The General tab of the Properties view indicates the direction of the Composition.

Each claim must have at least one claimant, but could have more than one.
5. To specify possible number of claimants, select the multiplicity attribute (the figure 1) at the
claimant end of the composition.
The Properties view for the attribute is displayed.
6. Select the 1 in the Multiplicity field.
The lightbulb icon is displayed, indicating that content assistance is available.

TIBCO Business Studio Tutorials

51

7. Type Ctrl+space to see a content assistance menu listing the possible values.

8. Select, or type, 1..* to replace the multiplicity value. This indicates that there must be at least one
claimant, but can be more.
The following steps create another class, also with composition but with different multiplicity.
9. Create a class named Witness inside the claim package. Create name and address attributes as for
Claimant.
10. Connect Witness to Generic Claim using a composition exactly as described.
11. Not all claims have witnesses. Therefore, specify the multiplicity attribute at the witness end of the
composition as *. This means there can be zero or more witnessesany number.

Verifying the Results of "How to Create Business Data"


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the EasyAsCreateBusinessDataSolution.zip file, in the location where you installed TIBCO
Business Studio (for example, <STUDIO_HOME>\studio\3.n\samples).
2. In TIBCO Business Studio, select File > Import.
The Import wizard is displayed.
3. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click Browse.
5. Browse to EasyAsCreateBusinessDataSolution.zip and click Open.
The EasyAsCreateBusinessDataSolution project is displayed in the Import wizard.
6. Click Finish.
The EasyAsCreateBusinessDataSolution project is installed in your workspace.

How to Use Business Data


This tutorial shows you how to take business data that you have created in TIBCO Business Studio and
use it in a simple business process. It describes how to create fields that reference business objects,
assign them to tasks in the process, and automatically generate forms.
You should work through each section in turn to complete the tutorial.

TIBCO Business Studio Tutorials

52
Before you start this tutorial:

You can become familiar with TIBCO Business Studio by completing the initial WelcomeUsers
tutorials.

You should have completed the How to Create Business Data tutorial.

Post Requisite
After completing this tutorial, you can:

Install the solution to this Tutorial and compare it with your version. See the instructions in
Verifying the Results for how to do this.

Optionally, you can assign participants to the user tasks. This is necessary if you want to deploy and
run the process.

1.

Install an organization model. You can import the solution to the How to Add Groups, Capabilities
and Privileges to an Organization Model tutorial, installing the EasyAsExtendedOMSolution
project as described in that tutorial.

2.

Assign a position in the organization model as the participant for each of the user tasks. The
Create, Deploy, and Run Your First BPM Application tutorial describes how to do that.

3.

If you wish, you can then deploy the project, as described in the How to Implement and Deploy the
Welcome Users Application tutorial for deploying the WelcomeUsers project.

Follow on with the other related tutorials.

Use the "For More Information" links in this chapter to explore particular topics in more details.

Opening the Business Object Model


A project is the basic container that you use to store all the artifacts needed by your business processes,
including the business object model.
If you are continuing this tutorial directly from the previous one, the EasyAs Business Data project and
the business object model diagram editor will already be open. If so, skip this procedure and go on to
the next one.
Following this tutorial will be simpler and clearer if you close any other projects that you may have
open in your TIBCO Business Studio workspace, using the Project > Close Project menu option. This
includes closing the solution to the Create Business Data tutorial, if you have imported that.
Procedure
1. Start Studio for Designers.
2. TIBCO Business Studio opens the projects that you had open when you quit your previous session,
so the EasyAs Business Data project and the business object model it contains may open
automatically.
3. If it does not, in the Project Explorer expand EasyAs Business Data > Business Objects >
EasyAsBusiness Data.bom .
4. Double-click on EasyAsBusiness Data.bom. The business object model diagram editor opens,
showing that business object model.
Result
For more information, see:

the How to Create Business Data tutorial

"Introduction" in the "Tutorial" chapter of the TIBCO Business Studio Modeling Users Guide
TIBCO Business Studio Tutorials

53

Defining a Business Process


In this task you will define the business process that will make use of the business data in your business
object model.
When you created the EasyAs Business Data project in the How to Use Business Data tutorial, you
specified in the Asset Type Selection dialog that the project should include:

The business object model,

Business processes,

Forms.

You can refer to the tutorial How to Design a Simple WelcomeUsers Process for details of how to create
tasks and connections in your business process.
You will define a simple business process, as shown in the following illustration.

Procedure
1. If the Process Editor is not already open, expand EasyAs Business Data > Process Packages >
EasyAs Business Data .xpdl > EasyAsBusinessData(EasyAsBusinessData) > > Processes >
EasyAsBusinessData > -Process , and double-click on EasyAsBusinessData-Process to open the
Process Editor.
2. Select EasyAsBusinessData-Process in the Project Explorer and press F2 to rename it. Change the
label of the process to Notification of Claim.
3. At this stage the process is empty. It contains only a Start event, an End event, and a sequence flow
between them.
Select the User Task tool from the palette. Position the mouse pointer over the sequence flow
between the Start and End events, then click to add the first user task.
4. Change the label of the task to Specify claim type.

TIBCO Business Studio Tutorials

54

5. After the Specify claim type task, the flow of the process proceeds differently depending on
whether a Fault claim or a No-fault claim is being made. This is indicated by adding a gateway to
the diagram. Select the Exclusive Data-Based Gateway tool from the palette. Position the mouse
pointer over the sequence flow in the Process Editor, to the right of the Specify claim type Task,
and click.

6. Click the gateway to select it and change the label to Fault claim?.
7. On the canvas of the editor, to the right of the gateway, add two more User Tasks called Record
fault claim details and Record no-fault claim details.
8. Add a second gateway, of the same type as the first, in the sequence flow near the End event.
9. Note that if you positioned the second gateway correctly (by placing the mouse pointer exactly over
the sequence flow and clicking), the part of the sequence flow that runs between the two gateways
is now a separate connection. Right-click on it and select Delete.
10. Select the Default Flow tool from the Connections drawer of the palette, and use it to create a
connection from the Fault claim? gateway to the Record no-fault claim details task. Label this
connection No, because this is the sequence of processing when the answer to the question Fault
claim? is No.
11. Select the Conditional Flow tool and draw a connection from the gateway to the Record fault claim
details task. Label this connection Yes.
12. Complete the processing sequence by adding sequence flow connections from each of these two
User Tasks to the second gateway.
Result
There is an error symbol associated with the conditional sequence flow. This is because there is as yet
no script to define the condition that needs to be satisfied to make the flow of processing follow this
branch. You will create this in the next procedure.
There are error symbols associated with all three user tasks. This is because user tasks need to have a
Participant assigned to them in order to run. You do not need to assign Participants as part of this
tutorial, though you would need to do so in order to test and run it.
For more information, see the How to Design a Simple WelcomeUsers Process tutorial.

Saving the Process


Save the process you have just created.
Select File - > Save , click Ctrl+S, or click on the disk icon

You can also save your process at any point while you are creating or editing it. If there are unsaved
changes, an asterisk is displayed in the title of the Process Editor, and also next to the process package
in the Project Explorer view.
It is advisable to save after completing each procedure.

TIBCO Business Studio Tutorials

55

Creating and Using a Conditional Script


In this task you will define how the flow of processing is determined.
The flow of processing branches at the Fault claim? gateway depending on whether a fault claim or a
no-fault claim is being made. You will create a data field isFault which, if set to True (meaning that the
claim is a fault claim), directs the flow down the conditional flow connection to the Record fault claim
details task.
(If the field is set to False (meaning that the claim is not a fault claim), processing thus follows the
default flow connection to the Record no-fault claim details task.)
Procedure
1. In the Project Explorer, right-click Data Fields under the Notification of Claim process.
2. Select New > Data Field .
3. In the New Data Field dialog, name the field isFault and set the type to Boolean.

TIBCO Business Studio Tutorials

56

4. Expand Initial Value(s) and select false.

5. Click Finish.
Now you need to attach a script to the conditional flow.
6. Select the conditional flow object in the Process Editor.
7. In the General tab of the Properties view, select JavaScript from the Script Defined As list.

8. In the Define Sequence Flow Condition field, type:


isFault==true;

(Note that you need two "=" characters.)

Defining Data Fields that Reference Business Objects


A data field that defines its type by reference to a class in a business object model has sub-fields that
represent the attributes of that class.
In this task you will define data fields that reference business objects, in order to add business data to
the process.
Define a field that references the FaultClaim class in the business object model.
Procedure
1. In Project Explorer, expand to the Data Fields entry under Processes > Notification of Claim .
2. Right-click on Data Fields and select New > Data Field .
3. In the New Data Field dialog, change the label from the default Field to Fault Claim Data.

TIBCO Business Studio Tutorials

57

4. Under Type, select BOM Type. The Reference field is displayed.

TIBCO Business Studio Tutorials

58

5. Click
next to Type. In the Select Type dialog, select the FaultClaim class from the business
object model and press OK.

6. Press Finish in the New Data Field dialog to complete adding the new field.
7. Define a second field referencing the NoFaultClaim class in the business object model.
8. Name the new field No Fault Claim Data.
Result

For more information, see the How to Design a Simple WelcomeUsers Process tutorial.

Assigning the Data Fields to User Tasks


Once you have defined the data fields, you need to assign them to the appropriate user tasks.

TIBCO Business Studio Tutorials

59

Procedure
1. From Project Explorer, drag and drop your new No Fault Claim Data field onto the Record nofault claim details user task.
2. A popup menu is displayed. Click Add Data To Assign on the menu. This defines the field as one
that the user can complete when the work item is displayed.
3. You can confirm the field assignment by looking at the Interface tab of the Properties view for the
user task. The field is listed as available data for this task.

4. Assign the Fault Claim Data field to the Record fault claim details task as you did for No Fault
Claim Data field.
5. Assign the isFault field to the Specify Claim Type task in the same way.

Generating Forms for the User Tasks


Once you have assigned a data field to a task, you can generate a form for that task. This provides fields
in which the user can enter data, or in which data can be displayed. The form automatically contains
fields corresponding to each of the sub-fields belonging to the data field assigned to the task.
In this case, that means that the form will contain a field for each attribute of the appropriate Class in
the business object model.
In this task you automatically generate forms for two user tasks.
Procedure
1. Select the Record no-fault claim details task.

TIBCO Business Studio Tutorials

60

2. In the General tab of the Properties view, select the Form button in the right-hand pane. The Open
Form warning dialog is displayed.

3. The warning indicates that any subsequent changes you make, for instance assigning more fields to
the same task, will not be reflected in the form. You can optionally check the box so that the
warning is not shown again. Press OK on the Open Form dialog.
The address of the form is displayed

TIBCO Business Studio Tutorials

61

4. Click Open Form to view the form.

Note that the form displays a field for each attribute of the class. It has default Cancel, Close and
Submit buttons as runtime controls.
If you click the GWT Preview tab, you can see a preview of the runtime appearance of the form as
defined by the Google Web Toolkit.
5. Edit the form as follows. Select the claimant field. Details of the field are displayed in the Properties
view.

TIBCO Business Studio Tutorials

62

6. On the General tab, enter Details of Claimant in the Label field.

7. Repeat steps 5 and 6 for the witness field. Note that the form now displays the amended labels for
these two fields.

8. Repeat steps 1 to 7 for the Record fault claim details task. When you compare the two forms, note
that they contain most of the same fields. The form for Record fault claim details additionally
includes a Counterparty field, corresponding to the additional attribute of the FaultClaim class in
the business object model.

TIBCO Business Studio Tutorials

63

9. Repeat steps 1 to 4 again to generate a form for the Specify Claim Type task. This contains only one
field, for the isFault data field.
For more information about forms, see the Forms documentation.
You have now completed this tutorial.
You should now be familiar with:

Defining data fields that reference business objects.

Assigning those fields to tasks in a business process.

Generating the associated forms.


Verifying the Results

You can verify the results of your tutorial by installing the tutorial from the samples folder in the product
directory. Your project must look similar to the sample solution project.
10. Find the easyasusebusinessdatasolution.zip file, in the location where you installed TIBCO
Business Studio (for example, <STUDIO_HOME > \studio\3. n\samples).
11. In TIBCO Business Studio, select File > Import .
12. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
13. Click Select archive file, and click on the Browse button.
14. Browse to easyasusebusinessdatasolution.zip and click Open. The easyasusebusinessdatasolution
project is displayed in the Import wizard.
15. Click Finish. The easyasusebusinessdatasolution project is installed in your workspace.
In this solution project, a Participant has been defined by reference to the
EasyAsExtendedOMSolution organization model, as described in How to Use Business
Data. An error will be displayed unless you have the EasyAsExtendedOMSolution
project open in your workspace.

Verifying the Results of "How to Use Business Data"


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the easyasusebusinessdatasolution.zip file, in the location where you installed TIBCO
Business Studio (for example, <STUDIO_HOME>\studio\3.n\samples).
2. In TIBCO Business Studio, select File > Import.
The Import wizard is displayed.
3. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click Browse.
5. Browse to easyasusebusinessdatasolution.zip and click Open.
The easyasusebusinessdatasolution project is displayed in the Import wizard.

TIBCO Business Studio Tutorials

64

6. Click Finish.
The easyasusebusinessdatasolution project is installed in your workspace.
In this solution project, a Participant has been defined by reference to the
organization model, as described in How to Use Business
Data. An error will be displayed unless you have the EasyAsExtendedOMSolution project
open in your workspace.
EasyAsExtendedOMSolution

TIBCO Business Studio Tutorials

65

Using the Organization Modeler


How to Use the Graphical Organization Modeler
This tutorial shows you how to use TIBCO Business Studio to create and populate an Organization
Model.
This tutorial demonstrates:

Creating an Organization Model in a new project

The use of the Organization Editor, one of the two diagram editors provided in Organization
Modeler

Creating the basic Organization Model entitiesOrganizations, Organization Units and Positions
and assigning properties to them

Creating relationships between the Organization Units

Before you start this tutorial, you can become familiar with TIBCO Business Studio by completing the
initial Create, Deploy and Run your First BPM Project tutorials.
After completing this tutorial, you will be familiar with:

Using the graphical Organization Editor

Creating Organization Modeler entities using the tools in the palette, or by copying and pasting.

Creating a New Project


A project is the basic container that you use to store all the artifacts needed by your business processes.
This includes the organization model.
Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. Select File > New > Analysis Project .
3. In the New Analysis Project dialog, enter EasyAsSimpleOrgModel as the Project name field.
4. Check BPM in the Destination Environments field and click Next.

TIBCO Business Studio Tutorials

66

5. In the Asset Type Selection dialog, uncheck the BPM checkbox, and uncheck the boxes under
Business Objects except for Organization Model.
Ensure that Organization Model is still selected. Click Next.

6. The Organization Model dialog is displayed.

7. Click Finish to accept the default values.


8. The EasyAsSimpleOrgModel project is created and is displayed in the Project Explorer.

TIBCO Business Studio Tutorials

67

9. You can expand your view of the project to see the organization model that it contains. The
organization model must be in a special folder. By default it is created in the Organization folder
within your project.
Result

For More Information, see "Creating an Organization Model" in TIBCO Business Studio Modeling Users
Guide.

Using the Organization Editor


There are two diagram editors - the Organizational Editor and the Organizational Model Editor.
You will open the Organization Editor during this tutorial. However, the Organization Model Editor is
a higher-level editor, and you only need it if your model contains more than one Organization. You will
not need to open it in this tutorial.
Procedure
1. The Organization Editor is automatically displayed. It shows the default Organization, called
simply Organization1, which was created as part of the Organization Model. At the moment, that
Organization1 is empty:

2. The General tab of the Properties view for the organization is visible.
If it is not, right-click on the empty part of the Organization Model diagram and select
Show Properties View.

TIBCO Business Studio Tutorials

68

3. In the Label field on the General tab, type EasyAs. Press Enter, or click anywhere else on the screen,
and this new label is displayed in the badge of the organization.

Setting the Version


You will now set the version of the organization model.
By default a newly-created organization model is assigned a version of 1.0.0.qualifier. If you have
completed the initial WelcomeUsers tutorials, you will already have deployed an organization model
with that version number to TIBCO BPM. To prevent any conflict, you will now change the version
number of the EasyAsSimpleOrgModel projects organization model.
Procedure
1. In the Organization Editor, click on the small arrow icon in the label of the EasyAs organization,
next to the organization name.

This opens the Organization Model Editor. Note that this editor shows only a simplified version of
the EasyAs Organization.

TIBCO Business Studio Tutorials

69

2. In the Properties view for the Organization Model, on the General tab, change the Version to
2.0.0.qualifier.

Note that a problem marker


displays on the organization model label, because the version of the
organization model no longer matches the version of the project. To reconcile these, right-click on
the EasyAsSimpleOrgModel project in Project Explorer, and select Properties.
3. In the Properties dialog, select Lifecycle.
4. Change the Version to 2.0.0.qualifier and press OK.

Saving the Organization Model


Save the organization model.
Select File > Save , press Ctrl+S, or click on the disk icon

You can also save your organization model at any point while you are creating it. If there are unsaved
changes, an asterisk is displayed in the title of the Organization Editor, and also next to the
organization model in the Project Explorer view.

It is advisable to save after completing each procedure.

TIBCO Business Studio Tutorials

70
For More Information, see "Creating an Organization Model" in TIBCO Business Studio Modeling Users
Guide.

Creating Organization Units


An Organization Unit represents any grouping of resources in your organization, such as a department,
a project or a particular office. You can have any number of organization units within an organization,
and you can indicate their relationships with each other.
Procedure
1. Click on the EasyAs tab to switch to the Organization Editor.
2. In the Organization Editor, select the Organization Unit tool in the Organization Modeler palette.

3. Drag it on to the empty part of the Organization diagram and drop it. This places an Organization
Unit in the EasyAs organization.

TIBCO Business Studio Tutorials

71

4. The Label field of the new Organization Unit is automatically selected at this point. Type Claims
Department into the selected field and press Enter. You will see that this is automatically reflected
in the Label and Name fields on the Properties tab.
Components of the organization model have both a Name and a Label. A Label can
contain spaces or non-alphanumeric characters. The Name is generated automatically
from the Label, but strips out any spaces or non-alphanumeric characters. Note in this
example that "Claims Department" is converted to "ClaimsDepartment" with no space.

Business analysts use a Label to identify an object, while the Name is used internally, for
example when implementing a script.
5. In the same way, add Life Claims as a second Organization Unit within EasyAs.
Result
For More Information, see:

"Hierarchy and Association" in TIBCO Business Studio Modeling Users Guide.

"Organization Unit" in TIBCO Business Studio Modeling Users Guide.

Creating Positions
Positions represent responsibilities within the Organization, not the actual people that fill them.
Positions are placed within Organization Units.
Procedure
1. Select the Position tool in the Organization Modeler palette, and drag it into the Life Claims
Organization Unit.

TIBCO Business Studio Tutorials

72

2. Rename the Position in the same way that you renamed the Organization Units. Call this Position
Life Claims Manager.
3. Add another Position within Life Claims and call it Customer Service Representative (Life).
4. If the Properties View is not already visible, right-click Customer Service Representative (Life)
and select Show Properties View.
5. In the Number field on the General tab, enter 10 instead of the default 1. This indicates that ideally
there should be ten customer service representative positions filled in the organization unit.

Runtime Behavior
The Number field indicates an ideal number; it has no effect at runtime.
Result
For More Information, see "Positions" in TIBCO Business Studio Modeling Users Guide.

Copying and Pasting Organization Units


In this step you will add further organization units and positions to the organization model by copying
and pasting.
Procedure
1. Select the Life Claims Organization Unit.
TIBCO Business Studio Tutorials

73

2. Right-click it, and select Edit > Copy .


3. Right-click on a blank section of the Organization Editor canvas and select Edit > Paste . This creates
a new organization unit, containing the same positions that you created inside Life Claims.

4. Rename the new Organization Unit Motor Claims.


You can rename an object quickly by selecting it and pressing F2.
5. Rename the positions in the Motor Claims unit Motor Claims Manager and Customer Service
Representative (Motor).
6. Paste the copied Organization Unit again. Change its name to Household Claims and change the
position names accordingly.

Creating Hierarchical Relationships


In this step you will connect the existing organization units into a hierarchy.
Procedure
1. Select the Claims Department Organization Unit.
2. Select the Hierarchy tool from the Links drawer of the Organization Modeler palette.
3. Click and hold on Claims Department and drag to the Life Claims Organization Unit. An arrow
appears linking the two Organization Units, to indicate that they are in a hierarchical relationship.
4. Repeat this step to add Hierarchy links between Claims Department and the other two
Organization Units, Motor Claims and Household Claims.

TIBCO Business Studio Tutorials

74

5. Depending exactly where on the canvas your Organization Units are positioned, the result may
look untidy, as in this example.

6. To tidy the diagram up, right click on the background and select Arrange All. The diagram is rearranged as shown in the following illustration.

Creating an Association
In this step you will create another organization unit and connect it to your existing hierarchy using an
Association.
An Association is another type of link. It is used to denote a non-hierarchical connection, and is visually
differentiated from a Hierarchy.
Procedure
1. Create another organization unit and rename it Test Department.
2. Create Positions in Test Department and name them Test Manager and Tester.
3. Select the Test Department Organization Unit.
4. Select the Association tool from the Links drawer of the Organization Modeler palette.

TIBCO Business Studio Tutorials

75

5. Click and hold on Test Department and drag to the Claims Department Organization Unit. A
broken line appears linking the two Organization Units, to indicate that they are associated in a
non-hierarchical relationship.

6. Select File > Save , press Ctrl+S, or click on the disk icon
model.

to save the completed organization

What to do next
After completing this tutorial, you can:

install the solution to this Tutorial and compare it with your version. See the instructions in
Verifying the Results for how to do this.

follow the How to Add Groups Capabilities and Privileges to an Organization Model tutorial,
which describes how to enhance an organization model with items that help allocate responsibilities
and workflow.

use the "For More Information" links in this chapter to explore particular topics in more details

Verifying the Results


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the EasyAsSimpleOMSolution > .zip file, in the location where you installed TIBCO Business
Studio (for example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
The Import wizard is displayed.
3. Select General > Existing Studio Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to EasyAsSimpleOMSolution > .zip and click Open.
The EasyAsSimpleOMSolution project is displayed in the Import wizard.
6. Click Finish.
The EasyAsSimpleOMSolution project is installed in your workspace.

TIBCO Business Studio Tutorials

76

How to Add Groups Capabilities and Privileges to an Organization Model


This tutorial shows you how to use some additional facilities of TIBCO Business Studios Organization
Modeler.
This tutorial demonstrates:

Creating Groups

Creating Capabilities and Privileges

Assigning them to Positions and Groups

Before you start this tutorial, you can become familiar with TIBCO Business Studio by completing the
initial Create, Deploy and Run your First BPM Project tutorials.
In addition:

You should have completed the How to Use the Graphical Organization Modeler tutorial.

You should have available an appropriate node to deploy the Organization Model to.

After completing this tutorial, you will be familiar with:

how to create Groups, Capabilities, and Privileges

how to assign them to organization model entities

Opening the Organization Model


A project is the basic container that you use to store all the artifacts needed by your business processes,
including the organization model.
If you are continuing this tutorial directly from the previous one, the EasyAsSimpleOrgModel project
and the Organization Editor will already be open. If so, skip this procedure and go on to the next one.
Following this tutorial will be simpler and clearer if you close any other projects that you may have
open in your TIBCO Business Studio workspace, using the Project > Close Project menu option.
Procedure
1. Start Studio for Designers.
2. TIBCO Business Studio opens the projects that you had open when you quit your previous session,
so the EasyAsSimpleOrgModel project and organization model may open automatically.
3. If it does not, in the Project Explorer expand EasyAs > Organization > EasyAs OrganizationModel
> Organizations > EasyAs .
4. Double-click on the EasyAs Organization. The Organization Editor for that Organization opens.
Result
For More Information, see:

How to Use the Graphical Organization Modeler tutorial

"About the Organization Model Diagram Editors" in TIBCO Business Studio Modeling Users Guide

TIBCO Business Studio Tutorials

77

Creating a Group
A group represents a type of job within your enterprise, grouped by the characteristics of the job.
Groups can have Capabilities and Privileges that help to allocate work to a group of people with a
specific set of skills.
Groups can contain other Groups. Otherwise, the membership of Groups is not handled within
Organization Modeler. Users are assigned to groups at runtime using the Organization Browser in
TIBCO Workspace.
Procedure
1. In the Project Explorer pane at the left-hand side of the window, expand the EasyAs project so that
you can see Groups.
2. Right-click on Groups and select Add Child > Group .

A group called Group1 is created.


3. Right-click on Group1 and select Rename. Call the group Managers.
4. If you switch to the organization model editor, you can see that groups are displayed in the
organization model diagram.
Result

For More Information, see "Group" in "Concepts and Definitions" in the TIBCO Business Studio Modeling
Users Guide.

TIBCO Business Studio Tutorials

78

Saving the Organization Model


Save the organization model.
Select File > Save , press Ctrl+S, or click on the disk icon

You can also save your organization model at any point while you are creating it. If there are unsaved
changes, an asterisk is displayed in the title of the Organization Editor, and also next to the
organization model in the Project Explorer view.

It is advisable to save after completing each procedure.

Creating Capabilities
Capabilities represent the skills that are available within your enterprise. They can be assigned to
Groups or Positions, representing the skills needed to carry out the responsibilities of that Group or
Position.
You can add extra information about a Capability by assigning a Qualifier. For example, you may have
created a Capability that represents an exam qualification but for a particular Position you may want to
qualify that Capability by specifying a grade as well.
Procedure
1. In the Project Explorer, expand the EasyAs project as far as Capabilities.
2. Right-click on Capabilities and select Add Child > Capability . A Capability (named Capability1)
is created.
3. Right-click on Capability1 and select Rename. Call the Capability In-house Management Training.
The following illustration shows the appearance of the Properties view for the new Capability.
Result

For More Information, see "Capability and Privilege" in "Concepts and Definitions" in the TIBCO
Business Studio Modeling Users Guide.

TIBCO Business Studio Tutorials

79

Assigning Capabilities
Once you have created a Capability, you can assign it to Positions and to Groups.
For More Information, see "Capability and Privilege" in "Concepts and Definitions" in the TIBCO
Business Studio Modeling Users Guide.
Assigning Capabilities to Positions
You can assign Capabilities to positions. TIBCO BPM will use these capabilities in defining the
positions at runtime.
Procedure
1. In the Organization Editor diagram, select the Manager position in the Motor Claims Organization
Unit.
2. Click the Capabilities - Assigned tab in the Properties view.
3. Click

to display the Select Type dialog.

4. From the Matching Items box, select In-house Management Training and click Add, then click
OK. The In-house Management Training capability is added to the Manager position.
This means that the In-house Management Training capability is a requirement for the
Manager position: any user occupying this position is expected to have received this
training.
5. Similarly, select the Manager positions in the Life Claims, Household Claims and Test
Department Organization Unit, and add the same Capability to them.
Assigning Capabilities to Groups
You can assign Capabilities to Groups. TIBCO BPM will use these capabilities in defining the Group at
runtime.
Procedure
1. In the Project Explorer, select the Managers Group that you created earlier.
2. Click the Capabilities - Assigned tab in the Properties view.
3. Add the In-house Management Training capability following the same steps that you used to
assign it to Positions.

Creating Privileges
Privileges represent the authority that an Organization Unit, Position or Group can have within an
organization, such as the authority to approve expenditure.You can add extra information about when
a Privilege applies by assigning a Qualifier.
Procedure
1. In the Project Explorer pane at the left-hand side of the window, expand the
EasyAsSimpleOrgModel project so that you can see Privileges.
2. Right-click on Privileges and select Add Child > Privilege . A Privilege named Privilege1 is
created.
3. Right-click on Privilege1 and select Rename. Call the privilege Authorize Claims.

TIBCO Business Studio Tutorials

80

4. In the Properties view for that privilege, check the Has qualifier checkbox.

When you do so, the Show qualifier... link is displayed.

5. Click on the Show qualifier... link. The Qualifier tab is displayed.

6. In the Label field, enter Approve Claims up to.


7. In the Type field, select Integer from the dropdown list.
8. In the Default Value field, enter 500.
Result

This process creates a privilege to authorize insurance claims up to a given amount. The amount is
specified by the value of the qualifier, which can be specified separately for each Position or
Organization Unit the privilege is assigned to. As a default, if no other value is specified, any Position
or Organization Unit that has this privilege can authorize claims up to $500.
For More Information, see "Capability and Privilege" in "Concepts and Definitions" in the TIBCO
Business Studio Modeling Users Guide.
TIBCO Business Studio Tutorials

81

Assigning Privileges
You can add extra information about a Privilege by assigning a Qualifier. For example, you may have
created a Privilege giving the authority to authorize expenditure, but you can use a Qualifier to specify
what amount a given Position can authorize.
Assigning Privilege to Positions
These privileges apply to only the positions to which they are assigned.
Procedure
1. In the Organization Editor diagram, select the Customer Service Representative (Motor) position
in the Motor Claims Organization Unit.
2. Click the Privileges - Assigned tab in the Properties view.
3. Click

to display the Select Type dialog.

4. From the Matching Items box, select Authorize Claims and click Add, then click OK.
The Authorize Claims privilege is added to the Customer Service Representative (Motor) position.
The value of the Approve Claims up to qualifier is shown as the default value of 500.

5. Similarly, select the Motor Claims Manager position, and add the Authorize Claims privilege.
6. Select the Qualifier Value field and type 20,000 to replace the default value.

TIBCO Business Studio Tutorials

82

7. In the Household Claims Organization Unit, add the Authorize Claims privilege to both Customer
Service Representative (Household) and Household Claims Manager. Change the value of the
qualifier for the Manager to 1,000,000.
Assigning Privileges to Organization Units
These privileges will apply to all the Positions in that Organization Unit.
Note that the Privilege will not be displayed on the Privileges tabs of these Positions, only on that of
the Organization Unit.
Procedure
1. In the Organization Editor diagram, select the Life Claims Organization Unit.
2. Click the Privileges - Assigned tab in the Properties view.
3. Click

to display the Select Type dialog.

4. From the Matching Items box, select Authorize Claims and click Add, then click OK. The
Authorize Claims privilege is added to the Life Claims Organization Unit.
5. Select the Qualifier Value field and type 5,000,000 to replace the default value.

Updating the Version


You will now update the version of the organization model.
By default a newly-created organization model is assigned a version o f 1.0.0.qualifier. In the How to
Use the Graphical Organization Modeler tutorial, you set the version of the organization model to
2.0.0.qualifier.
You will now change the version number to 2.1.0.qualifier. Leaving the major version number
unchanged but changing the second digit will cause this version of the model, when deployed, to
update the existing version 2.0.0.qualifier organization model.
Procedure
1. In the Organization Editor, click on the small arrow icon in the label of the EasyAs organization,
next to the organization name.

2. This opens the Organization Model Editor. Note that this editor shows only a simplified version of
the EasyAs Organization.

TIBCO Business Studio Tutorials

83

3. In the Properties view for the Organization Model, on the General tab, change the Version to
2.1.0.qualifier.

4. Right-click on the EasyAsSimpleOrgModel project in Project Explorer, and select Properties.


5. In the Properties dialog, select Lifecycle.
6. Change the Version of the project to 2.1.0.qualifier and press OK.
Result
For More Information, see "Capability and Privilege" in "Concepts and Definitions" in the TIBCO
Business Studio Modeling Users Guide.

Deploying the Organization Model


Save the organization model that you have created.
You have now completed the tutorial.
Make sure you have saved any changes. Select File > Save , press Ctrl+S, or click on the disk icon

Procedure
To deploy the completed organization model, follow the procedure in the How to Implement and
Deploy the WelcomeUsers Application tutorial for deploying the "Welcome Users" project. Either:

Deploy the EasyAsSimpleOrgModel project to the same deployment server as used in that
tutorial, or

Follow the instructions in that tutorial for creating and connecting to a deployment server, and
deploy the EasyAsSimpleOrgModel project to that deployment server.

Result
Now you can:

install the solution to this Tutorial and compare it with your version. See the instructions in
Verifying the Results for how to do this.

follow on with the other related tutorials.

use the "For More Information" links in this chapter to explore particular topics in more details.
Verifying the Results

You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
1. Find the EasyAsExtendedOMSolution.zip file, in the location where you installed TIBCO Business
Studio (for example, <STUDIO_HOME > \studio\3. n\samples).

TIBCO Business Studio Tutorials

84

2. In TIBCO Business Studio, select File > Import .


The Import wizard is displayed.
3. Select General > Existing Studio Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to EasyAsExtendedOMSolution.zip and click Open.
The EasyAsExtendedOMSolution project is displayed in the Import wizard.
6. Click Finish.
The EasyAsExtendedOMSolution project is installed in your workspace.
Note that this solution project includes some extra elements - such as groups and
capabilities - which you did not create during this tutorial. These are for use in other
tutorials which import the EasyAsExtendedOMSolution project as a starting point.

TIBCO Business Studio Tutorials

85

Assigning Work
How to Ensure that a Sequence of Tasks is Performed by the Same User
Chained execution means that when a user submits one work item, they are immediately presented
with the next work item in the chained sequence. The user must be included in the definition of the
participants assigned to each of the user tasks identified for chained execution.
For example, if a user is a member of an organization that is assigned as the participant for Task1, and
is also a member of a group assigned as a participant for Task2, that user is assigned both work items in
turn, although the participants defined for the two tasks are different.
This tutorial shows you how to assign a sequence of tasks to the same user. This is known as chained
execution.
Before you start this tutorial, you can become familiar with TIBCO Business Studio by completing the
following initial tutorials:

How to Design a Simple WelcomeUsers Business Service

How to Implement and Deploy the WelcomeUsers Application

Importing the Initial Resources


This tutorial supplies a project as the starting-point, so that the initial work, not relating to chained
execution, is already done for you. It also requires an organization model, which you may have created
and deployed in earlier tutorials.
If not, you can import and deploy it now.
Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. To import the ChainingStart project into your workspace, find the ChainedStart.zip file in the
location where you installed TIBCO Business Studio (for example, <STUDIO_HOME > \studio\3. n
\samples)..
3. In TIBCO Business Studio, select File > Import .
4. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
5. Click Select archive file, and click on the Browse button.
6. Browse to the zip file and click Open. The project is displayed in the Import wizard.
7. Click Finish. The ChainingStart project is installed in your workspace.

TIBCO Business Studio Tutorials

86

8. If you have not already done so in a previous tutorial:

Import the EasyAsSimpleOMSolution project into your workspace. This is the organization
model that is referenced by the ChainingStart project that you have imported.

Deploy EasyAsSimpleOMSolution to BPM. The organization model must be deployed before


you start to deploy the ChainingStart project (see Deploying and Running the Process) or
deployment will fail.
Deploying this project is similar to the deployment of the WelcomeUsers project
described in the Create, Deploy, and Run Your First BPM Application tutorials.

Mapping a Participant to an Organization Model


First you will map the Participant Process Tester, which is used by the user tasks in ChainingStart, to a
position in the imported organization model.
Procedure
1. In Project Explorer, expand the ChainingStart project as far as the WelcomeUsersChained process,
and double-click on that process. It is displayed in the Process Editor (at the top centre of the
screen).

2. Select the Display Message user task. On the General tab in the Properties view, note that the task
is assigned to the Participant Process Tester.

TIBCO Business Studio Tutorials

87

3. In the Project Explorer view of the ChainingStart project, expand Participants at the process
package level (you may need to expand the process packages as well). You can see that the Process
Tester participant is already defined. Both in Project Explorer and on the General tab in the
Properties view, an error indicator displays. This is because the Process Tester participant does not
refer to an organization model in your workspace.

On the General tab in the Properties view for Process Tester select External Reference and click
. In the Select Type dialog, select the position Tester in the organization model, and then OK.

The user task is still assigned to the Participant Process Tester, but that participant is now mapped
to the position Tester in the EasyAsSimpleOMSolution organization model.
4. Now add another participant to the WelcomeUsersChained process. Right-click on Participants in
Project Explorer, and select New > Participant , and name the participant Process Manager.
5. You can now map this participant to the Test Manager position in the Organization Model using
the method you used in step 4.

TIBCO Business Studio Tutorials

88

6. Press CTRL + S to save the changes you have made.


You can save your work at any point. If there are unsaved changes, an asterisk is
displayed next to the changed organization model or process package in the Project
Explorer view.
It is advisable to save after completing each procedure.

Making Sure a Sequence of Tasks is Performed by the Same User


There will often be occasions when you want one user to take responsibility for seeing a process
through a number of steps, rather than a number of different users being involved. To do this, you need
to link tasks in a chained execution.
Procedure
1. In the Process Editor open the Tasks drawer on the Palette. Click on the User Task icon, and drag
and drop it onto the sequence flow between Display Message and End Event. Call this user task
Send Out Welcome Pack.
2. Add a participant to the Send out Welcome Pack task by opening Participants under the Process
Package in Project Explorer, and selecting Process Tester. Drag and drop this participant onto the
task in Process Editor.
3. Click on the User Task icon in the Palette again, and drag and drop it onto the sequence flow
between Send Out Welcome Pack and End Event. Call this user task Make Follow Up Call to
Customer.
4. Add a participant to the Make Follow Up Call to Customer task by opening Participants under the
Process Package in Project Explorer, and selecting Process Manager. Drag and drop this participant
onto the task in Process Editor.

5. In the Process Editor select the tasks from the Display Message user task to the Make Follow Up
Call to Customer user task.
To make this multiple selection, first select the Display Message user task. Hold down the Ctrl key
and click the other two user tasks, Send Out Welcome Pack and Make Follow Up Call to
Customer, to select them. The tasks you selected will now be outlined in bold.
Alternatively you can select the area containing these three tasks by clicking on the canvas
near the top left corner of the first task. Holding the left mouse button down, drag the
selection area to include all the tasks you want, and then release the mouse button.

TIBCO Business Studio Tutorials

89

6. Right-click any one of the selected objects and select Refactor > Move Into New Embedded SubProcess .

The Refactor As Embedded Sub-Process dialog is displayed.

TIBCO Business Studio Tutorials

90

7. Enter Chained Tasks as the Name for the new sub-process.

8. Click Finish. The selected tasks are now contained within the new Chained Tasks embedded subprocess.

9. Select the Chained Tasks embedded sub-process.


10. On the General tab of the Properties view, select the Chained Execution checkbox.

The Display Message, Send Out Welcome Pack and Make Follow Up Call to Customer user tasks
are now chained together.

TIBCO Business Studio Tutorials

91

11. Press Ctrl + S to save the changes you have made.


You have now completed designing the process. It should look like the following illustration.

Deploying and Running the Process


This tutorial shows you how to deploy the WelcomeUsersChained process.
Deploying this project is similar to the deployment of the WelcomeUsers project described in the Create,
Deploy, and Run Your First BPM Application tutorial. Refer back to that tutorial for more detail on any of
the following steps.
Procedure
1. Connect to your deployment server and deploy the ChainingStart project.
2. If you have not already done so, log into Openspace. Then:

Create an LDAP container, specifying easyAs as the LDAP source.

Map the user Mr Steve Simonsen to both the Tester and Test Manager positions in the
EasyAs organization model that you imported previously in this tutorial.

Map a second user, Mr John Eustace, to the Tester position only.

3. Log into Workspace as Mr John Eustace, with password "tibco123".


4. Start the Request Call Chained business service.
5. On the form which displays in the right-hand pane, press Submit.
6. In your work items inbox, double-click Get Users Name to open the work item. Enter a name and
submit this form.
7. The Display Message task now appears in your Inbox. Double-click to open it and click Submit.
8. Display Message is the first form in the chained sequence, so when you submit it the next form in
the chain (Send Out Welcome Pack) displays immediately, and you do not have to select anything
in your Inbox.

The chained user task (Send Out Welcome Pack) is automatically allocated to the
same user as the first taskJohn Eustacebecause the participant assigned to the
tasks is the same. This overrides whatever distribution strategy is defined. The work
item must be completed by the same user and will not be offered to or allocated to any
other user.

The work item is automatically delivered to the users Inbox and opened. The user
does not have to return to their Inbox to find and open the work item themselves.

9. When you have completed the Send out Welcome Pack task and clicked Submit, note that the next
task, Make Follow Up Call to Customer, is not put into the work list for John Eustace, because he is
not allocated to the Test Manager position.
The Make Follow Up Call to Customer is not allocated to the same user as the previous
two tasks, even though they are chained. This is because John Eustace does not qualify as
the participant assigned to the Make Follow Up Call to Customer task.

TIBCO Business Studio Tutorials

92

10. Log out of Workspace as Mr John Eustace and log back in as Mr Steve Simonsen, the user you
mapped to the Test Manager position. (The password is the same as for John Eustace.)
Note that there is already a work item in Mr Steve Simonsens Inbox, as a result of step 9. You can
complete this later.
11. Start another instance of the Request Call Chained business service.
12. In your work item list, double click Get Users Name to open the work item, fill in a name and
submit the form.
13. The Display Message task for the same work item displays in your Inbox. Double-click to open it
and submit this form.
14. The Send out Welcome Pack form is automatically opened, as it was for John Eustace. Because this
is a chained task following after Display Message, you do not need to select it from the Inbox; it is
presented to you automatically. Click Submit.
15. This time, Make Follow up Call to Customer is also displayed automatically as soon as you submit
Send out Welcome Pack. When you press Submit for this final task, the process is complete.
Although the participant for Make Follow Up Call to Customer is defined differently
from the participant assigned to the earlier tasksdefined as Process Manager not as
Process Testeryou are now logged in as a user who qualifies under both definitions.
Therefore, all of the chained tasks are automatically allocated to the same user.
In your Inbox, you can also see the Make Follow Up Call to Customer task for the work
item that you started earlier as Mr John Eustace, but which John Eustace was not qualified
to complete.
Click

to log out of Workspace.

Verifying the Results


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the ChainedSolution.zip file, in the location where you installed TIBCO Business Studio (for
example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Studio Projects into Workspace , and
click Next.
4. Click Select archive file, and click the Browse button.
5. Browse to the zip file, and click Open.
The project is displayed in the Import wizard.
6. Click Finish.
The project is installed in your workspace.

TIBCO Business Studio Tutorials

93

How to Ensure Specific Tasks in a Process are Performed by Different


Users
This tutorial shows you how to ensure that specific tasks in a process are performed by different users.
Before you start this tutorial, you can become familiar with TIBCO Business Studio by completing the
following initial tutorials:

How to Design a Simple WelcomeUsers Business Service

How to Implement and Deploy the WelcomeUsers Application

Importing the Initial Resources


This tutorial supplies a project as the starting-point, so that the initial work, not relating to separation of
duties, is already done for you. It also requires an organization model, which you may have created
and deployed in earlier tutorials.
If not, you can import and deploy it now.
Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. To import the SODStart project into your workspace, find the SODStart.zip file in the location
where you installed TIBCO Business Studio (for example, <STUDIO_HOME > \studio\3. n\samples).
3. In TIBCO Business Studio, select File > Import .
4. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
5. Click Select archive file, and click on the Browse button.
6. Browse to the zip file and click Open. The project is displayed in the Import wizard.
7. Click Finish. The SODStart project is installed in your workspace.
8. If you have not already done so in a previous tutorial, import the EasyAsSimpleOMSolution file
into your workspace This is the organization model that is referenced by the SODStart project that
you have imported.
9. Deploy EasyAsSimpleOMSolution to BPM. The organization model must be deployed before you
start to deploy the SODStart project (see Deploying and Running the Process) or deployment will
fail.
Deploying this project is similar to the deployment of the WelcomeUsers project described
in the Create, Deploy, and Run Your First BPM Application tutorials.

Making Sure that Specific Tasks are Performed by Different Users


Separation of Duties allows you to specify that different users perform specific tasks in a process.
Procedure
1. In Project Explorer, expand the SODStart project.
2. Open the WelcomeUsersSOD process.

TIBCO Business Studio Tutorials

94

3. In the Process Editor view, where the WelcomeUsersSOD process is displayed, open the Tasks
drawer on the Palette. Click on the User Task icon, and drag and drop it onto the sequence flow
between Display Message and End Event. Name this user task Send out Welcome Pack.

4. In the Process Editor, select the Send out Welcome Pack user task.

5. Add a participant to the Send out Welcome Pack task by opening Participants under the Process
Package in Project Explorer, and selecting Process Tester. You can drag and drop this participant
onto the task in Process Editor.
6. In the Properties view of the task, select the Work Resource tab.

7. Under Separation Of Duties, click the Create new task group button.

TIBCO Business Studio Tutorials

95

8. From the Select Tasks dialog, check that Display Message and Send out Welcome Pack user tasks
are both under the Matching items column. Select Display Message and click Add, which will add
it to Send out Welcome Pack in the Selection column. Press OK to accept this.

9. Press CTRL + S to save the changes you have made.


You have now specified that the user tasks Display Message and Send out Welcome Pack will
appear in different users work lists, but not both in one user's work list. The following will now
appear in the Resources tab for both Display Message and Send out Welcome Pack

Deploying and Running the Process


This tutorial shows you how to deploy the WelcomeUsersSOD process.
Deploying this project is similar to the deployment of the WelcomeUsers project described in the Create,
Deploy, and Run Your First BPM Application tutorial. Refer back to that tutorial for more detail on any of
the following steps.
Procedure
1. Connect to your deployment server and deploy the SODStart project.

TIBCO Business Studio Tutorials

96

2. If you have not already done so, log into Openspace or Workspace, and create an LDAP container,
specifying easyAs as the LDAP source..
3. Map two users to the Tester position in the Easy As organization model that you imported
previously in this tutorial.
4. Log into Workspace as one of the users you mapped to the Tester position.
5. Start the WelcomeUsersSOD business service.
6. In your work item list, double click Get Users Name to open the work item.
TheGet Users Name task is also offered to the other user that you mapped to the Tester
position. You can confirm this by logging in as the other user and viewing the work list.
7. Enter a name and submit the Get Users Name form.
8. The Display Message task is displayed. Click Submit.
9. Note that the next work item (Send out Welcome Pack) is not offered to you.
10. Log into TIBCO Workspace as the other user that you mapped. The Send out Welcome Pack work
item is in the work list.
11. Submit the Send out Welcome Pack form.

Verifying the Results


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the SODSolution.zip file in the location where you installed TIBCO Business Studio (for
example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Studio Projects into Workspace , and
click Next.
4. Click Select archive file, and click the Browse button.
5. Browse to the zip file, and click Open.
The project is displayed in the Import wizard.
6. Click Finish.
The project is installed in your workspace.

How to Dynamically Define Who Gets Work


This tutorial shows you how to dynamically define who gets work. This means that you define criteria
about how work should be assigned, which will be resolved to particular users at runtime.
Before you start this tutorial, you need to become familiar with TIBCO Business Studio by completing
the following initial tutorials:

How to Design a Simple WelcomeUsers Business Service

How to Implement and Deploy the WelcomeUsers Application

After completing this tutorial, you will be familiar with the basic steps involved in creating a
participant with properties that mean it will be resolved dynamically to a relevant user at runtime
according to criteria you define.

TIBCO Business Studio Tutorials

97
You may also wish to complete the following tutorials covering the use of the organization model:

How to Use the Graphical Organization Modeler

How to Add Groups, Capabilities and Privileges to an Organization Model

Creating the Project


You start by creating a project that contains a simple business process.
It is good practice to use a separate organization model rather than to include the model within the
same project as your business processes. Your main project can reference the project containing the
organization model.
Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. If it is not already in your workspace, import a project containing only an organization model called
EasyAsExtendedOMSolution.
To do this:

Find the file, in the location where you installed TIBCO Business Studio (for example,
<STUDIO_HOME > \studio\3. n\samples).

In TIBCO Business Studio, select File > Import .

The Import wizard is displayed. Select General > Existing Projects into Workspace and click
Next.

Click Select archive file, and click on the Browse button.

Browse to and click Open. The EasyAsExtendedOMSolution project is displayed in the


Import wizard.

Click Finish. The EasyAsExtendedOMSolution project is installed in your workspace.

3. Expand this organization model. You will see that it contains a group called Customer Services
Representatives, and a Capability called French Speaker.
4. Create a new Analysis project:
a) Select File > New > Analysis Project .
b) Name the project ManageCustomerEnquiries.
c) Select BPM as the Destination Environment, and click Next.
d) On the Asset Type Selection page, deselect Business Object Model and Organization Model.
e) Click Finish.

TIBCO Business Studio Tutorials

98

5. Rename the business process in your new project by expanding Process Packages to the Process
level, right-clicking on ManageCustomerEnquiries-Process, and selecting Rename. Name your
process French Customer Services.

6. Now enable your project to reference the project containing the organization model. To do this
right-click on the ManageCustomerEnquiries project in Project Explorer, and select Properties.

TIBCO Business Studio Tutorials

99

7. Select Project References, and from the list of references available, select
EasyAsExtendedOMSolution and click OK. This means that you will be able to reference the
organization model in this project from the ManageCustomerEnquiries project.

8. In the Process Editor view, where the French Customer Services business process is displayed, open
the Tasks drawer on the Palette. Click on the User Task icon, and drag and drop it onto the
sequence flow between Start Event and End Event. Name this user task Complete product enquiry
form.
9. Create a second user task and name it Issue response to customer.

TIBCO Business Studio Tutorials

100

10. Add data fields to the process:


a) Expand the French Customer Services process in Project Explorer, and click on Data Fields.
b) Click the plus sign
at the right of the Properties view.
c) Click in the Label column and change the label from the default Field to Customer Name. Leave
the Type as the default Text.
d) From Project Explorer, drag and drop the Customer Name data field onto the Complete product
enquiry form task. A popup menu is displayed.
e) Click Add Data To Assign. This defines the field as one that the user can complete when the
work item is displayed.
f) Again from Project Explorer, drag and drop the Customer Name data field onto the Issue
response to customer task. This time, click Add Data To View. The field, which the user
completes in the previous task, becomes data input to this task.
g) Now create another data field of type Text, giving it the label Customer Reply.
h) Add this field to the Issue response to customer task, making it Add Data To Assign.
11. Right-click on the Start event and change it to Trigger Type > Message Trigger .

The Start event displays an error symbol. You must either select the quick fix for this error or Save
to generate a web service descriptor for the Start event and remove the error symbol.
12. Right-click on the Start event, and select Business Service > Generate .

TIBCO Business Studio Tutorials

101

13. A new business service process is generated, using a default name similar to
ManageCustomerEnquiries-Catch Message Event. The business service process consists of a start
event, a user task and a send task.
Rename the business service to Follow up French Customer Enquiry, and rename the User Task
Collect Data.

The purpose of this business service is to collect the data needed to start the business process, and
send the data to the business process.
When you deploy this process it will be presented as a business service in a list of business services.
See the chapter "Business Services" in the TIBCO Workspace Users Guide for more information.

Dynamically Defining Who Gets Work


The solution designer can create a participant and use a query language to define an expression that
will be resolved dynamically to a relevant user at runtime.
Procedure
1. Right-click Participants at the process package level, and select New > Participant . The New
Participant dialog is displayed.
2. Enter the new participants Label as French speaking representative.
3. Select the new participants type as Basic Type, select Organization Model Query and click Finish.

TIBCO Business Studio Tutorials

102

4. Go to the General tab on the Properties view for this participant. In the Script Defined As: field,
note that the RQL (Resource Query Language) query script is selected by default.
Enter the following query in the Describe Organization Model Query Script box:
capability(name="FrenchSpeaker") intersect group(name="CustomerServicesRepresentatives")
Make sure you do not have a space in either name, or you will get an error.

The query states that the task is to be assigned to a user who is a member of the group Customer
Services Representatives, AND who has the capability French Speaker.
5. View the French Customer Services process in the Process Editor. You will see that is has errors
marked against each user task.

Click on the Complete product enquiry form user task. In the Properties view in the General tab,
click
and you will be shown the Select Participants dialog which will allow you to select
participants from a list of those already defined. Select French speaking representative and click
Add and OK.
6. Now repeat the preceding step to add the same participant to the Issue response to customer task.
You can now see that the process does not have any errors marked against the user tasks. In the
Properties view, General tab, for the Complete product enquiry form and Issue response to
customer user tasks, French speaking representative displays under Participants in each case.

7. Press CTRL + S to save the changes you have made.


TIBCO Business Studio Tutorials

103

Deploying and Running the Project


Since the ManageCustomerEnquiries project references the organization model in the
EasyAsExtendedOMSolution project, the organization model must be deployed before you deploy the
ManageCustomerEnquiries project.
Deploying these projects is similar to the deployment of the WelcomeUsers project described in the
Create, Deploy, and Run Your First BPM Application tutorial. Refer back to that tutorial for more detail on
any of the following steps.
Procedure
1. Check whether the EasyAsExtendedOMSolution project has already been deployed in a previous
tutorial. To do this:
a) Expand the Deployment Servers view and select your deployment server.
b) If the Properties view indicates that the Server State is Disconnected, right-click on the server in
the Deployment Servers view and select Connect.
c) Expand your selected deployment server, expand Applications, and check whether
EasyAsExtendedOMSolution is included in the list. If so, it is deployed.
2. If it is not already deployed, deploy the organization model. Follow the procedure in the How to
Implement and Deploy the WelcomeUsers Application tutorial to deploy the
EasyAsExtendedOMSolution project.
3. Follow the same procedure to deploy the ManageCustomerEnquiries project.
4. If you have not already done so, log into Openspace, create an LDAP container, and map two users
to the Customer Services Representatives Group in the Easy As organization model that you
imported previously in this tutorial.
By default, the Organization Browser is available in Openspace. In Workspace, the button
used to display the Organization Browser is by default not visible. However, in both
clients administrators can configure which functions are available. Depending on your
organizations policy, therefore, you may be able to use the Organization Browser from
either client application or from both. This tutorial assumes that you are using Openspace.
5. In the Resource List, select one of those two users. Right-click on the user and select Edit
Resource(s).

TIBCO Business Studio Tutorials

104

6. The Resource Editor displays. To assign the French Speaker capability:

Select the user in the left-hand pane

Scroll down the right-hand pane until you can see the capabilities, and select French Speaker.

Click

in the menu bar.

7. The same icon appears next to the users name, indicating that a capability has been granted.

Click OK to return to the Resource List. When the user is selected, the capability is now shown.

8. Log out of Openspace.


9. Log into Openspace again as the user you mapped to the Customer Services Representatives
Group and gave the French Speaker capability. Use the password "tibco123".
10. Start the Follow up > French Customer Enquiry business service. Click Submit.
11. In your work item list you should now see the work item Complete product enquiry form shown
as OFFERED. Dont do any more with this work item yet - you will come back to it later.
12. Log out as that user.
TIBCO Business Studio Tutorials

105

13. Now log in as the other user you mapped in step 4. You will not see a work item as you did not give
them the French Speaker capability.
14. Log out as that user.
15. Log in as the first user again, and double-click on the work item, complete the work item and
submit it.
16. You will now be sent the next work item in the process, Issue response to customer. Double-click
on the work item, complete the work item and submit it.

Verifying the Results


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the ManageCustomerEnquiriesSol.zip file in the location where you installed TIBCO Business
Studio (for example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
The Import wizard is displayed.
3. Select General > Existing Studio Projects into Workspace and click Next.
4. Click Select archive file, and click the Browse button.
5. Browse to the zip file and click Open.
The project is displayed in the Import wizard.
6. Click Finish.
The project is installed in your workspace.

How to Assign a Task to a User Based on their Job Function


To assign a task to a user based on their job function, you can assign the task to a Group which has
been created in your organization model.
Groups consist of users who can come from a variety of Organization Unitsso the Managers group
could contain managers of your Testing Department, Human Resources Department and so onwith
the common job function that they are Managers.
The group is created in the organization model, and users are assigned to groups using the
Organization Browser in TIBCO Openspace.
This tutorial shows you how to assign a task to a user based on their job function.
Before you start this tutorial, you can become familiar with TIBCO Business Studio by completing the
following initial tutorials:

How to Design a Simple WelcomeUsers Business Service

How to Implement and Deploy the WelcomeUsers Application

After completing the tutorial, you will be familiar with the basic steps involved in assigning a task to a
user based on their job function.

TIBCO Business Studio Tutorials

106

Importing the Initial Resources


You will need to open or import the WelcomeUsers project and a separate organization model.
If you are continuing this tutorial directly from a previous one, you have already started TIBCO
Business Studio, and the WelcomeUsers project may already be open. If so, skip the first two steps of
this procedure.
Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. If the WelcomeUsers project is not open, import the JobFunctionStart project. Find the
JobFunctionStart.zip file in the location where you installed TIBCO Business Studio and follow the
instructions in Verifying the Results to import the project.
3. In Project Explorer, expand the WelcomeUsers project.
If you are continuing from previous work with the WelcomeUsers tutorials, the project
will be called WelcomeUsers. If you have imported it as in step 2 , you will be using a
project with another name. It will be referred to simply as WelcomeUsers for the rest of
this tutorial.
4. Open the WelcomeUsers process.
5. In the Process Editor view, where the WelcomeUsers process is displayed, open the Tasks drawer
on the Palette. Click on the User Task icon, and drag and drop it onto the sequence flow between
Display Message and End Event. Name this user task Send out Welcome Pack.

6. Delete the Organization Model in the WelcomeUsers project by right-clicking on Organization and
selecting Delete. You will be asked if you want to delete Organization from the file system. Click
OK to confirm.
7. If you have not already done so in a previous tutorial, import the EasyAsExtendedOMSolution file
into your workspace (see Verifying the Results for details of how to import a project).
Expand the organization model. You will see that the organization model has a Group defined
called Managers.

Assigning a Task to a User Based on their Job Function


If you create a group of users who perform a similar job function in your Organization, you can assign
a task to members of that Group.
Runtime Behavior
At runtime the task will be offered to members of the group Managers. Before this can occur, an
administrator must map users to the Managers group using the Organization Browser in Openspace.
For more information see the Mapping Resources chapter in the TIBCO Organization Browser Users Guide.

TIBCO Business Studio Tutorials

107
By default, the Organization Browser is available in Openspace. In Workspace, the button used to
display the Organization Browser is by default not visible. However, in both clients administrators can
configure which functions are available. Depending on your organizations policy, therefore, you may
be able to use the Organization Browser from either client application or from both. This tutorial
assumes that you are using Openspace.
Procedure
1. Select the WelcomeUsers process and click on the Display Message user task, and in the General
tab for the Properties view, Process Tester is already selected as a Participant in the WelcomeUsers
project. Delete this reference to a participant by selecting the Clear button.
If you look at Process Tester in Project Explorer, you will see that it has an error indicator.
This is because it references an entity in the organization model which you deleted in the
Importing the Initial Resources procedure. Once Process Tester is no longer assigned to
any task, you will delete it.
2. Drag and drop the group Managers from the Project Explorer view of the
EasyAsExtendedOMSolution organization model onto the Display Message user task in the
WelcomeUsers process. The following message displays:

3. Click Yes to allow this, which means that you can now assign elements of the
EasyAsExtendedOMSolution organization model to the WelcomeUsers project.
4. You will now see Managers shown in the Participants tab for the Display Message user task.

5. Press CTRL + S to save the changes you have made.


6. Repeat steps 2 to 5 above to assign the same participant, the group Managers, to the Send out
Welcome Pack user task.

TIBCO Business Studio Tutorials

108

7. In Project Explorer, right-click on the Process Tester participant and select Delete.

You have now assigned both user tasks in the process to users who are part of the group Managers.

Deploying the Project


Since the WelcomeUsers project references the organization model in the EasyAsExtendedOMSolution
project, the organization model must be deployed for the WelcomeUsers project to be able to run.
Save the project that you have created. You have now completed the tutorial.
Procedure
1. Check whether the EasyAsExtendedOMSolution project has already been deployed in a previous
tutorial. To do this:
a) Expand the Deployment Servers view and select your deployment server.
b) If the Properties view indicates that the Server State is Disconnected, right-click on the server in
the Deployment Servers view and select Connect.
c) Expand your selected deployment server, expand Applications, and check whether
EasyAsExtendedOMSolution is included in the list. If so, it is deployed.
2. If it is not already deployed, deploy the organization model. Follow the procedure in the How to
Implement and Deploy the WelcomeUsers Application tutorial to deploy the
EasyAsExtendedOMSolution project.
3. Follow the same procedure to deploy the WelcomeUsers project.
4. If you have not already done so, log into Openspace, create an LDAP container, and map a user to
the Managers group in the EasyAsExtendedOMSolution organization model that you imported
previously in this tutorial.
5. Log into TIBCO Workspace as the user you mapped to the Managers group.
6. Now you can start the WelcomeUsers business service.

Verifying the Results


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the AssignByJobFunctionSolution.zip file in the location where you installed TIBCO Business
Studio (for example, <STUDIO_HOME > \studio\3. n\samples)..
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Studio Projects into Workspace and
click Next.
4. Click Select archive file, and click the Browse button.
5. Browse to the zip file, and click Open.
The project is displayed in the Import wizard.

TIBCO Business Studio Tutorials

109

6. Click Finish.
The project is installed in your workspace.

How to Deliver Work by Email


The body of the email message contains a link to either TIBCO Openspace or TIBCO Workspace
(depending on which BPM client you are using) and to the location of the work item.
Clicking this link enables you to open the work item directly from the email message. If, when you
installed your BPM runtime you specified localhost in your client properties, the link points to
localhost rather than the actual address for TIBCO Openspace or TIBCO Workspace. As the work item
is not on the localhost, the link does not resolve. To change this, you must amend the following
properties in the EmailChannelProperties.properties file:

For TIBCO Openspace BaseOSFormAppUrl=http://localhost:8080/openspace/openform

For TIBCO Workspace - BaseGIFormAppUrl=http://localhost:8080/workspace

The EmailChannelProperties.properties file is located under the folder BPM_CONFIG_FOLDER/tibco/


data/bpm/configuration/. On Windows platforms, the default value for BPM_CONFIG_FOLDER is C:
\ProgramData\amx-bpm\tibco\data.
This tutorial shows you how to deliver work by email by editing email attributes and pushing an email
notification to a user for a work item.
This tutorial assumes that you have an smtp server installed locally. Please contact TIBCO if you
require assistance with this procedure.
You should be familiar with the basics of designing, implementing and deploying process-based
applications using TIBCO Business Studio. If you are not familiar with these things, you should run
through the previous tutorials before attempting this one.
Before you start this tutorial, you can become familiar with TIBCO Business Studio by completing the
initial WelcomeUsers tutorials.
After completing the tutorial, you will be able to specify that email notifications of work will be pushed
to users, and to enter email attributes that control how work will be displayed to a user at runtime.

Importing the Initial Resources


Import a project containing a simple organization model to which your business process can refer.
Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.

TIBCO Business Studio Tutorials

110

2. If it is not already in your workspace, import a project containing only the organization model
called EasyAsExtendedOMSolution, as created in the tutorial How to Add Groups, Capabilities, and
Privileges to an Organization Model.
To do this:
a) Find the EasyAsExtendedOMSolution.zip file, in the location where you installed TIBCO
Business Studio (for example, <STUDIO_HOME > \studio\3. n\samples).
b) In TIBCO Business Studio, select File > Import .
c) The Import wizard is displayed. Select General > Existing Projects into Workspace and click
Next.
d) Click Select archive file, and click on the Browse button.
e) Browse to EasyAsExtendedOMSolution.zip and click Open. The EasyAsExtendedOMSolution
project is displayed in the Import wizard.
f) Click Finish. The EasyAsExtendedOMSolution project is installed in your workspace.

Creating the Project


Create a basic project containing a user task which can be used to generate a work item.
Procedure
1. Create a new Analysis project:
a) Select File > New > Analysis Project .
b) Name the project CustomerServices.
c) Select BPM as the Destination Environment, and click Next.
d) On the Asset Type Selection page, deselect Business Objects.
e) Click Finish.
2. Expand Process Packages to the Process level, right-click on CustomerServices-Process, select
Rename and name your process Customer Enquiry.
3. Right-click on the project in Project Explorer, and select Properties.
4. Select Project References, and from the list of references available, select
EasyAsExtendedOMSolution and click OK. This means that you will be able to reference this
organization model from the CustomerServices project.

5. In the Process Editor view, where the Customer Enquiry process is displayed, open the Tasks folder
on the Palette, and drag and drop the User Task icon onto the sequence flow between Start Event
and End Event. Label this user task Log customer enquiry.

TIBCO Business Studio Tutorials

111

6. Add a parameter to the process:


a) Expand the Customer Enquiry process in Project Explorer, and click on Parameters.
b) Click the plus sign at the right of the Properties view.
c) Click in the Label column and change the name from the default Parameter to Customer Name.
d) From Project Explorer, drag and drop the Customer Name parameter onto the Log customer
enquiry task. A popup menu is displayed.
e) Click Add Data To View. This means that the field contents are displayed as read-only when the
work item is displayed.
7. In Project Explorer, right-click Participants and select New > Participant , and name the new
participant Customer Services Administrator.
8. Select External Reference.
9. Map the reference to the Group called Customer Services Representatives from the
EasyAsExtendedOMSolution model, and click OK.

10. Click Finish. The participant Customer Services Administrator has now been mapped to the
Group Customer Services Representatives:

11. Drag and drop Customer Services Administrator onto the user task Log customer enquiry. Check
in the General tab under Properties for this Task, and you will see Customer Services Administrator
shown under Participants.
12. Press Control+S to save the changes you have made.

Creating the Business Service


The application uses a business service to pass the input parameters (the value of the Customer Name
field) to the start event of the business process.

TIBCO Business Studio Tutorials

112

Procedure
1. Right-click the start event and select Trigger Type > Message Trigger .
2. This generates a validation error that you can see by moving the pointer over the error flag on the
start event.

3. Click Clean and build project: CustomerServices in the error box, and note that after a short delay,
the error is no longer displayed.
4. Right-click the start event and select Business Service > Generate .
5. A business service with a user task and a send task is generated:

6. Rename the user task in the business service Collect Customer Name. Similarly, rename the send
task Start Process.
7. In the Project Explorer, rename the business service from CustomerServices-Catch Message Event
to Provide Name.
8. Save the process package.

Editing the Email Attributes in the Presentation Channel


Push notification means that notification of a work item is pushed out to a user via email.
The Attributes of the Openspace Email channel allow you to tailor the delivery of the information.
Procedure
1. Right-click on the CustomerServices project in Project Explorer, select Properties, and then select
Presentation Channels.

TIBCO Business Studio Tutorials

113

2. Check the Enable project specific settings checkbox and expand Default Channel by clicking the
plus sign next to it.

3. Click on Openspace Email. The default attributes are displayed:

4. You can make entries into the Value fields. Entries can include tokens (such as %
%token.workItemId%%). These tokens are replaced by actual values at runtime. You add a token
by typing the string directly into an attribute value. For mailSubject enter:
PUSH TUTORIAL - Pushing Work Item Id %%token.workItemId%%
For a list of valid tokens, refer to the TIBCO Business Studio Modeling Users Guide.
5. In fromAddress, enter your own email address.

The email address can also be in the format:


John Smith <jsmith@EasyAs.com
where John Smith is displayed in the resulting email.
The fromAddress must be a valid address on the SMTP server to be used to push work.
Some SMTP servers (depending on how they are configured) will throw an exception if
the address does not exist on the SMTP server.

TIBCO Business Studio Tutorials

114

6. Leave the default settings and the remaining empty fields as they are, and click Apply and then
OK.
7. Save the project that you have created.

Deploying the Project


You can now deploy the project. You should already have a deployment server available, for example
the one you created in the How to Implement and Deploy the WelcomeUsers Application tutorial.
Since the CustomerServices project references the organization model in the
EasyAsExtendedOMSolution project, that organization model must be deployed for the
CustomerServices project to be able to run.
Procedure
1. Check whether the EasyAsExtendedOMSolution project has already been deployed in a previous
tutorial. To do this:
a) Expand the Deployment Servers view and select your deployment server.
b) If the Properties view indicates that the Server State is Disconnected, right-click on the server in
the Deployment Servers view and select Connect.
c) Expand your selected deployment server, and check whether EasyAsExtendedOMSolution is
included in the list of applications. If so, it is deployed.
2. If it is not already deployed, deploy the organization model. Follow the procedure in the How to
Implement and Deploy the WelcomeUsers Application tutorial to deploy the
EasyAsExtendedOMSolution project.
3. Follow the same procedure to deploy the CustomerServices project.

Editing and Using Organizational Entity Push Destinations


In a pushed distribution model, when a work item is generated, it is sent to a user as an email. The
email contains the URL of the work item, which the user can click to open and process the work item.
In this tutorial, learn how to receive email notification of a task.
Assumptions
This procedure assumes that you have added at least one resource (LDAP user) to the Customer
Services Representatives group in the organization model. See the How to Map Users to the WelcomeUsers
Organization Model tutorial for details of how to add a user to an organizational entity.
Procedure
1. Log in to Openspace as tibco-admin (password secret).

TIBCO Business Studio Tutorials

115

2. Set up the Customer Services Representatives group as a push destination.


a) From the left pane of the Organization Browser, select the group Customer Services
Representatives to which you want to assign a push destination.
b) From the Tools menu above the left pane, select Edit Organizational Entity Push Destinations.
c) The Push Destinations Editor displays. Click on the
icon to specify a new push destination.
d) On the Push Destination dialog, from the Channel Type drop-down list, select Email ChannelEmail Presentation Channel, which causes the work items to be pushed to an email address.
e) From the Channel ID field drop-down list, select EmailGiPush_DefaultChannel.
This uniquely identifies the presentation channel to use when pushing work items to the
organizational entity.

f) In the Destination Target field, enter your own email address. This is the address to which work
items are to be pushed, and would be the address of the target organizational entity. Use your
own address for the purposes of the tutorial.
g) Click OK.
h) The newly defined push destination is shown on the Organizational Entity Push Destinations
dialog. Click Save.
3. Start an instance of the Customer Enquiry process.
4. Wait (about a minute) for the email to arrive.
When it arrives, you will see that the email subject is PUSH TUTORIAL - Pushing Work Item Id,
followed by the Id number. The Id number was set up using a token in Editing the Email Attributes
in the Presentation Channel so will be different for each work item.

TIBCO Business Studio Tutorials

116

5. Open the email and click on the link provided.

6. The Openspace or Workspace login screen displays in your web browser. Log in as an LDAP user
who has been added to the Customer Services Representatives group.
7. Press Submit on the work item. The form, and Workspace, closes.
8. Open Openspace or Workspace, and you will see that the process has completed.

Verifying the Results


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the EmailSolution.zip file, in the location where you installed TIBCO Business Studio (for
example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Projects into Workspace , and click
Next.
4. Click Select archive file, and click the Browse button.
5. Browse to the zip file and click Open.
The project is displayed in the Import wizard.
6. Click Finish.
The CustomerServicesSolution project is installed in your workspace.
You will need to amend the value in the fromAddress field to be an email address valid
on your system before you can run the solution project.

TIBCO Business Studio Tutorials

117

How to Tailor Your Own Email Template


This tutorial shows you how to create a customized email template. You can include your companys
own text, styles, and images in a template which will be used in future emails sent out by a business
process.
You should be familiar with the basics of designing, implementing and deploying process-based
applications using TIBCO Business Studio. If you are not familiar with these things, you should run
through the previous tutorials before attempting this one.
Before you start this tutorial, you can become familiar with TIBCO Business Studio by completing the
initial WelcomeUsers tutorials. You should also complete the How to Deliver Work by Email tutorial.
After completing the tutorial, you will be able to create a tailored email template and specify that email
notifications of work will use it.

Importing the Initial Resources


Resources needed in the tutorial must be imported.
In this tutorial you continue working with the project you created in How to Tailor Your Own Email
Template.
If you do not have this project open, you can download the solution to the How to Tailor Your Own
Email Template tutorial and use that. As in that tutorial, you also need to have available the
organization model EasyAsExtendedOMSolution.
The files that you will use to create your tailored template are also provided.
Importing the Initial Projects
Following this tutorial will be simpler and clearer if you close any other projects that you may have
open in your TIBCO Business Studio workspace, using the Project > Close Project menu option.
Procedure
1. Start Studio for Designers.
2. If it is not already in your workspace, import the CustomerServicesSolution project. To do this:

Find the EmailSolution.zip file, in the location where you installed TIBCO Business Studio (for
example, <STUDIO_HOME > \studio\3. n\samples).

In TIBCO Business Studio, select File > Import .

The Import wizard is displayed. Select General > Existing Projects into Workspace and click
Next.

Click Select archive file, and click on the Browse button.

Browse to EmailSolution.zip and click Open. The CustomerServicesSolution project is


displayed in the Import wizard.

Click Finish. The CustomerServicesSolution project is installed in your workspace.

3. In Project Explorer, expand the CustomerServicesSolution project.


If you are continuing from previous work with the How to Tailor Your Own Email
Template tutorial, the project will be called CustomerServices. If you have imported it,
you will be using a project called CustomerServicesSolution. It will be referred to simply
as CustomerServices for the rest of this tutorial.

TIBCO Business Studio Tutorials

118

Updating the Project Version


Update the version number of the project so that you can deploy and run the amended application
without previous versions of the project conflicting with it.
Procedure
1. In Project Explorer, right-click on the CustomerServices project and select Properties.
2. In the Properties dialog, select Lifecycle.
3. Amend the version number to 3.0.0.qualifier.
4. Click Apply and then OK.
5. In Project Explorer, select ProcessPackage(ProcessPackage).
6. In the Properties view, change the version to the same value, 3.0.0.qualifier.
Importing the Template Files
The needed template files are provided in the TIBCO Business Studio installation.
Procedure
1. Find the EmailTemplateFiles.zip file, in the location where you installed TIBCO Business Studio
(for example, <STUDIO_HOME > \studio\3. n\samples).
2. Unzip the EmailTemplateFiles.zip file to a convenient temporary folder.

Creating an Alternative Template


You can now use the imported files to create your template.
The email template is an html file that references the following files:

A stylesheet file (.css) that contains standard information such as banners, fonts, or background
colors, that you want to be in every email you send.

A properties file (cid.properties) that contains a list of references to any graphics that will be
embedded in the emails.

Including the Template Files in Your Project


Template files must be included in the TIBCO Business Studio project.
Procedure
1. Copy the following files from the folder where you unzipped the EmailTemplateFiles.zip file:

EasyAsTemplate.html

EasyAsStyleSheet.css

cid.properties

EasyAsLogo.png

TIBCO Business Studio Tutorials

119

2. In Project Explorer in TIBCO Business Studio, add these files into the Presentation Resources folder
of the CustomerServices project. You can do this either by copying and pasting the files, or by
right-clicking on the Presentation Resources folder and selecting Import > File System , browsing
to the folder that contains the required files, selecting the files you want and pressing Finish.
A JavaScript Object Notation file, cid.properties.json, is automatically generated when
you add the cid.properties file. It is updated whenever you save changes to the properties
file.
Modifying the Template Files
To tailor the appearance and content of the email to your needs, you can edit both the template file and
the stylesheet.
Procedure
1. In the Presentation Resources folder, double-click on EasyAsTemplate.html. It opens in an editor
window.
2. After the line <p > Pushed Work Item Notification</p , add the following line:
<p>Congratulations! If you see this mail, your tutorial is going well.</p>
3. Save the file.
4. Double-click on EasyAsStyleSheet.css. It opens in an editor window
5. In the definition of style p2, replace the word red with blue.
6. Save the file.
Adding a Graphic to the Template
The template file that you have added to your project already includes one graphic, EasyAsLogo.png.
You can see this listed in the Presentation Resources folder. To add another graphic to the template
file, proceed as follows.
Procedure
1. Add the new image to the Presentation Resources folder by copying Logo2.png, from the folder
where you extracted the zip file, to Presentation Resources, as you did in for the other files.
2. Double-click on the cid.properties file to open it in an editor.
3. After the definition of cidOne, add the following line:
cidTwo:Logo2.png
as in the following illustration.

4. Double-click EasyAsTemplate.html to open it in an editor.

TIBCO Business Studio Tutorials

120

5. Include the new graphic in the template by typing the following line after the copyright line, near
the end of the file:
<img src="cid:cidTwo"/>

6. Save the project.


Result
For More Information
There is a list of tokens that you can include in your email template in the "Using Presentation
Channels" section of the TIBCO Business Studio Modeling Users Guide. These are replaced by data at
runtime. For example, the template includes the "%%token.mailDate%%" token, which is replaced at
runtime by the date and time of the mail.

Applying the Template


Apply your new Email template to the CustomerServices project.
Procedure
1. From the project, right-click Properties > Presentation Channels .
Note that the checkbox Enable project specific settings must be selected. In this project, it is
already selected from the previous tutorial.
If you do not select Enable project specific settings, you can click on Configure
Workspace Settings... to define channels and templates that apply to every project in the
TIBCO Business Studio workspace.
2. Expand Default Channel and select Openspace Email.
Click in the Value field for mailTemplateLocation, and the picker (

) displays.

3. Use the picker to navigate to the HTML file that you created in the Presentation Resources folder,
and click OK.
4. Click Apply and then click OK.
Next time you push an email from this project, it will use your new template.

Deploying and Testing the Project


You can now deploy and test the project. You should already have a deployment server available, for
example the one you created in the How to Implement and Deploy the WelcomeUsers Application tutorial.
You can upgrade an application by deploying a version of it with a higher version number. For the
CustomerServices project:
Procedure
1. The version you created in the How to Deliver Work by Email tutorial was defined by default as
version 1.0.0.qualifier.
TIBCO Business Studio Tutorials

121

2. The CustomerServicesSolution project, which you may have downloaded to compare with your
solution to the earlier tutorial, is defined as version 2.0.0.qualifier. This enables you to deploy and
test that solution, if you wish, without deleting your own version from the runtime.
3. You have amended this version of the project to Version 3.0.0.qualifier.
Result
Since the CustomerServices project references the organization model in the
EasyAsExtendedOMSolution project, that organization model must be deployed for the
CustomerServices project to be able to run.
This tutorial assumes that the push destination that you set up in the How to Deliver Work by Email
tutorial is still in place.
Deploying the Projects
Follow the procedure in the How to Implement and Deploy the WelcomeUsers Application tutorial to deploy
the EasyAsExtendedOMSolution project if you need any further information.
Procedure
1. If the EasyAsExtendedOMSolution project is not already deployed, deploy it now.
2. Deploy your revised (version 3.0.0) CustomerServices project.
Testing the Project
Test the project as described in the How to Implement and Deploy the WelcomeUsers Application tutorial.
The email sent to your Inbox uses your tailored stylesheet, so is similar to the following illustration.

Verifying the Results


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.

TIBCO Business Studio Tutorials

122

Procedure
1. Find the EmailTailoredTemplateSolution.zip file, in the location where you installed TIBCO
Business Studio (for example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
The Import wizard is displayed.
3. Select General > Existing Projects into Workspace , and click Next.
4. Click Select archive file, and click the Browse button.
5. Browse to the zip file and click Open.
The project is displayed in the Import wizard.
6. Click Finish.
The CustomerServicesTailoredSolution project is installed in your workspace.
You will need to amend the value in the fromAddress field to be an email address valid
on your system before you can run the solution project.

TIBCO Business Studio Tutorials

123

Using Forms
How to Use Default Forms
Business Studio automatically generates a default form for each user task in a business process, based
on the data that is defined in the user task.
Default forms are managed by Business Studio and automatically synchronized whenever there are
changes in the user task data interface. Users can also open the form for editing and customizing
manually.
Default Forms vs. Customized Forms
Customizing a Form allows you to introduce custom logic into the form, adjust the layout, look and
feel, and use different controls or panes from the default ones, or to tweak the default settings on the
controls and panes used. But default forms offer an important advantage: they are automatically
synchronized with the data in the user task. This means that changes to the user task parameters are
immediately reflected in the form, without manual synchronization.
After this tutorial you will be familiar with:

Default forms and customized forms: advantages of each

How to preview a form (without opening it for editing)

How to choose the controls you want added to a default form by specifying primitive data for the
user task

How to add a control to a default form by adding attributes to a class in a business object model

Defining restrictions for a control through the business object model.

You should work through each section in turn to complete the tutorial.

Opening the Business Process


This tutorial uses an already-prepared project, FormsTutorialStart, as a starting point.
The prepared project is much like the project you created if you previously performed the tutorials
"How to Create Business Data" and "How to Use Business Data." It contains a single business process,
called "Notification of claim." We will use the user tasks and corresponding forms in the "Notification
of claim" business process to explore some of the ways you can use default forms in TIBCO Business
Studio.
Consider familiarizing yourself with the basics of creating and using business data by completing the
tutorials "How to Create Business Data" and "How to Use Business Data" before beginning this tutorial.
Following this tutorial will be simpler and clearer if you close any other projects that you may have
open in your TIBCO Business Studio workspace, using the Project > Close Project menu option.
Importing the FormsTutorialStart Project
Import the project FormsTutorialStart in your Business Studio workspace and use it as the starting
point for the Opening the Business Process tutorial.
Procedure
1. Find the formstutorialstart.zip file, in the location where you installed TIBCO Business Studio (for
example, <STUDIO_HOME\studio\3.n\samples). Copy it to a local drive.
2. In TIBCO Business Studio, select File > Import .
TIBCO Business Studio Tutorials

124

3. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to your local copy of FormsTutorialStart.zip and click Open. The FormsTutorialStart
project is displayed in the Import wizard.

6. Click Finish. The FormsTutorialStart project is installed in your workspace.


Importing the EasyAsExtendedOMSolution Project
An already-prepared organization model is also required for this tutorial. This organization model is
contained in the project EasyAsExtendedOMSolution.
Procedure
1. Find the easyasextendedomsolution.zip file, in the location where you installed TIBCO Business
Studio (for example, <STUDIO_HOME\studio\3.n\samples). Copy it to a local drive.
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to your local copy of easyasextendedomsolution.zip and click Open. The
EasyAsExtendedOMSolution project is displayed in the Import wizard.
6. Click Finish. The EasyAsExtendedOMSolution project is installed in your workspace.

Previewing the Default Form


Since default forms are generated automatically, they can be previewed but cannot be opened for
editing. If you choose to open a default form, it is automatically converted to a customized form. You
can always return to the default form later, but any customizations you have made to the form will be
lost.
The FormsTutorialStart project contains one business process, called Notification of claim, which itself
contains three user tasks: Specify claim type, Record no-fault claim details, and Record fault claim
TIBCO Business Studio Tutorials

125
details. A default form is generated for each user task in the business process. If the interface for the
user task is not explicitly defined, all process data that has been defined will be used as the user task
data, and controls will be generated for all of the data fields in the business process.
Procedure
1. Click the user task Specify claim type to select it, and look at the Properties view for the user task:

The right-hand portion of the General property sheet displays information about the form for the
user task. The radio button No Form URL is selected, indicating that the user task uses a default
form.
2. Right-click the user task Specify claim type and click Form > Preview .
Do not choose Form > Open . This command opens the form for editing, and turns the
default form into a customized form. If you accidentally convert the default form into a
customized form, you can restore it by clicking Form > Use Default .
3. Examine the default form in the forms viewer. Because no parameters have been added to the user
task, you will see a control for each parameter in the business process on the default form.

Choosing Fields to Display in a Default Form


When you explicitly add a primitive data field as a parameter to a user task, the default form for that
user task will show a control that corresponds to that parameter only. The form will no longer contain
controls for all data in the business process.
Procedure
1. Click the user task Specify claim type to select it.
2. In the Properties view, click Interface:

The Parameters table is empty, and the grayed type indicates that All Process Data is available to
appear on the default form.
3. Click the plus sign (+) on the far right of the Parameters table to open the Select Data Field or
Formal Parameter dialog box.
4. Click the data field IsFault in the Matching Items list, and then click the Add button to move the
data field to the Selection area. Click OK.
5. With the business process displayed in the Editor view, save the business process by clicking the
Save icon, clicking File > Save , or typing the keyboard command Ctrl+S.

TIBCO Business Studio Tutorials

126

6. Preview the default form for this user task again, now that a parameter has been defined. To do this,
right-click the user task in the process editor and click Form > Preview .

Notice that the form now contains only a single control corresponding to the parameter that was
specified in the user task interface, instead of displaying controls for all of the business process data.

Specifying Structured Data for a Default Form


When a class from a business object model has been used as the data type of a parameter for a user task,
the default form generates controls corresponding to the attributes of the class.
Structured data is defined in a business object model such as the one that is furnished with the
FormsTutorialStart project. The furnished business object model is identical to one you already created
yourself if you performed the earlier tutorial "How to Create Business Data."
The business object model and its component partsthe package, classes, attributes, generalizations,
and compositionsare explained in greater detail in the "How to Create Business Data" and "How to
Use Business Data" tutorials. It is recommended that you perform these tutorials as a prerequisite to the
present tutorial.

TIBCO Business Studio Tutorials

127

Procedure
1. Open the business object model in the business object model editor. To do this, expand
FormsTutorialStart > Business Objects > BusinessObjectModel.bom . Double-click on
BusinessObjectModel.bom. The business object model editor opens, and displays the business
object model.

Note the following details of the business object model:

It contains a single package, called claim, which contains all the business objects.

Among those business objects are two classes, NoFaultClaim and FaultClaim, that are related
by generalization to GenericClaim. This means they contain all the attributes of the generic
claim, including a summary of the claim, the claim amount, and a descriptionas well as the
two composite classes in the generic claim, which represent claimants and witnesses,
respectively.

The NoFaultClaim class and the FaultClaim class are identical, with one exception: the
FaultClaim class contains an additional attribute, counterParty, which represents the other
party involved in claims where fault will be assigned to one of the parties.
The difference between the attributes defined for the NoFaultClaim class and the FaultClaim
class will be reflected in the default forms, in that there will be an additional text field on the
FaultClaim form for identifying the counter party.

2. Next, we will examine the data fields that have been defined for the Notification of claim business
process. Drill down in the Project Explorer to FormsTutorialStart > Process Packages >
ProcessPackage.xpdl > ProcessPackage > Processes > Notification of claim > Data Fields .
3. Three data fields have been defined for this project, Fault Claim Field, IsFault, and No Fault Claim
Field. Click the data field Fault Claim Field.

TIBCO Business Studio Tutorials

128

4. The General tab is displayed in the Properties view for the data field:

Notice that the radio button External Reference is selected, and that the Reference text field
identifies the FaultClaim class as the type defined in the business object model on which the data
field is based.
5. In the furnished Notification of claim business process, the data field Fault Claim Field has
already been added as a parameter to the user task Record fault claim details. To verify this:
a) Click the user task Record fault claim details in the process editor.
b) In the Properties view, click the Interface tab. The Parameters table shows FaultClaimField as
the name of the process data associated with this user task.

c) Click the plus sign on the far right of the Parameters table to open the dialog box Select Data
Field or Formal Parameter.

Here you can see that data fields or formal parameters are added to the interface for a user task
by clicking them in the Matching items list and then clicking the Add button to add them to the
Selection list.
6. Click Cancel in the dialog box to close it without changing the settings.
7. Click the user task Record no-fault claim details. Examine the Interface tab in the Properties view,
and open the Select Data Field or Formal Parameters dialog. You will see that NoFaultClaimField
has been added to the interface for the Record no-fault claim details user task.

TIBCO Business Studio Tutorials

129

Previewing the New Default Forms


The default form for a user task can be configured to display controls based on data definitions in a
class in the business object model. In this case, the controls on the form will correspond to the attributes
in the class.
In this task, you will preview the forms for two of the user tasks in the Notification of claim business
process.
Procedure
1. View the default form for the Record no-fault claim user task.
a) Right-click the user task Record no-fault claim and click Form > Preview .
b) A preview of the form is displayed in the form viewer:

c) Notice that there are controls on the form for each attribute of the NoFaultClaim class in the
business object model.
2. View the default form for the Record fault claim user task.
a) Right-click the user task Record fault claim and click Form > Preview .
b) A preview of the form is displayed in the form viewer:

c) Notice that, in addition to the controls displayed on the previous form, this form also contains a
text field for the Counter Party.

TIBCO Business Studio Tutorials

130

Adding Fields to a Default Form


In this task you add an attribute to a class in a business object model. As a result, a corresponding
control is placed on the default form.
When a business object model is used to define the parameters for a user task, controls are placed on
the default form to correspond to each attribute of the associated class in the business object model. If
you add an attribute to the class, a new control for that attribute will be added to the form.
Procedure
1. Click the tab for the business object model in the editor. If the business object model is not open, in
the Project Explorer navigate to FormsTutorialStart > Business Objects >
BusinessObjectModel.bom . Double-click BusinessObjectModel.bom.
2. Select the Attribute tool in the palette. Drag it over the witness class and drop it.
3. Select the attribute you have just created. The Properties view for that attribute is displayed. In the
Label and Name fields on the General tab, type zip.
4. Note that by default the new attribute is assigned the type (or superclass) Text. To assign a different
type to this attribute, click on the ellipsis icon:

5. You could select Integer - Bom Privitive Types in this dialog, since a valid zip code is an integer.
But in this case, leave the type as Text so that we can specify a pattern for the validation using a
regular expression.
6. Save the business object model and preview the forms for the Record fault claim details and
Record no-fault claim details user tasks.
7. Note that a new field appears on the forms in the Witness pane for the new zip attribute:

Defining Restrictions for a Control on a Default Form


In this task you define restrictions for a control on a default form by specifying them in the Properties
view for the business object model.
Defining additional constraints in the business object model for attributes in a class will result in those
constraints being carried over to the control on the default form. For example, if the zip attribute is
defined as an integer having five-digits, then the control will have the same restrictions. A validation
will be performed when the end user enters a value for the control.
TIBCO Business Studio Tutorials

131

Procedure
1. Open the business object model in the editor.
2. Select the zip attribute in the Witness class.
3. In the Properties view, click the Advanced tab. Change the Maximum text length to 5, and enter the
following regular expression as the Pattern: ^\d\d\d\d\d$.

4. Right-click one of the two user tasks whose interface is configured with data defined in the business
object model. Click Form > Preview . Experiment with different values in the zip column of a row in
the Witness table by entering a value and clicking outside the table. Notice that an error message is
displayed when an invalid zip value is submitted.
Result

Next Steps
You can now:

Install the solution to this Tutorial and compare it with your version. See the instructions in the
following section for how to do this.

Proceed to the next tutorial "How to Use Structured Data in a Form," which describes how to use
complex data, as described in a business object model.

Optionally, you can assign participants to the user tasks. To do this:


1.

Assign a position in the organization model (from the project EasyAsExtendedOMSolution


that you imported earlier) as the participant for each of the user tasks. The How to Design a
Simple "WelcomeUsers" Process tutorial describes how to do that.

2.

If you wish, you can then deploy the project, as described in the How to Implement and
Deploy the "Welcome Users" Application for deploying the "WelcomeUsers" project.

Verifying the Tutorial Solution


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the formsdefaultsolution.zip file, in the location where you installed TIBCO Business Studio
(for example, <STUDIO_HOME\studio\3.n\samples). Copy it to a local drive.
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.

TIBCO Business Studio Tutorials

132

5. Browse to your local copy of formsdefaultsolution.zip and click Open. The FormsDefaultSolution
project is displayed in the Import wizard.
6. Click Finish. The FormsDefaultSolution project is installed in your workspace.
7. If you havent already installed the project EasyAsExtendedOMSolution, follow the procedure
described for importing formsdefaultsolution.zip to import the solution file
easyasextendedomsolution.zip. This project includes an organization model, which is needed for
the functionality of FormsDefaultSolution to work as intended.

How to Use Structured Data in a Form


The How to Use Structured Data in a Form tutorial looks in more depth at the interaction between the
business object modeler and forms. You learn how to make use of class types and their attributes, and
see how changes to settings for the attributes in the business object model influence the way the forms
are rendered.
You should work through each section in turn to complete the tutorial.
The procedures in this tutorial enable you to use the business object model to do the following:

Examine an existing business process and understand the interactions between the form controls
and the attributes in the business object model.

Make controls on the form required or optional.

Specify choice values for a control by using an enumeration.

Change the order in which controls appear on the form.

Modify the labels for the controls on a form.

Add validations for controls on the form by specifying constraints for the attributes in the business
object model.

Use a grid pane to edit an array of objects.

Use an action script to update an instance of an object.

You need to perform a sequence of tasks to complete this tutorial.

Opening the Business Process


If you completed the previous tutorial, "How to Use Default Forms," the business process as you left it
can be used as a starting point for the present tutorial. Instead, if you wish, you can begin this tutorial
by installing the furnished solution to the previous tutorial, FormsDefaultSolution.
Following this tutorial will be simpler and clearer if you close any other projects that you may have
open in your TIBCO Business Studio workspace, using the Project > Close Project menu option.
Importing the FormsTutorialStart Project
In this task you will import the project FormsTutorialStart in your Business Studio workspace and use
it as the starting point for the Opening the Business Process tutorial.
Procedure
1. Find the formstutorialstart.zip file, in the location where you installed TIBCO Business Studio (for
example, <STUDIO_HOME\studio\3.n\samples). Copy it to a local drive.
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
TIBCO Business Studio Tutorials

133

5. Browse to your local copy of FormsTutorialStart.zip and click Open. The FormsTutorialStart
project is displayed in the Import wizard.

6. Click Finish. The FormsTutorialStart project is installed in your workspace.


Importing the EasyAsExtendedOMSolution Project
An already-prepared organization model is also required for this tutorial. This organization model is
contained in the project EasyAsExtendedOMSolution.
Procedure
1. Find the easyasextendedomsolution.zip file, in the location where you installed TIBCO Business
Studio (for example, <STUDIO_HOME\studio\3.n\samples). Copy it to a local drive.
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to your local copy of easyasextendedomsolution.zip and click Open. The
EasyAsExtendedOMSolution project is displayed in the Import wizard.
6. Click Finish. The EasyAsExtendedOMSolution project is installed in your workspace.

Renaming the Project in the Project Explorer


If you are continuing this tutorial directly from the previous one, the FormsTutorialStart project will be
open in the Business Studio Project Explorer. If you are beginning this tutorial by importing the
solution to the previous one, the FormsDefaultSolution project will be open in the Project Explorer.
Procedure
1. In the Project Explorer, click the project name (either FormsTutorialStart or FormsDefaultSolution)
to select it.
2. In the Business Studio File menu, click Rename or press F2.
TIBCO Business Studio Tutorials

134

3. In the Rename Resource dialog, type FormsStructData.


4. Click OK.

Examining the Form and the Business Object Model


For a business process that has already been modeled, much can be learned by examining the
information contained in the various tabs of the Properties view for the forms, the data fields, and the
classes in the business object model.
Procedure
1. If it is not already open in the Business Object Model editor, open the business object model by
expanding FormsStructData > Business Objects and double-clicking BusinessObjectModel.bom.

2. If it is not already open in the Process editor, open the Notification of claim business process by
expanding FormsStructData > Process Packages > ProcessPackage.xpdl > ProcessPackage >
Processes . Double-click Notification of claim.

3. Click the user task Record no-fault claim details to select it.
We will use the form for the Record no-fault claim details user task, together with the
business object model, throughout this tutorial.

TIBCO Business Studio Tutorials

135

4. In the Properties view for the user task, click the Interface tab. Notice that the Record no-fault
claim details user task has been configured to use the NoFaultClaimField as its process data
parameter:

5. In the Project Explorer, expand FormsStructData > Process Packages > ProcessPackage.xpdl >
ProcessPackage > Processes > Notification of claim > Data Fields . Click the data field No Fault
Claim Field to view it in the Properties view. Notice in the property sheet that the type for this data
field is External Reference, and that the reference is to a type defined in the business object model,
namely, NoFaultClaim.

TIBCO Business Studio Tutorials

136

6. Now click the BusinessObjectModel.bom tab in the editor section to see the business object model
in the editor view:

Notice that the NoFaultClaim class is connected to the GenericClaim class by a relationship of
generalization, meaning that the NoFaultClaim class includes all the attributes of the GenericClaim
class. And the GenericClaim class also has two classes connected to it by a relationship of
composition, meaning that these two classes and their attributes are part of the GenericClaim class
(and, so, by extension, are part of the NoFaultClaim class). The two classes that are part of the
GenericClaim class by composition are:

Claimant

Witness
You have now examined all of the classes and attributes in the business object model that
impact the appearance of the Record no-fault claim details form.

Marking Attributes as Required or Optional


When an attribute has a multiplicity of 1, the associated control in the default form will be marked as
required. A multiplicity of 0..1 indicates an optional value.
By default, the attributes in the business object model are created with a multiplicity of 0..1 (that is,
there can be zero or one of them), which means that they are optional.
In the GenericClaim class, for example, the claim summary and claim amount fields are both optional
fields on the form because their multiplicity values in the business object model are both 0..1. We will
change those to required values on the form by changing their multiplicity to 1.
Procedure
1. Within the GenericClaim class, click the claimSummary attribute to select it.
2. In the General tab of the Properties view for the claimSummary attribute, notice that the
Multiplicity field contains a value of 0..1. Change this value to 1.

3. In the same way, change the multiplicity for the claimAmount attribute to 1.

TIBCO Business Studio Tutorials

137

4. Save the business object model by clicking the Save icon, clicking File > Save , or typing the
keyboard command Ctrl+S.
5. Click the Notification of claim tab in the editor to see the business process. Right-click the user task
Record no-fault claim details and click Form > Preview . Notice that the Claim Summary and
Claim Amount fields are now marked with asterisks, indicating that they are required:

Try deleting the default values in the Claim Summary and Claim Amount fields, and then clicking
the Submit button. Error markers will appear notifying you that those fields are required.

Using Multiplicity to Configure Form Controls


Consider the Claimant and Witness classes in our business object model. Each of those classes is
connected by composition to the GenericClaim class, meaning that claims can have claimants and
witnesses.
Whether claims are required to have claimants or witnesses is determined by whether or not a
multiplicity of zero is allowed for claimants or witnesses, as explained in the previous section of this
tutorial. If the multiplicity is 0..1 (zero to one) or * (zero to many), the classs attributes will be
represented on the form by optional fields. If the multiplicity is 1 (one) or 1..* (one to many), zero is not
allowed, and the classs attributes will be represented on the form by required fields.
Multiplicity, then, determines whether or not fields on the form are required or optional. But
multiplicity also has another important consequence: it determines whether the pane representing the
class on the default form holds only a single element of that class or can hold multiple elements.
The Claimant class contains two attributes, name and address. The Witness class contains three
attributes, name, address, and zip. Controls for the two Claimant attributes will appear grouped within
a pane on the default form, as will the controls for the three Witness attributes. Each class has its own
multiplicity value, defined as part of the composition that connects it to the GenericClaim class. The
multiplicity setting applies to all of the attributes within that class.
There are two possible cases with respect to the multiplicity of a class:

When a class has a multiplicity of 1 or 0..1, there can be at most one element of the class, and thus
one value at runtime for each of its attributes. In this case, a single text field for each attribute
appears within the pane corresponding to that class on the default form.
In this section of the tutorial, we will set the Claimant class to have a multiplicity of 1, meaning
there can only be a single claimant for a claim. (The multiplicity setting of 1, rather than 0..1, also
means that the fields for the claimant will be required.)

When a class has a multiplicity of * or 1..*, there can be many instances or elements of that type at
runtime. Each element appears in a grid pane (a pane that contains multiple elements of a certain
type) corresponding to that class on the form. Each element in the grid pane has a field
corresponding to each attribute of the class.
In this section of the tutorial, we will set the Witness class to have a multiplicity of *, meaning there
can be multiple witnesses for a single claim. (The multiplicity setting of *, rather than 1..*, also
means that, at runtime, a particular claim may have no witnesses.)
TIBCO Business Studio Tutorials

138
After setting the multiplicity values for the Claimant and Witness classes in the business object model,
you will examine the default form to see the impact this change has on the panes and controls on the
form.
Procedure
1. Open the business object model in the editor pane, if it is not already open.
2. In the diagram, select the 0..1 label near claimant. Change the value to 1 in the Multiplicity field in
the General tab of the Properties view.

3. In the diagram, select the 0..1 label near witness. Change the value to * (asterisk) in the Multiplicity
field in the General tab of the Properties view.

4. Save the business object model.

TIBCO Business Studio Tutorials

139

5. Right-click the Record no-fault claim details user task and click Form > Preview .

Notice that the Claimant class has been rendered as a vertical pane that contains a single element,
while the Witness class has been rendered as a grid pane, which can hold multiple elements, each of
which represents a single witness. The asterisks next to the Name and Address fields of the
Claimant pane indicate that those fields are required.

Using an Enumeration to Specify Choice Values


When an attribute is defined using an enumeration type, the default form will use an option list to edit
that value, with the values of the enumeration presented as the choices.
Procedure
1. Click the tab for the business object model editor.
2. Click once on the GenericClaim class to select it. The buttons for adding an attribute or operation
will pop up. Click the red button to add an attribute.

3. Name the new attribute vehicleType.


The attribute is created with the default data type of Text. But for this value, we dont want the user
to simply type free-form text into a text field to choose a type of vehicle. Instead, we want to present
the user with a fixed set of vehicle types from which to choose. In the remainder of this tutorial task,
we will create an enumeration and use it to redefine the data type of the vehicleType attribute.
4. Click Enumeration in the Elements section of the Palette, and click inside the claim package to
create the enumeration.
TIBCO Business Studio Tutorials

140

5. Initially, the name field of the enumeration is selected. Rename the enumeration by typing
VehicleType. (If the name field is not selected, click once on the default name, Enumeration, and
press F2. Then type VehicleType.)
6. When the enumeration is selected, a button will appear above the enumeration for adding an
enumeration literal. Click the button and an enumeration literal will be added to the enumeration.
The text for an enumeration is highlighted when it is first created, so you can begin immediatley to
type the name. Give the first enumeration literal the name CAR.

7. In the same manner, add three more enumeration literals, one called TRUCK, another called VAN,
and a third called MOTORCYCLE.

8. In the GenericClaim class, click vehicleType. Look below at the General tab of the Properties view
for the vehicleType attribute. Notice that the type is currently the default type of Text. Click the
ellipsis icon to open the Select Type dialog. Click VehicleType and click OK.

9. Save the business object model.


10. Preview the form to see the result. To do this, click the tab for the Business Process Editor in the
editor view to see the Notification of claim business process. Right-click the Record no-fault claim
details user task and click Form > Preview .

TIBCO Business Studio Tutorials

141

11. The vehicleType enumeration control is now displayed on the form. Clicking the down arrow
opens the list of choices. Notice that (unset) is one of the choices. This is because the control is
optional, basedon its default multiplicity value of 0..1. If you set the multiplicity to 1, the control
would be required, and the (unset) item would not appear among the choices.

12. Return to the business object model and click the vehicleType attribute within the GenericClaim
class. In the General tab of the Properties view, change the multiplicity from 0..1 to 1.
13. Preview the form again in the Business Process Editor view. You will see that unset no longer
appears in the list of choices, and there is now an asterisk next to the vehicleType control. Once a
choice is made, the users only option now is to make a different choiceit is no longer possible to
unset the vehicle type control so that it has no value.

Modifying the Appearance of Fields in a Default Form


The appearance of the fields in a default form can be modified by making changes in the business object
model.
In the previous task, the control for selecting the vehicle type appeared at the bottom of the form. In
this task, you will learn how to change the positioning of form controls by reording the corresponding
attributes in the business object model.
Changing the Order of Controls and Panes in the Default Form
The order of controls and panes in a default form mirror the order in which the corresponding
attributes are defined in the business object model. By changing the order of attributes in the business
object model, you can change the order of the form fields.
Procedure
1. Open the business object model in the Editor view.
2. Click the GenericClaim class to select it.
3. In the Attributes tab of the Properties view, you will see all the attributes of the GenericClaim
class, including the primitive types, like claimSummary, and the complex types, Claimant and
Witness.
The complex types, Claimant and Witness, appear in the Attributes tab as single
attributes of the GenericClaim class. You can reorder complex types in the Attributes tab
for GenericClaim. This will move the entire pane that contains the fields for the complex
type up or down on the default form, relative to the other panes and controls on the form.
But it wont change the order of the controls within the complex type, for instance, the
name and address fields within the Claimant class. To reorder those, you must click the
Claimant class itself, and go to the Attributes tab of the Properties view for Claimant.
Likewise, to change the order of the enumeration literals within the VehicleType
enumeration, you must click the enumeration and go to the Enum Literals tab in the
Properties view for the enumeration.

TIBCO Business Studio Tutorials

142

4. Move the claimant attribute up so that it appears just beneath the claimSummary attribute. To do
this, click the claimant attribute in the Attributes tab of the GenericClaims Properties view to
select it. Click the up arrow repeatedly until the attribute is in the desired position.

5. In the same manner, move the vehicleType attribute up so that it is just beneath the claimant
attribute.
6. Change the order in which the vehicles are listed in the VehicleType enumeration by moving
MOTORCYCLE to the top. To do this, click the VehicleType enumeration to select it and go to the
Enum Literals tab. Click the MOTORCYCLE literal to select it, and click the up arrow repeatedly to
move MOTORCYCLE to the top of the list.

7. Preview the form by opening the business process in the editor, right-clicking the Record no-fault
claim details user task, and clicking Form > Preview . The controls will now appear in the new
order you have established. The claimSummary field is followed by claimant and then
vehicleType. And the first option in the vehicleType option list is now MOTORCYCLE.

TIBCO Business Studio Tutorials

143

Changing the Labels for Controls in the Default Form


Default forms make use of the labels specified for attributes and classes in the business object model. It
is better to update labels in the business object model where possible so that these labels can
automatically be re-used in other forms that use the same objects.
By default, the labels for attributes in the business object model are identical to the names. We used
JavaScript naming conventions to name our attributes, beginning each name in lower case, with no
spaces, and using capital letters as separators between words, as in claimSummary.
But, while the names for objects should follow JavaScript naming conventions, the labels for attributes
and the labels for controls on the form, which are derived from the attribute labelsare not required to
do so. The next section explains how to modify the labels in the business object model, and thereby
modify the labels on the form, to make them more readable. The names for the attributes will remain
unchanged, and so will continue to adhere to JavaScript naming conventions.
Procedure
1. Open the business object model in the editor view.
2. Click the claimSummary attribute within the GenericClaim class. In the General tab of the
Properties view for the attribute, change the Label field to Claim Summary.

3. In the same manner, change the labels for the other three attributes within the GenericClaim class
to Claim Amount, Claim Description, and Vehicle Type, respectively.

4. Using the same procedure, capitalize the labels for all the controls on the form.
5. Save the business object model.
6. Open the Notification of claim business process in the editor view

TIBCO Business Studio Tutorials

144

7. Right-click the Record no-fault claim details user task and click Form > Preview . The labels for the
controls will now reflect the changes you made to the attributes in the business object model.

Editing an Array of Objects Using a Grid Pane


Arrays of objects may be represented in forms using a grid pane. The grid pane can be configured to
support adding or deleting records in the underlying array of objects.
In earlier Forms tutorials, we made changes to the business object model, and not directly to the form.
In this way, we were able to customize the form while continuing to use the default form. The
advantage of doing so is that the default form is continually and automatically synchronized with the
underlying data.
But for this tutorial, we will make changes directly to the form, forgoing that advantage in order to
make further customizations. Once we open the form for editing, it becomes a customized form, rather
than a default form. This means the form must be manually synchronized with the data by opening the
business process, right-clicking the user task, and clicking Form > Synchronize .
Procedure
1. Open the Notification of claim business process in the editor view.
2. Right-click the Record no-fault claim details user task and click Form > Open .
3. A warning message will appear telling you that the customized form will no longer be kept in sync
with the activity interface. Click OK.
4. Click the Witness pane to select it. Be sure to click outside of the Name and Address text fields so
that it is the Witness pane, and not one of its text fields, whose properties appear in the Properties
view.
5. In the Properties view, click the Properties tab.
6. In the Maximum Visible Rows field, type 4. This means that only 4 rows will be visible when the
form is opened. More rows will be there if there are more than 4 witnesses, but the user will have to
scroll to see them.
7. Check the checkboxes for Support Add Operation and Support Delete Operation.

TIBCO Business Studio Tutorials

145

8. In the Label field for Support Add Operation, type Add Witness. In the Label field for Support
Delete Operation, type Remove Witness. These labels will appear on the form within the buttons
that invoke those actions.

9. Save the form and click the GI Preview tab to preview the form.

10. Experiment with adding and removing witnesses from the grid pane, using the Add Witness and
Remove Witness buttons.
Result
Next Steps
You can now:

Install the solution to this Tutorial and compare it with your version. See the instructions in the
following section for how to do this.

Proceed to the next tutorial "How to Customize the Appearance of a Form," which describes how to
alter the look and feel of a form so that its appearance conforms to your organizations design
guidelines.

Optionally, you can assign participants to the user tasks. To do this:


1.

Assign a position in the organization model (from the project EasyAsExtendedOMSolution


that you imported earlier) as the participant for each of the user tasks. The How to Design a
Simple "WelcomeUsers" Process tutorial describes how to do that.

2.

If you wish, you can then deploy the project, as described in the How to Implement and
Deploy the "Welcome Users" Application for deploying the "WelcomeUsers" project.

TIBCO Business Studio Tutorials

146

Verifying the Tutorial Solution


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the formsstructdatasolution.zip, in the location where you installed TIBCO Business Studio
(for example, <STUDIO_HOME\studio\3.n\samples). Copy it to a local drive.
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to your local copy of formsstructdatasolution.zip and click Open. The
FormsStructDataSolution project is displayed in the Import wizard.
6. Click Finish. The FormsStructDataSolution project is installed in your workspace.

How to Customize the Appearance of a Form


In the How to Customize the Appearance of a Form tutorial, you will learn techniques for customizing
the appearance of a form using a CSS class.
You should work through each section in turn to complete the tutorial.
The following points are illustrated by the tasks in this tutorial:

To customize the appearance of a form, you can assign a CSS class (cascading style sheets) to the
form.

Within the CSS file, you will define a set of rules that determine the styles to be applied to
components within the form.

Opening the Business Process


If you completed the previous tutorial, "How to Use Structured Data in a Form," the business process as
you left it can be used as a starting point for the present tutorial. Instead, if you wish, you can begin this
tutorial by installing the furnished solution to the previous tutorial, FormsStructDataSolution.
Following this tutorial will be simpler and clearer if you close any other projects that you may have
open in your TIBCO Business Studio workspace, using the Project > Close Project menu option.
Importing the FormsTutorialStart Project
In this task you will import the project FormsTutorialStart in your Business Studio workspace and use
it as the starting point for the Opening the Business Process tutorial.
Procedure
1. Find the formstutorialstart.zip file, in the location where you installed TIBCO Business Studio (for
example, <STUDIO_HOME\studio\3.n\samples). Copy it to a local drive.
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.

TIBCO Business Studio Tutorials

147

5. Browse to your local copy of FormsTutorialStart.zip and click Open. The FormsTutorialStart
project is displayed in the Import wizard.

6. Click Finish. The FormsTutorialStart project is installed in your workspace.


Importing the EasyAsExtendedOMSolution Project
An already-prepared organization model is also required for this tutorial. This organization model is
contained in the project EasyAsExtendedOMSolution.
Procedure
1. Find the easyasextendedomsolution.zip file, in the location where you installed TIBCO Business
Studio (for example, <STUDIO_HOME\studio\3.n\samples). Copy it to a local drive.
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to your local copy of easyasextendedomsolution.zip and click Open. The
EasyAsExtendedOMSolution project is displayed in the Import wizard.
6. Click Finish. The EasyAsExtendedOMSolution project is installed in your workspace.

Renaming the Project in the Project Explorer


If you are continuing this tutorial directly from the previous one, the FormsStructData project will be
open in the Business Studio Project Explorer. If you are beginning this tutorial by importing the
solution to the previous one, the FormsStructDataSolution project will be open in the Project Explorer.
Procedure
1. In the Project Explorer, click the project name (either FormsStructData or
FormsStructDataSolution) to select it.
2. In the Business Studio File menu, click Rename or press F2.
TIBCO Business Studio Tutorials

148

3. In the Rename Resource dialog, type FormsAppearance.


4. Click OK.

Assigning a CSS Class to a Form


A CSS class can be assigned to a form. The rules defined in the CSS file will be used to determine
aspects of the appearance of the form.
Procedure
1. If it is not already open, open the Notification of claim business process by expanding
FormsAppearance > Process Packages > ProcessPackage.xpdl > ProcessPackage > Processes .
Double-click Notification of claim to open the business process in the editor view.
2. Right-click the user task Record no-fault claim details and click Form > Open . A warning will pop
up to inform you that "the customized form will no longer be automatically kept in sync with the
activity interface." This is because opening a form, rather than simply previewing it, causes the default
form to become a customized form. For this tutorial we will be using a customized form, so ignore the
warning and click OK.
3. Click on the form, in the margin outside of any element on the form, so that the Properties view is
displayed for the entire form. Or, if you find it a more certain approach to selecting the entire form,
you can click the name of the form in the Outline view:

When the form is displayed in the Editor view, the name of the form appears at the top of the
Outline view.
4. In the Properties view for the form, click the Resources tab.
5. Click the plus sign (+) to add a resource. The Pick Resource dialog opens, displaying a list of the
resources currently residing in the Presentation Resources folder, including CSS files, JavaScript,
and image files, if any.
In this case, the FormsAppearance project includes a CSS file, claims.css, already in the
Presentation Resources folder. This is the file we will be editing throughout this tutorial.

TIBCO Business Studio Tutorials

149

6. In the Pick Resource dialog, click claims.css and click OK. The CSS class file has now been added
as a resource to the Record no-fault claim details form. The definitions it contains will be used to
render the form in HTML.

7. Double-click the claim.css file in the Project Explorer to open it in the editor. As furnished,
the .claimtheme class defines a background color, border style, border width, and padding.
.claimtheme {background-color: #DDFFDD; border-style: solid;
border-width: 3px; padding: 4px;}
.claimtheme .pane-label {background-color: #BBFFBB;}

In the next task, well see what happens when this theme is applied at the form level.

Setting a CSS Class at the Form Level


There are three levels at which you can set a CSS class on a form. You can set the CSS class at the form
level for the Record no-fault claim details form.
The levels are:

At the form level

At the pane level

At the control level

Procedure
1. Click the tab so that the form is visible in the Editor view, if its not already so.
2. Make sure that the General tab is selected in the Properties view.
3. Type the class name claimtheme in the Style Class Name(s) text field, omitting the leading dot:

TIBCO Business Studio Tutorials

150

4. Save the form by clicking the Save icon, clicking File > Save , or typing the keyboard command Ctrl
+S.
5. Click the GI Preview tab to see the result of applying the CSS class. Notice the appearance of the
background and border:

6. If you wish, experiment by making changes to the claims.css file. Double-clicking claims.css in
the Project Explorer opens the CSS file in the Editor view, where you can make and save changes to
the file. Try changing, for example, the RGB value for the background color, using hexidecimal
values. Here is the hex value for a shade of light blue: #B0E2FF. To use this light blue as a
background at the form level, edit the claimtheme class in the CSS file as follows:
.claimtheme {background-color: #B0E2FF; border-style: solid; border-width: 3px;
padding: 4px;}
.claimtheme .pane-label {background-color: #BBFFBB;}

At the form level, the background now appears in light blue. Because of the second line of the CSS
file, which defines a different background color for the label, the background color for the label is
still green:

Setting a CSS Class at the Pane Level


Setting a CSS class at the pane level is much like doing so at the form level. As with the form, the
General tab of the Properties view is used, but this time, it is the Properties view for the pane, not the
entire form.
You can set the CSS class at the pane level for the Record no-fault claim details form.

TIBCO Business Studio Tutorials

151

Procedure
1. Click the name of the pane in the Outline view to open the Properties view for the pane. In this
case, select the claimant pane by clicking Claimant (NoFaultClaimField) in the Outline view:

2. In the General tab of the Properties view for the Claimant pane, type into the Style Class Name(s)
text field the name of the CSS class within the claims.css file that contains the rules you want
applied to the pane. In this case, type highlight in the Style Class Name(s) text field.

3. The style defined in the claims.css file in the class .claimtheme .highlight will be applied to the
Claimant pane. This CSS class defines a background color, border style, and border width:
.claimtheme .highlight {background-color: #AAFFAA; border-style: solid; borderwidth: 2px;}

4. Preview the form to see the effect of applying the style to the Claimant pane.

Note that the background color for the Claimant pane is a darker shade of green that that of the
overall form.

TIBCO Business Studio Tutorials

152

Setting a CSS Class at the Control Level


Setting a CSS class at the control level is much like doing so at the form and pane levels. As with those
levels, the General tab of the Properties view is used, but this time, it is the Properties view for the
control, not the form or the pane.
In this task, well set the Claim Amount field to have a red background in order to mark the control as
important.
Procedure
1. Click the Claim Amount control on the form (in the Design view) to open the Properties view for
the control.

2. In the General tab of the Properties view for the Claim Amount control, type into the Style Class
Name(s) text field the name of the CSS class within the claims.css file that contains the rules you
want applied to the pane. In this case, type important in the Style Class Name(s) text field.
3. The style defined in the claims.css file in the class .important will be applied to the Claim
Amount control. This CSS class defines a red background color, as well as a border style and border
width:
.important {background-color: #FFAAAA; border-style: solid; border-width: 2px;}

4. Preview the form to see the effect of applying the style to the Claim Amount control.

TIBCO Business Studio Tutorials

153

Changing the Style of a Control Based on an Input Value


Once you have defined various CSS classes, you can configure the form so that the specific class to be
applied to a component of the form is based on a value input by the user. In this task, we will create a
computation action, so that the background color for the Claim Amount control is determined by the
value a user enters in the field.
We will use the pre-defined CSS file, claims.css. The class to be applied will be
either .warning, .problem., or no class at all, depending on the users input.
Procedure
1. Select the Claim Amount control in the Design view of the Record no-fault claim details form.
2. In the Outline view, right-click Shared Actions and click New Computation Action. This opens the
Add Action dialog.

3. In the Add Action dialog, type setAmountStatus in the Label field.

TIBCO Business Studio Tutorials

154

4. For the Destination field, indicate where the action will be applied. To do this, click the elipsis icon
to open the Choose Destination dialog. Expand the Claim Amount item by clicking the plus sign,
and click Style Class to select it:

With this configuration, the Style Class setting for the Claim Amount control will be modified in
response to the action.
5. Click OK to close the Choose Destination dialog.

TIBCO Business Studio Tutorials

155

6. In the Add Action dialog, enter the following script in the Expression text area:
var amount = control.NoFaultClaimField_ClaimAmount.getValue();
var style = "";
if (amount > 5000) {
"problem";
} else if (amount > 2000) {
"warning";
} else {
"";
}

The fields of the Add Action dialog should now be complete, as shown here:

The script above is evaluated as an expression, with no return statement, not as a function. At
runtime, the script will work as follows:

If the amount entered by the user is greater than 5000, the style defined in the .problem class
will be applied to the Claim Amount control.

If the amount is greater than 2000, up to 5000, the style defined in the .warning class will be
applied.

If the amount is 2000 or less, no CSS class will be applied, and the style for the control will be
unchanged.

7. Now we will create a rule to specify when the above script is to be used. Click the Claim Amount
field in the Design view of the form. Click the Rules tab in the Properties view. To define a rule to
be used when the control is updated, click the icon to the right in the Update portion of the Rules
property sheet. This will open the New Rule dialog:

TIBCO Business Studio Tutorials

156

8. In the Label field of the New Rule dialog, Rule Details screen, type Claim Amount Updated. Click
Next.
9. In the Rule: Pick Events screen, the fields are already populated. Click Next.
10. In the Define Actions screen, click the plus sign to open the Add Action dialog for adding an action
to a rule:

11. In the Add Action to Rule screen, click the radio button Pick an existing action. Click the elipsis to
the right of the field to open the Select Item dialog:

12. Click setAmountStatus to select it and click OK.


13. Click Finish twice to accept your settings and close the New Rule dialog.
14. Check your results by clicking the GI Preview tab for the form. Experiment by entering different
values for the Claim Amount field, including values greater than 5000, between 2000 and 5000, and
less than 2000.
Result
Next Steps

TIBCO Business Studio Tutorials

157
You can now:

Install the solution to this Tutorial and compare it with your version. See the instructions in the
following section for how to do this.

Optionally, you can assign participants to the user tasks. To do this:


1.

Assign a position in the organization model (from the project EasyAsExtendedOMSolution


that you imported earlier) as the participant for each of the user tasks. The How to Design a
Simple "WelcomeUsers" Process tutorial describes how to do that.

2.

If you wish, you can then deploy the project, as described in the How to Implement and
Deploy the "Welcome Users" Application for deploying the "WelcomeUsers" project.

Verifying the Tutorial Solution


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the formsappearancesolution.zip file, in the location where you installed TIBCO Business
Studio (for example, <STUDIO_HOME\studio\3.n\samples). Copy it to a local drive.
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to your local copy of formsappearancesolution.zip and click Open. The
FormsAppearanceSolution project is displayed in the Import wizard.
6. Click Finish. The FormsAppearanceSolution project is installed in your workspace.

TIBCO Business Studio Tutorials

158

Using Dynamic Sub-Processes


How to Use Dynamic Sub-Processes
This tutorial shows you how to use dynamic sub-processes within a business process.
There can be occasions when a business process needs to call on one from a number of routines, but it is
not known at design time which particular one of them will be called on any given occasion. This can
be handled by creating a number of sub-processes. The exact sub-process to be run is chosen
dynamically at runtime, depending on the process data that apply at that time. In TIBCO Business
Studio, this is accomplished by using a common process interface for the set of sub-processes.
After you complete this tutorial, you should be able to use process interfaces to call sub-processes
within a business process.
In this process:

A nurse enters basic information about the patient, such as their name and address.

On a second form the nurse enters the symptom that the patient reports, and selects whether to send
the for a blood test, an X-ray, or both.

As a result of this decision, a work item is sent to the required departments (for example, the X-ray
department) and someone in that department books an appointment. An email is sent to the patient
with the appointment details.

Finally, a form displays to a supervisor a summary of the patients admission information along
with any new booking information that has been entered.

Before You Begin


Before you start this tutorial, you can become familiar with TIBCO Business Studio by completing the
initial Welcome Users tutorials.

Importing the Initial Resources


This tutorial supplies a project and an organization model as the starting-point, so that the initial work
is already done for you.
Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. To import the DynamicSubProcTutorial project into your workspace, find the
DynamicSubProcTuteStart.zip file in the location where you installed TIBCO Business Studio (for
example, <STUDIO_HOME > \studio\3. n\samples)..
3. In TIBCO Business Studio, select File > Import .
The Import wizard is displayed.
4. Select General > Existing Projects into Workspace and click Next.
5. Click Select archive file, and click on the Browse button.
6. Browse to the zip file and click Open.
The project is displayed in the Import wizard.

TIBCO Business Studio Tutorials

159

7. Click Finish.
The SubProcStart project is installed in your workspace.
8. Repeat step 2 to step 7 to open HospitalOM.zip and install the HospitalOrgModel project.

Examining the Starting Process


The DynamicSubProcTutorial project provides a partly-completed process.
Procedure
1. In Project Explorer, open the project, expand Processes and open the InitialConsultation process.
2. The InitialConsultation process looks like this:

Some of the tasks display error markers. These will be resolved during the course of this tutorial.

TIBCO Business Studio Tutorials

160

3. It contains the following formal parameters and data fields:


Parameter

Details

Address1stline

Text, Length 50

BloodTestComments

Text, Length 50

Complaint

Text, Length 50

Forename

Text, Length 50

Gender

Text, Length 6

LastName

Text, Length 50

mail_To

Text, Length 75

NeedBloodTest

Boolean

NeedXRay

Boolean

PostCode

Text, Length 10

XRayComments

Text, Length 50

Data Field

Details

ApptTimeArr

Array of Date Times

BloodTestAppointment

Date Time

DeptArr

Array of Text, Length 15

ProcessIdentifierArr

Array of Text, Length 50

TestCommentsArr

Array of Text, Length 50

XRayAppointment

Date Time

These are all initially set as Input parameters.


4. Select the Initialize task.
5. On the General tab, the script sets a default value for the mail_To variable. Change it from
"yourname@company.com" to your own email address.

Creating the Process Interface


You must create the process interface that will be used by the dynamic sub-processes.
A process interface specifies the events and parameters that must be present in all the sub-processes
created to use that interface. It specifies what the business process expects to input to the sub-process
and to receive from it at runtime, regardless of which of the available sub-processes is actually called.

TIBCO Business Studio Tutorials

161
In Project Explorer, expand the DynamicSubProcTutorial project and right-click
Select New > Process Interface .

Procedure
1. The Process Interface wizard displays. Change the label of the new process interface to Make
Appointments Interface and press Finish.
2. The new interface displays in the Process Editor as shown in the following illustration. Note that by
default it specifies a start event, but no other events or parameters.

TIBCO Business Studio Tutorials

162

3. Create input and output parameters. For each one, click the New button for the Formal Parameters
field in the Make Appointments Interface. The New Parameter dialog displays. Type the Label,
and change the Type where necessary. Click Finish.

TIBCO Business Studio Tutorials

163
You require the following input and output parameters:
Label

Mode

Forename

In

LastName

In

Gender

In

Address1stLine

In

PostCode

In

ApptTime

Out

Dept

In/Out

mail_To

In

Set the Basic Type of the ApptTime parameter to Date Time. All the others are Text.
Set the Length of mail_To to 75 characters. The other Text parameters are the default 50.
The result should look like this.

4. Save the project.

Creating a Sub-Process
Now you can create a sub-process based on the process interface Make Appointments. This will take
the patient details as input and will output an appointment time.

TIBCO Business Studio Tutorials

164

Procedure
1. In Project Explorer, right-click the Make Appointments process interface and select New >
Business Process . The New Process Wizard displays, to create a process based on the Make
Appointments process interface.

2. Change the Label for the new process to Blood Test Appointment and click Finish.
The new sub-process displays in the Process Editor.
3. The Blood Test Appointment sub-process only has a Start event. Create a user task, and label it
Allocate Blood Test Appointment. An error marker will display because a user task needs a
participant. You will define the participant in step 7.
4. Connect the user task to the Start event with a sequence flow.
5. Add a service task after the user task. Label it Email Hospital Department and set the Service Type
to E-Mail. Connect it to the user task with a sequence flow.

TIBCO Business Studio Tutorials

165

6. Select the Allocate Blood Test Appointment user task. On the Interface tab of the Properties view,
add the parameters as shown in the following illustration.

7. A user task needs a participant. At the process package level, right-click on Participants and create
a new participant called Blood Test Booker. Define the Type as an External Reference and map it
to the Phlebotomy Secretary in the organization model.

8. Drag the Blood Test Booker participant from Project Explorer over the Allocate Blood Test
Appointment user task, and drop it on the task.

TIBCO Business Studio Tutorials

166

9. Configure the email task by typing in an addressee, subject line and message, as shown in the
following illustration. Note the use of variables that correspond to the values of some of the process
parameters.

The recipient of the email task is set to the %mail_To% variable for testing purposes. You could set
this to a different recipient, such as your own address or the email address of the patient, by
modifying the process. See the tutorial "How to Deliver Work by Email" for information on
configuring email destinations.
10. On the E-Mail tab, set the From: field to Use Custom Configuration. Enter an email address in the
available field.

11. Save the package.

TIBCO Business Studio Tutorials

167

Creating a Second Sub-Process


You need a second sub-process that performs the same task as the Blood Test Appointment process,
but for x-ray appointments.
You could produce this in the same way as described in Creating a Sub-Process, by starting from the
process interface and adding tasks. But it is simpler to copy your existing sub-process and make the
necessary changes.
Procedure
1. Select the Blood Test Appointment sub-process in Project Explorer and copy it. Paste the copy
under Processes.
2. Change its label to X-Ray Appointment.
3. Select the Allocate Blood Test Appointment user task in the X-Ray Appointment sub-process.
Change the Label to Allocate X-Ray Appointment.
4. Click on Clear next to the Participants field. This removes the link to the Blood Test Booker
participant.
5. Create a participant called X-Ray Booker, and map it to the Radiography Secretary position.
6. Drop the new participant on to the Allocate X-Ray Appointment user task in the X-Ray
Appointment sub-process.
7. Select the Email Hospital Department task.
8. In the General tab, change "Blood Test" to "X-Ray" in the subject line and in the body of the email.

Adding Parameters to the Process Tasks


Now add the parameters in the main Initial Consultation business process to the tasks within that
process.
See Examining the Starting Process for the parameters included in the process.
Procedure
1. To add the parameters to the Intake user task, select the Interface tab in the Properties view.
2. Click on
.
The Select Field or Formal Parameter dialog displays.
3. Click the field you requirefor the first parameter, click Forenameand then click Add and OK.

TIBCO Business Studio Tutorials

168

4. Change the Mode field from In to In/Out where required.


5. Continue to add parameters until the Interface tab looks like the following illustration.

6. Add parameters and data fields to the Summary user task as shown in the following illustration.

Tailoring the Forms


The default forms generated for the user tasks can be improved. You may wish to re-arrange the fields
on the form in something other than their default alphabetical order. In addition, the mandatory
NeedBloodTest and NeedXRay parameters need to presented as radio buttons rather than as
checkboxes. This is because they are mandatory fields, so need to be completed in all cases.
Procedure
1. Select the Intake task. On the General tab, click on the Form button.

TIBCO Business Studio Tutorials

169

2. A warning is displayed. Click OK. The address of a form for the task is now displayed.
3. Click Open Form. The form displays.
If an error message similar to the following displays instead, then delete the empty folders
under Forms in Project Explorer, run Project > Clean , and try again.

If at any point an error is generated saying that a form is out of sync with its event, select
the Quick Fix to solve the problem. Warnings to the same effect can be ignored.
4. The fields are displayed in alphabetical order. Re-arrange them so that the patients name and
address are displayed first, and then the medical details.

TIBCO Business Studio Tutorials

170

5. Click on the NeedBloodTest field. In the General tab, change the Control Type from CheckBox to
Radio Group.

6. Select the Properties tab.

7. Edit the Label field for the two buttons to Yes and No, respectively, and the Value field to true and
false.
8. Repeat step 5 to step 7 for the NeedXRay field.
9. Open the form for the Summary task. Delete the array fields, and arrange the remaining fields in
your preferred order.
10. Save the package.

Defining Which Sub-Process is Called


The script task Populate Array is where the logic occurs to set the exact sub-process that will be
selected at runtime.
Procedure
1. Double-click on the Populate Array script task.
2. On the General tab, set the language in the Script Defined As field to JavaScript.
3. Add the following JavaScript:
if (NeedXRay) {
TestCommentsArr.add(XRayComments);
DeptArr.add("XRAY");
ProcessIdentifierArr.add("XRayAppointment");
}

TIBCO Business Studio Tutorials

171
if (NeedBloodTest) {
TestCommentsArr.add(BloodTestComments);
DeptArr.add("BLOODTEST");
ProcessIdentifierArr.add("BloodTestAppointment");
}

4. Select the reusable sub-process task Book Appointment.


Click the
displays.

button by the Sub-process Name field. The Select Process or Process Interface dialog

5. Select Make Appointments Interface and click OK.


Click the
button by the Runtime Identifier Field field. The Select Data Field or Formal
Parameter dialog displays.
6. Select ProcessIdentifierArr. This is the field that holds the list of potential sub-processes to call.
Click OK.
7. In the Priority field, select Inherit from Parent process from the drop-down list.

TIBCO Business Studio Tutorials

172

8. Select the Map To Sub-Process tab. Map the input fields to the process interface as follows:

9. Map the output from the sub-process as follows:

Setting up the Summary Task


The Summary task presents a form which gives a summary of the patient information, including which
test or tests are necessary and the appointment times allocated. This information is set up by the Set
Appointment Time script task.
Procedure
1. Select the Set Appointment Time task.
2. In the Script Defined As field, select JavaScript.
3. Enter the following in the Describe Task Script field:
for (var ix = 0; ix < DeptArr.size(); ix++)
{
var test = DeptArr.get(ix);
if (test.toString() == "BLOODTEST") {
BloodTestAppointment = ApptTimeArr.get(ix);
} else if (test.toString() == "XRAY") {
XRayAppointment = ApptTimeArr.get(ix);
}
}

TIBCO Business Studio Tutorials

173

4. Save the project.

Generating the Business Service


You must produce a business service to use in running the project.
Procedure
1. Right-click on the Start Event of the Initial Consultation process, and select Business Service >
Generate . The business service displays. It contains:

A start event

A user task that will be used to collect the starting information

A send task to communicate with the business process

2. Change the Label of the business service to Patient Admissions.


3. Change the Business Category to DynamicSubProcTutorial/PatientAdmissions.
4. Select the user task and change its Label to Take Patient Details.
5. Click on the Interface tab of Take Patient Details , and click on the + icon on the right side of the
panel. From the pop-up select the data fields that need to be added.
6. Click on Add, and data fields get added to the Interface tab.

TIBCO Business Studio Tutorials

174

7. Uncheck the Mandatory checkbox for the following fields:

BloodTestComments

Complaint

NeedBloodTest

NeedXRay

XRayComments

8. In Project Explorer, expand the Patient Admissions business service, expand Data Fields, and click
on the NeedBloodTest field.
9. On the General tab for the field, expand Initial Value(s)... and select false.

TIBCO Business Studio Tutorials

175

10. Repeat this for the NeedXRay field.


11. Tailor the form for the Take Patient Details task, as described in Tailoring the Forms. Delete the
fields that are not defined as mandatory on the Interface tab for the task, and arrange the others in a
sensible order, as shown in the following illustration.

12. Save the completed process.

Deploying and Running the Process


You are now ready to deploy then run the DynamicSubProcTutorial process.
Deploying this project is similar to the deployment of the WelcomeUsers project described in the Create,
Deploy, and Run Your First BPM Application tutorial. Refer back to that tutorial for more detail on any of
the following steps.
Deploying the Processes
Procedure
1. Connect to your deployment server and deploy the HospitalOrgModel project.

TIBCO Business Studio Tutorials

176

2. Deploy the DynamicSubProcTutorial project.


a) At the Property Configuration dialog of the deployment wizard, you are prompted that
XYZEmail, the default Email instance defined in the system participant DefaultEMailSender,
does not exist on the node to which you are deploying.
b) Select the Value field for DefaultEMailSender and click Override.

c) Select an instance available on your server (in the example illustrated,


WPEmailChannelSMTPSharedResource) and click OK.
d) Click Finish and the project deploys.
Mapping Users to the Organization Model
Procedure
1. If you have not already done so, log into Openspace as the administrator. (The default username is
tibco-admin, with the password secret.)
2. In the Organization Browser, check that the hospital organization model has deployed. If not, select
version 4 from the Version drop-down list.
3. Create a new LDAP container, selecting EasyAs as the source.
4. Map users to the Diagnostic Nurse, Supervisor, Phlebotomy Secretary, and Radiography
Secretary positions in the Organization model.
See "How to Map Users to the WelcomeUsers Organization Model", one of the initial
WelcomeUsers tutorials, for details of how to create an LDAP container and map users.
Running the Process
Procedure
1. In the Business Services gadget, expand All Categories until you see PatientAdmissions. Start an
instance of that process. Fill in the form and press Submit.
2. Log in as the user you mapped to the Diagnostic Nurse position.
TIBCO Business Studio Tutorials

177

3. There is an Intake task in your ToDo list. Select this task and complete the form. Click:

The Yes button in the NeedXRay field

The No button in the NeedBloodTest field

4. Log in as the user you mapped to the Radiography Secretary.


5. There is an Allocate X-Ray Appointment task in your ToDo list. Select this task.
6. Select a date and time for the appointment from the gadget in the ApptTime field, and press
Submit.
7. Log in as the user you mapped to the Supervisor position.
8. There is a Summary task in your ToDo list. Select this task and review the form. Click Submit.
9. Run some more instances of the process, specifying Yes to NeedBloodTest or to both fields.

Verifying the Results


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the DynamicSubProcTutorialSolution.zip file, in the location where you installed TIBCO
Business Studio (for example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
The Import wizard is displayed.
3. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to the zip file and click Open.
The project is displayed in the Import wizard.
6. Click Finish.
The project is installed in your workspace.

TIBCO Business Studio Tutorials

178

Accessing External Data and Services


How to Call a Database From a Process
You can implement a call to a database from a business process application, and then deploy and test
that application.
Prerequisites
You should be familiar with the basics of designing, implementing and deploying process-based
applications using TIBCO Business Studio. If you are not familiar with these things, you should run
through the following tutorials before attempting this one:

How to Design a Simple WelcomeUsers Business Service

How to Implement and Deploy the WelcomeUsers Application

You should work through each section in turn to complete the tutorial.
You can use a service task to establish a JDBC connection to an external database and execute a
database operation - either a stored procedure, or a SQL query (a SELECT, INSERT, UPDATE or
DELETE statement).
For simplicity, this tutorial runs a very simple query against the BPM runtime database.

Importing the GetUserLoginName Analysis Project


To avoid having to build the process from scratch and to focus just on the steps involved in
communicating with a database, this tutorial provides a "work in progress" project as a starting point.
This project represents the process at the handover point from business analyst to solution designer:

The overall process, underlying business object model and organization model have all been
defined.

The data to be passed to and from the database has been defined.

The database service call needs to be implemented.

Importing the Business Process


Import the GetUserLoginName project to your TIBCO Business Studio workspace.
Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. To import the GetUserLoginName project into your workspace, find the getuserloginname.zip file
in the location where you installed TIBCO Business Studio (for example, STUDIO_HOME\studio
\3.n\samples).
3. In TIBCO Business Studio, choose File > Import . The Import wizard is displayed.
4. On the Select page, expand General, select Existing Studio Projects into Workspace and click
Next. The Import Projects page is displayed.
5. Click Select archive file, and click on the Browse button.
TIBCO Business Studio Tutorials

179

6. Browse to the zip file and click Open. The project is displayed in the Import wizard.
7. Click Finish. TIBCO Business Studio imports the GetUserLoginName project to your workspace.
The project contains the processes:
Result
Process

Description

GetUserName
(business service /
pageflow process)

This is a business service which, when started by a user:

GetLoginName
(business process)

Displays a form to get a fragment of a users name.

Invokes the GetLoginName business process, passing the users name


as input parameters.

This is a business process which, when invoked by the GetUserName


business service:

Looks up the supplied name fragment in the BPM runtime database.

Offers a user task to a member of the Customer Services


Representatives (Motor) position. The work item displays the users full
login name.
Note: Although this tutorial project uses a business service to collect
the data used as input to the web service, this is simply a convenience
to make it easy to run and test the application.

Importing the Organization Model


If you have not already done so in a previous tutorial, import the EasyAsExtendedOMSolution project
into your workspace.
This is the organization model that is referenced by the GetLoginName project that you have imported:
the participant User in the GetLoginName project is mapped to the position Customer Service
Representative (Motor) in the organization model.

Creating a Database Service Task


To call a database from a process, you use a Service task of type Database.
Procedure
1. Open the GetLoginName process.
2. Select the Get login name task.

TIBCO Business Studio Tutorials

180

3. On the Properties view, General tab, change the Activity Type from Task to Service Task. The
right-hand pane now displays a Service Type field.

4. Change the Service Type to Database.


5. Select the Operation that you want to execute on the database - in this case, SQL, to execute a SQL
query.
6. Enter the following query in the SQL field:

if the BPM runtime database uses SQL Server:


SELECT "name"
FROM "amxbpm"."de_resource"
WHERE "resourcetype" = 'H'
AND "name" LIKE ?

if the BPM runtime database uses Oracle or DB2:


SELECT "NAME"
FROM "DE_RESOURCE"
WHERE "RESOURCETYPE" = 'H'
AND "NAME" LIKE ?

If the BPM runtime database uses Oracle, change the attribute name in the business
object model to NAME. This is necessary because of Oracles case sensitivity.
This query will retrieve the login names of any users defined in the BPM runtime database
whose names include the string that is passed as an input to the query.
7. Save the process.

Setting up Data Inputs to and Outputs from the Database


Each input and output parameter defined in a SQL query must be mapped to a corresponding data
field or formal parameter in the process.
You must ensure that the data type of the process data field or parameter matches the data type of the
database parameter it is being mapped to.
TIBCO Business Studio does not validate this.

TIBCO Business Studio Tutorials

181

Procedure
1. On the Properties view for the Get login name task, Interface tab, note that the QueryName formal
parameter has been defined (during the analysis phase) as the input to the database call.
On the Database tab, click

to add a parameter to the service call.

Note that the Type field is (IN). This defines the parameter as an input parameter to the database.
In the Data Field field, click

. The Select Data Field or Formal Parameter dialog is displayed.

2. Select QueryName and click OK. QueryName is mapped to the Parameter 1 database input
parameter.
Click

again to add a second parameter to the service call.

3. Change the Type field to OUT. This defines the parameter as an output parameter from the
database.
In the Data Field field, click

. The Select Data Field or Formal Parameter dialog is displayed.

TIBCO Business Studio Tutorials

182

4. Select the ResultSet data field and click OK. The ResultSet field is mapped to the Parameter 2
database input parameter.

When the service call executes, the value of the QueryName data field will be sent to the database,
and the result set returned by the database will be stored in the ResultSet field.
The

icon to the right of the ResultSet data field indicates that ResultSet is an external

reference to a business object model class. If you want to examine this class, click
open the class in the Business Object Model editor

to

5. Save the project.

Creating a JDBC Resource Instance


A JDBC resource instance must exist in the BPM runtime before you can deploy the
GetUserLoginName application. This resource instance defines the connection information used by the
BPM runtime to contact the database.
There are several different types of resource instances. A JDBC resource instance must be used to
provide a connection to an external database.
If you do not have access to the Administrator interface in the BPM runtime, you will need to get an
administrator to perform this step for you.
Create a JDBC Resource Template
A resource template specifies configuration properties for resource instances.
Procedure
1. Log into the Administrator interface in the BPM runtime.
2. Click Shared Objects > Resource Templates .
Click New (

). The Add Resource Template dialog is displayed.

3. On the General tab, in the Name field, enter BPMDatabaseConnection.


4. In the Type field, select JDBC.
5. Set the Scope of the template by moving the slider to the far right, above Application. Select your
BPM environment (for example, BPMEnvironment) from the Environment dropdown, and then
select the name of your BPM application instance (for example, amx.bpm.app) in the Application
dropdown.
TIBCO Business Studio Tutorials

183

6. In the Connection Type field, select Direct. (You must use a Direct connection, not an XA
connection.)
7. In the Database Driver, Database URL and Login Credentials sections, enter the information
needed to connect to the BPM database. Contact your database administrator if you do not already
know this information.
8. Click Save. BPMDatabaseConnection is added to the list of resource templates.
Create and Install a Resource Instance
A resource instance represents a resource shared between applications. It is then available to
applications running on that nodein this case, to the GetUserLoginName application.
Click New Resource Instances (
). The New Resource Instances dialog is
displayed, showing values based on the BPMDatabaseConnection template.
Procedure
1. In the Instance Name field, change the displayed value to BPMDatabaseConnection.
In the Available Nodes area, select BPMNode, then click
to move it to the Selected Nodes area
- that is, the node to which you want to add the resource instance.
2. Click Save and Install. BPMDatabaseConnection is installed on the node BPMNode.
For more information about the specific information needed to configure a JDBC resource instance,
see the Administrator interface documentation for your BPM runtime environment.

Creating a System Participant


A system participant must be defined and assigned to the database service task. The system participant
must be configured to identify the BPM runtime JDBC resource instance that defines the connection to
the database.
Procedure
1. In Project Explorer, expand the GetLoginName process and create a new participant in the processlevel Participants folder. Name the participant DBConnection and make sure its type is System.
2. On the Properties view for the Participant, on the General tab, expand the Shared Resource entry.
Select the Jdbc radio button.
3. In the Instance Name field, enter BPMDatabaseConnection, which is the name of the BPM runtime
JDBC resource instance that defines the connection to the database.
Leave the Jdbc Profile Name field blank. (See the TIBCO Business Studio BPM Implementation guide
for information on the use of this field.)
4. Assign the DBConnection participant to the Get login name database service task.
5. Save the project.

Deploying the Application


As part of the deployment process, you map the system participant used by the database service task to
the appropriate JDBC resource instance.
Prerequisites
You must have created the XYZ Work Server1 Deployment Server, as described in the How to
Implement and Deploy the WelcomeUsers Application tutorial.
TIBCO Business Studio Tutorials

184
If you have already deployed the EasyAsExtendedOMSolution organization model as part of another
tutorial, you can skip Deploying the EasyAsExtendedOMSolution Organization Modeland go straight
to Deploying the GetUserLoginName Application.
The EasyAsExtendedOMSolution organization model is used by the user tasks in the GetLoginName
process that collect and display the data used in the database service call. It is not required to
implement the database service task itself.
Deploying the EasyAsExtendedOMSolution Organization Model
Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and click Deploy Module. The
Deploy Module(s) wizard is displayed.
2. Select Deploy BPM Project then click Next. The Select Project dialog is displayed.
3. Select EasyAsExtendedOMSolution as the project to deploy.
4. Click Next. There is a short pause while the necessary files generate and then the Administrator
Setup dialog is displayed.
5. Click Finish. The Progress Dialog is displayed while deployment takes place, and should indicate
that deployment has finished with no errors. Progress messages are also displayed in the Console
view.
6. Click OK.
7. In the Deployment Server view, expand XYZServer1 > BPMEnvironment > Applications . An
easyasextendedomsolution entry is displayed, indicating that the application has been deployed to
the BPM runtime.
Deploying the GetUserLoginName Application
Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and click Deploy Module. The
Deploy Module(s) wizard is displayed.
2. Select Deploy BPM Project then click Next. The Select Project dialog is displayed.
3. Select GetUserLoginName as the project to deploy.
4. Click Next. There is a short pause while the necessary files generate and then the Administrator
Setup dialog is displayed.

TIBCO Business Studio Tutorials

185

5. Click Next. The Property Configuration dialog is displayed. The list identifies the system
participants used in the process:

DBConnection1 is used by the Get login name database service task. Note that the value is
DBConnection1, rather than the name of the system participant, which is DBConnection.

HttpInboundConnectionConfig is used by the Start Event to expose the process as a


virtualized service to the GetUserName business service.
DBConnection1 is the name of a runtime substitution variable which TIBCO Business
Studio creates automatically from the DBConnection system participant name.
Using a substitution variable to identify the system participant makes it easy to
change the resource instance used by the application at runtime, without having to
redeploy the application.
See the Administrator interface documentation for your BPM runtime environment
for more information about substitution variables.

6. Click Finish. The Progress Dialog is displayed while deployment takes place, and should indicate
that deployment has finished with no errors. Progress messages are also displayed in the Console
view.
7. In the Deployment Servers view, expand XYZServer1 > BPMEnvironment > Applications . A
com.example.getuserloginname entry is displayed, indicating that the application has been
deployed to the BPM runtime.
8. In the Deployment Servers view, right-click XYZ Work Server1 and select Open > Administrator >
in web browser . The login screen for the Administrator interface in the BPM runtime is displayed.
9. Log in using an appropriate username and password.
10. Click Applications. The list of available applications is displayed.
11. Check that com.example.getuserloginname has deployed successfully. Its Runtime State should be
Running. Its Action Status should be Deploy with Start Successful.
12. Log out from Administrator.

Testing the Application


You can test the application by running an instance of it in Workspace.
For more information, refer:

How to Map Users to the WelcomeUsers Organization Model

How to Run the WelcomeUsers Application

Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and select Open > TIBCO
Openspace . The Openspace login screen is displayed.
2. Log in as user tibco-admin.
3. Open the Organization Browser.
4. If Organization Model - Version: 2 is not already displayed, select 2 from the Version dropdown
menu. This displays the organization model version that contains the
EasyAsExtendedOMSolution, and which is referenced by the GetUserLoginName application.
5. Map a user to the CustomerServiceRepresentativeMotor position.
6. Click Business Services.
7. Select and start the GetUserName business service.
TIBCO Business Studio Tutorials

186

8. A Get Users name form is displayed:


a) In the QueryName field, enter t%. This will find any login names that begin with "t".
b) Click Submit.
9. Log out.
10. Log into Workspace as the user you just added to the CustomerServiceRepresentativeMotor
position.
11. Click Process Views. Note that there is an ACTIVE instance of the GetLoginName process. (This
has been started by submitting the Get Users name form.)
12. Click ToDo List.
13. In your Work List, open the Display login name work item. The Display login names form is
displayed, and the Message field displays the values received from the BPM runtime database. This
list will include:

the default system administrator user, tibco-admin.

any other users who have login names that begin with "t". You will only see these if you have
already mapped or created those users as part of other work you have done on the system.

14. Click Submit.


15. Click Process Views. Note that the GetLoginName process instance has disappeared, indicating
that the process has successfully completed.
16. Log out.

How to Call an External Web Service From a Process


You can implement a call to an external web service in a business process application, and then deploy
and test that application.
An external web service is one that is hosted by an external application (that is, an application that is
not hosted in the BPM runtime).
You should work through each section in turn to complete the tutorial.
A process (acting as a service consumer) can invoke web service operations provided by other
processes or applications (service providers).
The process in this tutorial invokes a request-response operation to send a request message to a web
service and receive a response message back from it.

A concrete WSDL document that defines the request-response operation is provided by the web
service.

TIBCO Business Studio Tutorials

187
From this tutorial you will learn:

to use a service task to call an external web service from a business process, using a concrete WSDL
provided by the web service. See "Calling a Web Service" in the TIBCO ActiveMatrix BPM
Implementation Guide.

to import a WSDL into a project and associate it with a web service task. See "Using Web Services"
in the TIBCO ActiveMatrix BPM Implementation Guide.

to create and install an HTTP Client resource instance from a resource template, using the
Administrator interface in the BPM runtime.See "Exposing a Web Service" in the TIBCO
ActiveMatrix BPM Implementation Guide.

to map the system participant used by a web service task to a BPM runtime HTTP Client resource
instance. See "Calling a Web Service" in the TIBCO ActiveMatrix BPM Implementation Guide.

Prerequisites
You should be familiar with the basic concepts and principles involved in calling web services.
You should be familiar with the basics of designing, implementing and deploying process-based
applications using TIBCO Business Studio. If you are not familiar with these things, you should run
through the following tutorials before attempting this one:

How to Design a Simple WelcomeUsers Business Service

How to Implement and Deploy the WelcomeUsers Application

This tutorial implements a call to an Apache Axis2 web service called UKAddressService. Before you
begin, you must deploy this web service to a J2EE server (such as Apache Tomcat) that is running
version 1.4.1 of the Axis2 engine. To do this:
Procedure
1. Find the UKAddressService.zip file in the location where you installed TIBCO Business Studio.
2. Copy the zip file to a temporary directory and unzip it. It contains a single Axis2 web service
archive, UKAddressService.aar.
3. Deploy the UKAddressService.aar file to a J2EE server that is running the Axis2 engine, version
1.4.1.
See http://ws.apache.org/axis2/index.html for more information about Axis2.
4. Make sure that the UKAddressService web service has been properly deployed and is running.

Importing the FindAddress Analysis Project


To avoid having to build the process from scratch and focus just on the steps involved in calling a web
service, the tutorial provides a "work in progress" project as a starting point.
The project represents the process at the handover point from business analyst to solution designer:

The overall process and organization model have all been defined.

The data to be passed to and from the web service has been defined.

The web service call needs to be implemented.

Importing the Business Process

TIBCO Business Studio Tutorials

188

Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. To import the FindAddress project into your workspace, find the findaddress.zip file in the
location where you installed TIBCO Business Studio (for example, STUDIO_HOME\studio\3.n
\samples).
3. In TIBCO Business Studio, choose File > Import . The Import wizard is displayed.
4. On the Select page, expand General, select Existing Studio Projects into Workspace and click
Next. The Import Projects page is displayed.
5. Click Select archive file, and click on the Browse button.
6. Browse to the zip file and click Open. The project is displayed in the Import wizard.
7. Click Finish. TIBCO Business Studio imports the FindAddress project to your workspace. The
project contains processes:
Result
Process

Description

GetAddress (business
service / pageflow
process)

This is a business service which, when started by a user:

FindAddress
(business process)

Displays a form to get the users country and postal code.

Invokes the FindAddress business process, passing the country and


postal code as input parameters.

This is a business process which, when invoked by the GetAddress


business service:

Sends the received country and postal code to a remote web service
that provides an address lookup function.

Gets the address details back from the web service.

Offers a user task to a member of the Customer Services


Representatives (Motor) position. The work item displays the
customers full address details.
Note: Although this tutorial project uses a business service to collect
the data used as input to the web service, this is simply a convenience
to make it easy to run and test the application.

Importing the Organization Model


Use the same steps to download and import the project in the easyasextendedomsolution.zip file. The
EasyAsExtendedOMSolution project contains the organization model used by the FindAddress
process.

TIBCO Business Studio Tutorials

189

Importing the UKAddressService WSDL Document


To be able to call an external web service from a process, you must obtain the concrete WSDL defining
the web service, and import it into the Generated Services folder in your project.
Procedure
1. Open a web browser window and enter the URL:
http://IP_Address:port/axis2/services/UKAddressService?wsdl

where:

IP_address is the IP address of the system where the UKAddressService web service is running.

port is the port number on which the UKAddressService web service is listening (for example,
9090).

axis2 is the name of the directory where you installed the axis2 web services engine (for
example, axis2.war).
The concrete WSDL provided by the UKAddressService web service is displayed.

2. Save the page to your local file system as UKAddressService.wsdl.


If you are using Google Chrome as your browser, you may be offered the choice between
saving as xml or All files. Select xml to avoid creating an unnecessary xml-viewer
wrapper.
3. In Project Explorer, right-click the FindAddress project and choose Import > Import.... Expand
Service Registry and select Service Import Wizard. Click Next. The WSDL Import Wizard displays.
4. On the WSDL Selection page, click Import from a File, then click Next.
5. In the Source Location field, use the Browse button to select the UKAddressService.wsdl file.
6. Click Next. The Destination Selection page is displayed.
Click the
button next to the Project Location field. The Folder Picker dialog is displayed. Select
FindAddress/Generated Services if it is not already selected.
7. Click Finish.
After importing the WSDL file, TIBCO Business Studio displays an error:
"The Business Object Model asset needs to be configured for this project."

If you apply Quick Fix to this error, the Generated Services folder gets created.

Creating a Web Service Task


To call a web service from a process you use a Service task of type Web Service. The service task uses
the WSDL provided by the service to define its implementation details.
Procedure
1. Open the FindAddress process.
2. Select the Find address task.
3. On the Properties view, General tab, change the Activity Type from Task to Service Task. The
right-hand pane now displays a Service Type field.

TIBCO Business Studio Tutorials

190

4. Change the Service Type from Unspecified to Web Service. The right-hand pane now displays the
implementation fields for the web service. These allow you to define:

the Operation to be called.

the Endpoint Resolution for the web service.


In Project Explorer, expand the FindAddress projects Generated Services folder, select the
), then drag and drop it onto the Find
LookupAddress operation binding (
address task. TIBCO Business Studio automatically fills in the Operation and Endpoint
Resolution sections with the appropriate information from the WSDL file.
When you select LookupAddress, make sure that you select the concrete operation
binding rather than the abstract operation with the same name.

Setting up Data Inputs to and Outputs from the Web Service


Data fields (and/or formal parameters) must be used to define the inputs to and outputs from the web
service. The data fields must be mapped to the matching message input and output parts in the WSDL
document.
In Project Explorer, expand the Generated Services folder and double-click the
UKAddressService.wsdl file. The WSDL document is displayed in the WSDL Editor.

If the WSDL source view is displayed click the Design tab at the bottom of the WSDL Editor.
The WSDL document indicates that the service accepts a single input parameter (addressQuery) and
returns a single output parameter (address).
Procedure
1. Select the Find address service task.

TIBCO Business Studio Tutorials

191

2. In the Properties view for this task, click the Interface tab. Note the data that has been defined for
this activity (by the analyst, in order to hint at the correct data to send and assign):

postcode and country are defined as both inputs and outputs. The values of these fields should
be sent to the web service, then updated with the data returned by the web service.

addressLine1, addressLine2, city and province are defined as outputs. Values should be
assigned to these fields from the data returned by the web service.

3. In the Properties view, Input to Service tab, leave the Script Grammar set to JavaScript. Note that:

the right-hand side (service input parameters) has been automatically populated with the input
parameter defined in the WSDL file (addressQuery).

the left-hand side (process fields/formal parameters) has been automatically populated with
the data fields and formal parameters defined on the Interface tab of the Find address service
task.

4. Expand addressQuery, then click and drag the postcode data field on to the postalCode input
parameter to create a data mapping. When the process calls the web service, the value of postcode
will be passed to the web service.
Similarly, drag the country data field to the country input parameter.

5. In the Properties view, Output from Service tab, leave the Script Grammar set to JavaScript. Note
that the service output parameters (on the left-hand side) and process data fields (on the right-hand
side) have been similarly automatically populated.
On mapping tabs, the source of the data to be transferred is always on the left-hand side
and the target is always on the right-hand side
6. Expand address, then click and drag the different output parameters to their corresponding data
fields to create the required data mappings.

7. Save the project.

Setting Up a System Participant


When you assign a concrete WSDL to a web service task TIBCO Business Studio automatically creates a
system participant and assigns it to the web service task.
The system participant will, as part of the deployment process, be configured to identify a BPM
runtime HTTP Client resource instance that defines the connection to the web service. (You will create
this resource instance later in this tutorial.)
TIBCO Business Studio Tutorials

192
You do not need to configure the system participant. However, if you want to see its properties you
need to perform some steps.
Procedure
1. Select the AddressService_Consumer participant. (This participant is defined at the Package level.)
2. On the Properties view for the participant, General tab, expand the Shared Resource entry.

3. Change the HTTP Client Instance name to UKAddressWebService. You can if you prefer leave
this value unchanged, but you should keep a note of what name you do use here. One of the
following must apply:

The name matches an existing resource instance on the BPM runtime,

You subsequently use the TIBCO Administrator to create a resource instance that matches this
name,

During deployment you map this name to an existing resource instance with a different name.
See Deploying the Application for how to do this.

Creating an HTTP Client Resource Instance


An HTTP Client resource instance must exist in the BPM runtime before you can deploy the
FindAddress application. This resource instance defines the connection information used by the BPM
runtime to contact the UKAddressService web service.
There are several different types of resource instance. An HTTP Client resource instance must be used
to provide a connection to a web service.
To define a resource instance, you must use the Administrator interface in the BPM runtime to:
If you do not have access to the Administrator interface in the BPM runtime, you will need to get an
administrator to perform this step for you.
Create an HTTP Client Resource Template
A resource template specifies configuration properties for resource instances.
Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and select Open > Administrator >
in web browser . The login screen for the Administrator interface in the BPM runtime is displayed.
2. Log in using an appropriate username and password.

TIBCO Business Studio Tutorials

193

3. Click Shared Objects > Resource Templates .


Click New (

). The Add Resource Template dialog is displayed.

4. In the Type field, select HTTP Client.


5. In the Name field, enter UKAddressServiceTemplate.
If this does not match the Binding Details on the Properties view for the Participant. you will
need to override the discrepancy at deployment time.
6. Set the Scope of the template by moving the slider to the far right, above Application. Select your
BPM environment (for example, BPMEnvironment) from the Environment dropdown, and then
select the name of your BPM application instance (for example, amx.bpm.app) in the Application
dropdown.
7. In the Machine Name field, enter the IP address of the system where the UKAddressService web
service is running.
8. In the Port field, change the default value (80) to the port number on which the web service is
listening.
9. Click Save. UKAddressServiceTemplate is added to the list of resource templates.
Create and Install an HTTP Client Resource Instance
A resource instance represents a resource shared between applications. It is then available to
applications running on that nodein this case, to the FindAddress application.
This step assumes that you have created the XYZ Work Server1 Deployment Server, as described in the
How to Implement and Deploy the WelcomeUsers Application tutorial.
Click New Resource Instances (
). The New Resource Instances dialog is
displayed, with the Resource Template set to UKAddressServiceTemplate and the Type to Httpclient.
Procedure
1. In the Instance Name field, change the displayed value to UKAddressWebService.
2. In the Host column, click SystemHost.
In the Available Nodes area, select BPMNode, then click
to move it to the Selected Nodes area
- that is, the node to which you want to add the resource instance.
3. Click Save and Install. UKAddressWebService is installed on the node BPMNode.

Deploying the Application


As part of the deployment process, you map the system participant used by the web service task to the
HTTP Client resource instance you created earlier.
If you have already deployed the EasyAsExtendedOMSolution organization model as part of another
tutorial, you can skip and go straight to .
The EasyAsExtendedOMSolution organization model is used by the user task in the FindAddress
process. It is not required to implement the web service task itself.
Deploy the EasyAsExtendedOMSolution Organization Model

TIBCO Business Studio Tutorials

194

Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and click Connect, then click
Deploy Module.The Deploy Module(s) wizard is displayed.
2. Select Deploy BPM Project then click Next. The Select Project dialog is displayed.
3. Select EasyAsExtendedOMSolution as the module to deploy.
4. Click Next. There is a short pause while the necessary files generate and then the Administrator
Setup dialog is displayed.
5. Click Finish. The Progress Dialog is displayed while deployment takes place, and should indicate
that deployment has finished with no errors. Progress messages are also displayed in the Console
view.
6. Click OK.
7. In the Deployment Servers view, expand XYZServer1 > BPMEnvironment > Applications . A
com.example.easyasextendedomsolution entry is displayed, indicating that the application has
been deployed to the BPM runtime.
Deploy the FindAddress Application
Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and click Deploy Module. The
Deploy Module(s) wizard is displayed.
2. Select Deploy BPM Project then click Next. The Select Project dialog is displayed.
3. Select FindAddress as the module to deploy.
4. Click Next. The Administrator Setup dialog is displayed.

TIBCO Business Studio Tutorials

195

5. Click Next. The Property Configuration dialog is displayed.

The list identifies the system participants used in the process:

HttpInboundConnectionConfig is used by the Start Event to expose the process as a


virtualized service to the GetAddress business service.

For the outbound connection, the deployment process looks for a resource instance that
corresponds to the name of the system participant, which is UKAddressWebService.

6. If there are no errors, press Finish.

TIBCO Business Studio Tutorials

196

7. If a warning is displayed that no such instance is present, Select HttpOutboundConnectionConfig


and click Override. The Property value window displays. From the drop-down menu in the
Existing Resource Instance field, select the resource instance that you created earlier. In the example
illustrated below, this is UKAddressServiceInstance.

The Map through Substitution Variable box is checked.This creates a runtime substitution variable
named AddressService_Consumer1 from the AddressService_Consumer system participant name.
Using a substitution variable to identify the system participant makes it easy to change the resource
instance used by the application at runtime, without having to redeploy the application.
See the Administrator interface documentation for your BPM runtime environment for more
information about substitution variables.
This mapping defines that, at runtime, when the Find address web service task is executed, the call
is sent to the web service defined by the UKAddressServiceInstance resource instance. (The
mapping can be changed at runtime by reassigning the AddressService_Consumer1 substitution
variable to a different HTTP Client resource instance.)
8. Click Finish. The Progress Dialog is displayed while deployment takes place, and should indicate
that deployment has finished with no errors. Progress messages are also displayed in the Console
view.
9. In the Deployment Servers view, expand XYZServer1 > BPMEnvironment > Applications . A
com.example.findaddress entry is displayed, indicating that the application has been deployed to
the BPM runtime.
10. In the Deployment Servers view, right-click XYZ Work Server1 and select Open > Administrator in
web browser . The login screen for the Administrator interface in the BPM runtime is displayed.
11. Log in as user root.
12. Click Applications. The list of available applications is displayed.
13. Check that com.example.findaddress has deployed successfully. Its Runtime State should be
Running. Its Action Status should be Deploy with Start Successful.
14. Log out from Administrator.

TIBCO Business Studio Tutorials

197

Testing the Application


You can now test the application by running an instance of it in Workspace.
If you need more information about the steps in the given procedure, see the following tutorials:

How to Map Users to the WelcomeUsers Organization Model

How to Run the WelcomeUsers Application

Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and select Open > TIBCO
Openspace . The Openspace login screen is displayed.
2. Log in as user tibco-admin.
3. Click Organization. The Organization Browser displays.
4. If it is not already displayed, select Display Version: 2 from the Version dropdown menu. This
displays the organization model version that contains the EasyAsExtendedOMSolution, and which
is referenced by the FindAddress application.
5. Map a user to the CustomerServiceRepresentativeMotor position.
6. Click Business Services.
7. Select and start the GetAddress business service.
8. A Get User Details form is displayed:
a) In the country field, enter UK.
b) In the postcode field, enter SN2 8BL
c) Click Submit.
9. Click Process Views. Note that there is an ACTIVE instance of the FindAddress process. (This has
been started by submitting the Get user details form.)
10. Log out.
11. Log in again as the user you just added to the CustomerServiceRepresentativeMotor position.
12. Click Work Views (if it is not already selected).
13. In your Inbox, open the Display Address work item.
The Display message form is displayed, showing the full address details received from the
UKAddressService web service - 4 Apple Walk, Kembrey Park, Swindon, Wiltshire, SN2 8BL, UK.
14. Click Submit.
15. Click Process Views. Note that the FindAddress process instance has disappeared, indicating that
the process has successfully completed.
Process instances are removed from the Process Views when they complete, or when they
fail or are cancelled. You can use Event Views to find out more about what happened to a
process instance. See the Workspace Help for more information.
16. Log out.

Importing a Tutorial Solution


You can import the solution to the tutorial.

TIBCO Business Studio Tutorials

198

Prerequisites
Procedure
1. Find the FindAddressSolution.zip file in the location where you installed TIBCO Business Studio
(for example, STUDIO_HOME\studio\3.n\samples).
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to your local copy of the zip file and click Open. The project is displayed in the Import
wizard.
6. Click Finish. The project is installed in your workspace.

How to Call a Secured External Web Service From a Process


In order to perform to enable a business process application to call a secured external web service, you
need to perform some steps.
This tutorial will make you familiar with:

configuring the BPM runtime to call a particular secured external web service, by digitally signing
an outgoing SOAP message using (in this example) an X.509 certificate.

configuring a business process application to call that secured external web service, by assigning the
appropriate security policy to the system participant that identifies the web service endpoint.

There are no initial resources or solutions for this tutorial. The tutorial assumes that you already know
how to create a business process application to implement a call to an external web service, and then
how to deploy and test that application.
You should work through each section in turn to complete the tutorial.

The BPM runtime can be configured to provide message-level security when a business process
application invokes a secured external web service.

The BPM runtime implements the following message-level security mechanisms (defined by the
WS-Security specification):

Authentication - A security token is inserted into the outgoing SOAP message. The service
provider examines the token to validate the identity of the entity that is trying to invoke the
web service.

Integrity - The outgoing SOAP message is signed with an XML digital signature. The service
provider validates the signature to ensure that the message has not been changed in transit.

Specific security requirements are encapsulated in policy templates that are applied to business
process applications. Currently supported policies are:

Security Assertion Markup Language (SAML) "Sender Vouches" token, which provides Single
Sign-On (SSO).

X.509 certificate

UsernameToken

At design-time, the solution designer specifies the information that will be used by the calling
processthe policy template to be used and the specific runtime information required.

At runtime, an identity provider resource instance intercepts the outgoing message and enforces the
required policy with the appropriate runtime information.
TIBCO Business Studio Tutorials

199
Prerequisites

that you know how to implement a call to an external web service in a business process application,
and then how to deploy and test that application. If you are not already familiar with these topics,
run through the How to Call an External Web Service From a Process tutorial before attempting this
one.

that you are familiar with web service security concepts and techniques.

the use of an X.509 certificate.

For More Information


If you wish to call an external web service that is secured using a SAML "Sender Vouches" token or a
UsernameToken, you will need to follow similar steps to those described in this tutorial. Refer to the
Administrator interface documentation for your BPM runtime environment for more information.

Obtaining and Distributing the Required Security Credentials


The credentials needed to contact the secured service must be made available to both the BPM runtime
node (acting as the service consumer) and the system hosting the web service (the service provider):

The private key must be available on the BPM runtime node, so that the identity provider
application can use it to generate the necessary security information in the (outgoing) SOAP
message.

The associated public key/certificate must be available on the external system hosting the web
service, so that the service can use it to validate the security information received in the (incoming)
SOAP message.

Depending on the scenario, these credentials may be generated and distributed by either party. For this
example, we assume that the service provider has:

generated the credentials required to access the service (as a private key/certificate entry in its
keystore).

stored the corresponding public key/certificate in its own trusted store.

given a copy of the keystore file containing the private key to the BPM runtime administrator, who
has copied it to the BPM runtime node.

You do not need to do anything further. As background information, the following sections provide
examples of the commands required to create and distribute the necessary credentials to both parties,
using the Java keytool utility.
For detailed information about these commands and options refer to the documentation for the Java
keytool utility.
Generating a Keypair
The example command can be used to generate a key pair (a public key and associated private key) for
the X.500 Distinguished name CN=Clint Hill, OU=Claims, O=EasyAs Insurance, L=Swindon,
C=UK.
The command also wraps the public key into an X.509 v1 self-signed certificate, which is stored as a
single-element certificate chain. This certificate chain and the private key are stored in a new keystore
entry identified by the alias bskey with password EAkey1, in the keystore c:\apps\bs.jks.
C:\Users\Administrator>keytool -genkeypair -dname "cn=Clint Hill, ou=Claims,
o=EasyAs Insurance, l=Swindon, c=UK" -alias bskey -keypass EAkey1 -keystore c:\apps
\bs.jks -storepass EAStore2 -validity 360 -keyalg "RSA"

The following command can be used to list the contents of the bskey entry.
TIBCO Business Studio Tutorials

200
C:\Users\Administrator>keytool -list -keystore c:\apps\bs.jks -alias bskey -v Enter
keystore password: Alias name: bskey Creation date: 01-Sep-2010 Entry type:
PrivateKeyEntry Certificate chain length: 1 Certificate[1]: Owner: CN=Clint Hill,
OU=Claims, O=EasyAs Insurance, L=Swindon, C=UK Issuer: CN=Clint Hill, OU=Claims,
O=EasyAs Insurance, L=Swindon, C=UK Serial number: 4c7e6e6b Valid from: Wed Sep 01
16:16:59 BST 2010 until: Sat Aug 27 16:16:59 BST 2011 Certificate fingerprints: MD5:
FF:0B:67:D6:59:1A:87:38:BB:84:19:4A:C9:9E:C2:C3 SHA1: E3:92:E1:4F:8A:EA:6D:A7:90:2D:
36:FC:40:90:48:EF:71:2B:BC:33 Signature algorithm name: SHA1withRSA Version: 3

Exporting the Certificate


The command can be used to export the self-signed certificate for the bskey alias from the keystore to a
file called bskey.cert.
C:\Users\Administrator>keytool -export -file bskey.cert -keystore c:\apps\bs.jks alias bskey -v Enter keystore password: Certificate stored in file <bskey.cert>

Importing the Certificate into the Host Systems Truststore


The bskey.cert file can now be imported into the web service providers truststore as a trusted
certificate.
The command could be used to accomplish this (on the system that hosts the web service).
C:\Users\Administrator>keytool -import -file bskey.cert -keystore c:\apps
\bstrust.jks -alias bskey -v Enter keystore password: Re-enter new password: Owner:
CN=Clint Hill, OU=Claims, O=EasyAs Insurance, L=Swindon, C=UK Issuer: CN=Clint Hill,
OU=Claims, O=EasyAs Insurance, L=Swindon, C=UK Serial number: 4c7e6e6b Valid from:
Wed Sep 01 16:16:59 BST 2010 until: Sat Aug 27 16:16:59 BST 2011 Certificate
fingerprints: MD5: FF:0B:67:D6:59:1A:87:38:BB:84:19:4A:C9:9E:C2:C3 SHA1:
E3:92:E1:4F:8A:EA:6D:A7:90:2D:36:FC:40:90:48:EF:71:2B:BC:33 Signature algorithm
name: SHA1withRSA Version: 3 Trust this certificate? [no]: yes Certificate was added
to keystore [Storing c:\apps\bstrust.jks]

Creating a Keystore Provider Resource Template


A keystore provider resource instance provides a reference to the keystore that contains the keypair
required to invoke the secured web service. You will create a keystore provider resource template, and
then a corresponding resource instance will be created automatically when you redeploy the BPM
application.
Procedure
1. Log into the Administrator interface in the BPM runtime.
2. Click Shared Objects > Resource Templates .
Click New (

). The Add Resource Template dialog is displayed.

3. In the Type field, select Keystore Provider.


4. In the Name field, enter a suitable name for this resource template - for example, bsKeystoreRT.
5. Set the Scope of the template by moving the slider to the far right, above Application. Select your
BPM environment (for example, BPMEnvironment) from the Environment dropdown, and then
select the name of your BPM application instance (for example, amx.bpm.app) in the Application
dropdown.

TIBCO Business Studio Tutorials

201

6. Edit the following properties:

Keystore Served From: Identify the keystore that contains the credentials needed to access the
external web service. You can either upload the keystore to be served from the Administrator
interface in the BPM runtime; or you can enter the external location of the keystore, either as a
URL or as a pathname to a file.
If you specify a pathname, it must be to a file that exists locally, on the same server as
the runtime environment.

Password: Enter the password needed to access the keystore.

Type: Select JKS (for Java Keystore).

Provider: Clear this field and leave it blank.

7. Click Save. The new resource template is added to the list of resource templates.

Creating an Identity Provider Resource Template


An identity provider resource instance provides a reference to the specific keypair (via its alias)
required to invoke the secured web service. You will create an identity provider resource template, and
then a corresponding resource instance will be created automatically when you redeploy the BPM
application.
Creating the Identity Provider Resource Template
This procedure describes how to create an identity provider resource template
Procedure
1. Create a new resource template, of type Identity Provider, with a suitable name - for example,
bsSubjectRT.
2. Set the Scope of the template to your BPM application instance (for example, amx.bpm.app) .
3. Edit the following properties:

Keystore Provider to Supply Identity: Enter (or use the picker tool to select) the name of the
Keystore Provider resource template that you created earlier - for example, bsKeystoreRT.

Enable Access to Credential Store Containing Identity: Select this option.

Key Alias to Access Identity: Enter the name of the alias specified when generating the
required keypair (using the -alias option) in the keystore - for example bskey.

Key Alias Password: Enter the password specified when generating this alias (using the option).

keypass

Creating the Resource Instances


Resource instances based on the new resource templates are created automatically when you redeploy
the application for which the template is scoped.
Procedure
1. Select Applications and select your instance of the BPM application (by default, amx.bpm.app).
2. Select Deploy > Deploy with Start .
3. Select the Resource Templates tab and click on Resource Instances. Instances of your new Keystore
Provider and Identity Provider resource templates have been created.
TIBCO Business Studio Tutorials

202

Configuring the System Participant in the Calling Process


To invoke the secured external web service from the calling process, you must assign the security
policy that will be applied to the outgoing message sent by the task or event to the system participant
that identifies the web service endpoint.
There are no initial resources or solutions for this tutorial. The tutorial assumes that you already know
how to create a business process application to implement a call to an external web service, and then
how to deploy and test that application.
Procedure
1. In TIBCO Business Studio, open the process that will be used to call the secured external web
service.
2. In Project Explorer, select the system participant that identifies the web service endpoint. This is
typically the participant with the same name as the web service being called.
3. On the General tab of the Properties view for this participant, expand Shared Resource. If it is not
already selected, in the Invoke Using column select SOAP over HTTP.
4. In the Policy Type field, select X509 Token from the drop-down menu.
To call an external web service that is secured using:
a SAML "Sender Vouches" token, you would select SAML Token instead.

a UsernameToken, you would select Username Token instead.

5. In the Governance App. Name field, enter the name of the BPM runtime identity provider resource
instance that you created earlier, bsKeystoreRT. This application will be used to apply the required
policy to the outgoing SOAP request.
The value of this field is not an actual resource instance, but an application that references
the required resource instance. The purpose of the application is to inject the resource
instance into policies that require it.

How to Call a BPM Runtime Service from a Process


This tutorial shows you how to call a service provided by the BPM runtime from a BPM process.
The tutorial demonstrates:

how to identify and obtain the WSDL for the BPM service that you want to call.

how to call a particular operation provided by a BPM service.

how to identify and prepare the data to be sent to the BPM service.

how to process data returned by the BPM service.

how to ensure that the call satisfies the authentication and authorization requirements needed to
access a BPM service.

Prerequisites
You should be familiar with the topics:

calling secured web services over SOAP/HTTP

the services and operations provided by the BPM API

creating shared resources using the Administrator interface in the BPM runtime.

TIBCO Business Studio Tutorials

203
See the following references for more information:

How to Call an External Web Service From a Process

How to Call a Secured External Web Service From a Process

BPM Developers Guide

Before You Start


Import the callLookupUser project into your workspace from the location where you installed TIBCO
Business Studio. (This is an archived project, for example, STUDIO_HOME\studio\3.n\samples
\callLookupUser.zip).
The callLookupUser project contains the following process.

This is a business service which can be used to find and display a users Global Unique IDentifier
(GUID).
Error markers are displayed on some steps in the process. As you perform the tutorial tasks these error
markers will disappear.
When you start the business service, it:

displays a form in which you should enter a users login name.

initializes the data required by the lookupUser request message.

calls the lookupUser operation, provided by the EntityResolverService in the BPM runtime.

extracts the users GUID from the lookupUser response message.

displays another form showing the users name and GUID.

This is a deliberately simplistic scenario and displaying a users GUID is not intended to be, of itself,
particularly useful. However:

It demonstrates the essential requirements of making a call to any BPM service.

A users GUID is required as an input parameter to many other operations provided by the BPM
runtime - for example, if you use the getWorkListItems operation to get a users work list. You may
want to call lookupUser as part of a sequence of calls to achieve a particular business result.

TIBCO Business Studio Tutorials

204

Importing the WSDL that Defines the Required BPM Service


See the BPM Developers Guide for detailed information about the services and operations provided by
the BPM runtime, and the WSDLs and XSDs needed to access them.

You can access the WSDL for a particular BPM service in two ways:

You can generate it directly from the Administrator interface in the BPM runtime. Data types
used by this WSDL are defined in an embedded schema.

You can use the BPM public web service API. Data types used in the WSDL files are defined in
external, shared XSDs. (See the BPM Developers Guide for more information about how to obtain
the BPM public web service API.)

If you are developing:

a large application that needs to access multiple BPM services, using the BPM public web
service API may be preferable.

a lightweight application that accesses only a limited number of services, using generated
WSDLs may be preferable. (This prevents namespace clashes within the workspace if the same
common schema is included in two of the WSDLs.)
This tutorial uses only a single BPM service, so uses a generated WSDL.

When you import BPM WSDLs into your Workspace, TIBCO recommends that you put them in
their own project (or projects), separate from projects containing the processes that will use them.
This will reduce overhead when process projects are built.

Generating the WSDL for the EntityResolverService


Procedure
1. Log in to the Administrator interface in the BPM runtime.
2. Click the Applications tab.
3. In the Name column, expand the BPM application folder (by default this is called amx.bpm.app).
4. Expand the System folder and click on the BPM application, which has the same name as the
application folder. Information about the BPM application displays in the bottom pane.
5. On the General tab, expand the BPM application.
6. Expand EntityResolverService_version, then select EntityResolverService.soap. The details for this
binding are displayed.

TIBCO Business Studio Tutorials

205

7. Click the appropriate row in the Node Name column (by default, BPMNode), then click Generate
WSDL.

The WSDL for the EntityResolverService is displayed in a new browser window.


8. Copy the browser windows URL, for example:
http://10.100.87.112:8120/amxadministrator/generate_wsdl?
svc_binding_id=158&svc_binding_name=EntityResolverService.soap&svc_node_id=2&svc_
node_name=BPMNode

Importing the EntityResolverService WSDL into the Project

TIBCO Business Studio Tutorials

206

Procedure
1. In TIBCO Business Studio, create a new BPM Developer project to hold WSDLs for the BPM
runtime:

Call the project bpmRuntimeWSDLs.

In the Asset Type Selection dialog, you only need to include Business Object Model and
Service Descriptors assets in the project.

2. In Project Explorer, expand bpmRuntimeWSDLs, right-click Service Descriptors and choose


Import > Service Import Wizard. The WSDL Import Wizard displays.
3. On the WSDL Selection page, click Import from a URL, then click Next.
4. In the URL field, paste in the URL of the browser window in which you generated the WSDL for
the EntityResolverService.
5. Click Next. The Destination Selection page is displayed:

Use the default bpmRuntimeWsdls/Service Descriptors value as the Project Location.

Change the File Name to entityResolverService.wsdl.

TIBCO Business Studio Tutorials

207

6. Click Finish. The WSDL file is added to the Service Descriptors folder of the bpmRuntimeWSDLs
project.

A number of files are also generated in the Generated Business Objects folder.

TIBCO Business Studio Tutorials

208

7. Examine the contents of the Generated Business Objects folder. This contains the Business Object
Model representations of the imported service, its operations and associated schema objects.

TIBCO Business Studio Tutorials

209

Configuring the Web Service Call


You must use a web service task to call a BPM service.
You must use a SOAP/HTTP binding to call a BPM service. Currently, you cannot use other bindings
for the following reasons:

SOAP/JMS: BPM services are not exposed on SOAP/JMS bindings.

Virtualization: A security policy must be applied to the outgoing call to authenticate the calling
user. You cannot apply such a policy on a virtualized binding.

You must identify the calling user. The calling user is identified by an Identity Provider application
referenced by the system participant that is used by the call - see Configuring how the Call will be
Authenticated. The BPM runtime will only accept the call to the service if it can authenticate the
calling user as a valid BPM user.
The calling user is NOT the user who is running the process from which the call is being
made. Although different users may run the same process, the call to the BPM service will
always be made using the same fixed identity of the user specified by the Identity
Provider application.
This tutorial uses Clint Hill as the calling user. This is a user provided by the sample EasyAs
organization model, used in earlier tutorials.

The calling user can be authenticated using either an X509 Token, Username Token or SAML Token
- which one you use will depend on the security configuration used by the BPM runtime.

The calling user must also be authorized to execute any system actions that are required by the
particular operation being called. This authorization is determined by the privileges held by the
calling user.
See the BPM Developers Guide for more information:

The description of each operation lists any system actions required to execute that operation.

The "System Actions Reference" appendix describes how required privileges can be assigned to
system actions by configuring the organization model.
For example, lookupUser requires the resolveResource system action. By default,
resolveResource can be can be performed by any user (for example, Clint Hill) without them
having to hold specific privileges.

Calling the lookupUser Operation

TIBCO Business Studio Tutorials

210

Procedure
1. Expand the bpmRuntimeWsdls project and select the lookupUser operation.
When you select lookupUser, make sure that you select the concrete operation binding
rather than the abstract operation that has the same name.

2. Drag and drop the operation on to the Call LookupUser service task. TIBCO Business Studio
automatically fills in the Operation and Endpoint Resolution sections with the appropriate
information from the WSDL file.
Identifying the Shared Resource to be Used to Call the Service
Procedure
1. Select the EntityResolverservicesoap_Consumer participant. (This participant is defined at the
Package level.)
2. On the Properties view for the participant, General tab, expand the Shared Resource entry.
3. Change the HTTP Client Instance name to callLookupUser. (You will create a matching HTTP
Client resource instance on the BPM runtime later in the tutorial - see Configuring Shared Resources
to Call the BPM Service.)
Configuring how the Call will be Authenticated
Procedure
1. On the Properties view for the EntityResolverService_soap_Consumer participant, General tab,
expand the Shared Resource entry.
2. In the Policy Type field, select X509 Token from the drop-down menu. This defines that an X509
certificate will be used to authenticate the identity of the calling user in the outgoing message.
3. In the Governance App. Name field, enter calllookupUserIPapp. This is the name of an identity
provider application on the BPM runtime that will be used to:
a) obtain the identity of the user on whose behalf the call is being made.
b) sign the SOAP header of the outgoing message with that users X509 public certificate.
You will create the calllookupUserIPapp identity provider application later in the tutorial - see
Configuring Shared Resources to Identify the Calling User.

TIBCO Business Studio Tutorials

211

Configuring Input Parameters


You must create and/or initialize suitable data fields and map them to the appropriate input
parameters.

All required parameters must be passed to the called operation.

All data that is passed to the operation must have been initialized earlier in the process. If an
uninitialized data field is passed to the operation the service call will fail, causing the process to
terminate with an error.

The input parameters required by the lookupUser operation are shown on the right-hand side of the
Input to Service tab of the Call lookupUser operation service task. You can find more information
about these parameters in two ways:

See the "lookupUser" section in the EntityResolverService chapter of the BPM Developers Guide.

Open the entityResolverService.wsdl in the bpmRuntimeWsdls project. The source view contains
xs:documentation elements that provide descriptions of the operation and its parameters.

The following diagram shows the schema of the input parameters.

For the purposes of this tutorial, you will need to pass the name and get-detail parameters to the call.
(get-detail is required because the users GUID is part of the detail element in the response message see Processing Output Data.)
Creating Required Data Fields
Create a process-level data field called getDetail, of type Boolean.
A userName field already exists in the project.
Initializing Input Data
The userName field will be initialized in the Get users name user task.
To initialize getDetail, edit the script in the Initialize call script task as follows:
// Set up the parameters for the lookupUser request message
// Return the userDetail element in the response message.
getDetail = true;

As this example is very simple, you could achieve the same result by omitting the script step and
setting true in the Initial Value field for the getData data field. However, the script step has been
included as more complex examples may need scripting at this point to initialize data.

TIBCO Business Studio Tutorials

212

Configuring Input Mappings


Data fields must be mapped to parameters.
Procedure
1. Select the Call lookupUser operation service task.
2. In the Properties view, Input to Service tab:
a) map the userName data field to the name parameter.
b) Map the getDetail field to the get-detail parameter.

c)

Processing Output Data


You must create and/or initialize suitable data fields and map them to the appropriate output
parameters.
In many cases, you may then need to use Business Data Service (BDS) scripting to access, extract and
process particular pieces of data from within the data objects returned by the call.
The output parameter returned by the lookupUser operation is shown on the left-hand side of the
Output from Service tab of the Call lookupUser operation service task.

TIBCO Business Studio Tutorials

213

Like the input parameters, you can refer to the BPM Developers Guide and/or
entityResolverService.wsdl to find more information about the output data returned by the
lookupUser operation. The following diagram shows the schema of the response parameter.
Creating Required Data Fields
Procedure
1. Create a lookupUserResponse data field. This field:

will be used to hold the contents of the response output parameter.

must be the same type as the response output parameter (as shown on the Output from Service
tab of the Call lookupUser operation service task). This type is lookupUserResponseType,
which is an external type available in the generated business objects that were created earlier
when you imported the EntityResolverService WSDL
When you create the data field, you can use the Select Type dialog to easily find and
select the correct type. (Enter lookup in the search box to filter the results.)

TIBCO Business Studio Tutorials

214

2. Similarly, create a data field called userDetail, of external type XMLEntityDetail. This field will be
used in the Process response script to access the individual detail elements contained in the
lookupUserResponse data field. (See in this section.)
Configuring Output Mappings
Procedure
1. Select the Call lookupUser operation service task.

2. In the Properties view, Output from Service tab, map the response output parameter to the
lookupUserResponse data field.

Processing the Output Data


Edit the script in the Process response task as follows.

TIBCO Business Studio Tutorials

215

// Extract the user's GUID from the lookupUser response message


// Set a default value for userGUID to display if the user is not found
//
userGUID = "unknown user";
// Iterate through the list of returned detail elements. (The list should only
// contain a single response
//
for (var iterator = lookupUserResponse.detail.listIterator();iterator.hasNext();)
{
// Populate userDetail with the current user's details
userDetail = iterator.next();
// Extract the current user's GUID
userGUID = userDetail.guid;
}

Configuring Shared Resources to Call the BPM Service


You must create an HTTP Client resource instance that the process can use to call the BPM service.
You will create an HTTP Client resource template, and then a corresponding resource instance will be
created automatically when you redeploy the BPM application.
Creating an HTTP Client Resource Template
In order to create an HTTP Client Resource Template you will have to do some settings in the
Administrator interface in the BPM runtime.
Procedure
1. Click Shared Objects > Resource Templates .
2. Click New. The Add Resource Template dialog is displayed.
3. In the Type field, select HTTP Client.
4. In the Name field, enter callLookupUser.
If this does not match the Binding Details on the Properties view for the Participant, you will
need to override the discrepancy at deployment time.
5. Set the Scope of the template by moving the slider to the far right, above Application. Select your
BPM environment (for example, BPMEnvironment) from the Environment dropdown, and then
select the name of your BPM application instance (for example, amx.bpm.app) in the Application
dropdown.
6. Change the Port field value to 8080.
7. Click Save. callLookupUser is added to the list of resource templates.
8. The resource instance is created during the next procedure see Creating the Resource Instances.

TIBCO Business Studio Tutorials

216

Configuring Shared Resources to Identify the Calling User


The diagram shows the shared resources that you need to configure to identify the calling user to the
BPM runtime for authentication (by inserting the appropriate web security token in the SOAP header of
the outgoing message).

Creating a Keystore
This tutorial uses a sample keystore supplied with the BPM runtime. The sample keystore contains X.
509 authentication information for the user Clint Hill.
External tools and processes must be used to create, obtain and distribute keystores and the data they
contain. See "Obtain and Distribute the Required Security Credentials" in How to Call a Secured External
Web Service From a Process for more information.
Creating a Keystore Provider Resource Template
Use a resource template to create an instance of type Keystore Provider.
Procedure
1. Create a new resource template with the following properties:

Type: Keystore Provider

Name: LookupUserKP

TIBCO Business Studio Tutorials

217

2. Set the Scope of the template by moving the slider to the far right, above Application. Select your
BPM environment (for example, BPMEnvironment) from the Environment dropdown, and then
select the name of your BPM application instance (for example, amx.bpm.app) in the Application
dropdown.
3. Edit the following properties:

Location of keystore: Use the location of the sample keystore, which is CONFIG_HOME\bpm
\amx.bpm.app\keystores\amx-bpm-wss-keystore.jks (where CONFIG_HOME is, for example, C:
\ProgramData\amx-bpm\tibco\data). This keystore contains X.509 authentication details for
the user Clint Hill, who is defined in the EasyAs LDAP directory.

Password: Enter the password needed to access the keystore. (By default this is password.)

Type: Select JKS (for Java Keystore).

Provider: Clear this field and leave it blank.

4. Click Save. The new resource template is added to the list of resource templates.
Creating an Identity Provider Resource Instance
Use a resource template to create an instance of type Identity Provider.
Procedure
1. Create a new resource template with the following properties:

Type: Identity Provider

Name: calllookupUserIPapp

2. Edit the following properties:

Keystore Provider to Supply Identity: Use lookupUserKP.

Enable Access to Credential Store Containing Identity: Select this option.

Key Alias to Access Identity: Enter chill. This is the alias needed to access the private key for
Clint Hill in the keystore.

Key Alias Password: Enter password. This is the password for this alias.

Creating the Resource Instances


Resource instances based on the new resource templates are created automatically when you redeploy
the application for which the template is scoped:
Procedure
1. Select Applications and select your instance of the BPM application (by default, amx.bpm.app).
2. Select Deploy > Deploy with Start .
3. Select the Resource Templates tab and click on Resource Instances. Instances of your new HTTP
Client resource template, keystore provider resource template, and identity provide resource
template have been created.

Deploying and Testing the callLookupUser Application


You should be able to deploy and successfully run the callLookupUser application.

TIBCO Business Studio Tutorials

218

Procedure
1. Deploy the callLookupUser project to the server where the EntityResolverService is running.
2. Log in to Openspace as user tibco-admin.
3. Using the Organization Browser, make sure that:

an LDAP container exists that uses the easyAs LDAP source. (See "Create an LDAP Container"
in the Create, Deploy, and Run Your First BPM Application > How to Map Users to the WelcomeUsers
Organization Model tutorial for more information.)

Clint Hill and at least one other user from this container are valid BPM users (that is, created as
resources).
If Clint Hill is not a valid BPM user, the process will fail when the Call lookupUser
operation task is invoked.

4. Click Business Services.


5. Select and start the callLookupUser/callLookupUser business service. The Get Users Name form
is displayed.
6. Enter Clint Hills login name and click Submit.
The Display Users GUID form is displayed, showing the name submitted and the GUID
associated with that name.
7. Click Submit to finish the process.
8. Run the business service again with different data. The following table shows the expected results.
User name

GUID Displayed

Notes

a valid BPM user

users GUID

The lookup user call finds the user. The users GUID is
displayed.

this_string

unknown user

No matching user is found by the lookupUser call so no


detail elements are returned. The default userGUID
value is displayed.

Clint*

unknown user

Wildcards are not supported by the lookupUser name


parameter. The user name entered must be an exact
match. No matching user is found by the lookupUser
call so no detail elements are returned.

How to Call a Virtualized Service from a Process


A virtualized service is a web service provided by an application that is hosted in the BPM runtime.
(For information on calling a web service that is not hosted in the BPM runtime, see the tutorial How to
Call an External Web Service from a Process.)
The application being called to provide the service can itself be another BPM process that is exposing
one or more service operations, or can be an SOA application. In this tutorial, the service provider is a
BPM process.
This tutorial example is a simple request and response service. The consumer project requests datain
this simple example, a forename and a surnamefrom the user and passes it to the service provider.
The provider processes that data (in this case, concatenates the two data strings into a name) and
returns it to the consumer process.
You should work through each section in turn to complete the tutorial.
TIBCO Business Studio Tutorials

219
A business process (acting as a service consumer) can invoke services provided by other BPM processes
or SOA applications (service providers).
An abstract WSDL document that defines the service is provided by the service provider.
Prerequisites
You should be familiar with the basics of designing, implementing and deploying process-based
applications using TIBCO Business Studio. If you are not familiar with these things, you should run
through the following tutorials before attempting this one:

Create, Deploy and Run Your First BPM Application

How to Create Business Data

How to Call an External Web Service from a Process

Importing the Organization Model


A participant in the service consumer project in this tutorial references an organization model. The
organization model must be available in your TIBCO Business Studio workspace, and later must be
deployed to your BPM runtime.
If you have not already done so, import the EasyAsExtendedOM project into your workspace. To do
this:
Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. To import the EasyAsExtendedOM project into your workspace, find the
EasyAsExtendedOMSolution.zip file in the location where you installed TIBCO Business Studio
(for example, <STUDIO_HOME > \studio\3. n\samples).
3. In TIBCO Business Studio, choose File > Import . The Import wizard is displayed.
4. On the Select page, expand General, select Existing Studio Projects into Workspace and click
Next. The Import Projects page is displayed.
5. In the Select archive file field, Browse to EasyAsExtendedOMSolution.zip and select it. The
EasyAsExtendedOMSolution project appears in the list of Projects.
6. Select the project (if it is not already selected).
7. Select Copy projects into workspace (if it is not already selected).
8. Click Finish. TIBCO Business Studio imports the EasyAsExtendedOMSolution project to your
workspace. The organization model is now ready for use.

Creating the Service Provider Project


First create the project that will provide the virtual service. This can be a BPM or an SOA project. This
tutorial uses a BPM project.
Procedure
1. Select File > New > BPM Developer Project .
2. Call the project ServiceProvider.
3. Select BPM as the Destination Environment, and click Next.

TIBCO Business Studio Tutorials

220

4. On the Asset Type Selection page, deselect Emulations and click Next.
5. The Business Object Model page displays. In the Filename field, name the model
ServiceProvider.bom. Click Next.
6. At the Business Processes page, name the process package SPProcessPackage.xpdl and click Next
twice.
7. At the Select Template page, expand Business Process Templates and select Simple Process.
8. Click Finish.
Result
This creates a project containing:

A blank business object model.

A business process containing a Start and an End event, and a single task.

Creating the Business Objects in the Provider Project


The business model for the service provider project contains business objects that represent the request
and response passed by the service.
Procedure
1. Open the ServiceProvider.bom business object model.
2. Create a class called Request.
3. Add to the class two attributes called Forename and Surname. Leave both as the default type Text
and the default multiplicity of 0..1.
4. Create a second class called Response, with a single attribute called Combined Name.

5. Save the business object model. The business object model saves separately from the process
package, so make sure that the asterisk indicating changes has disappeared from the business object
model tab title, or you will experience errors later in the tutorial.

Defining the Business Process in the Provider Project


Rename and configure the business process.

TIBCO Business Studio Tutorials

221

Procedure
1. Open the Business Process(SPProcessPackage-process) business process.
2. Relabel it as Service Provider Process.
3. Select the Start event.
4. In the General tab of the Properties view, change the Trigger Type to Message.
5. Select the single task in the process.
6. In the General tab of the Properties view, change the Activity Type to Script Task.
7. Change the Label to Set Response.
8. Save the project.

Defining the Provider Project Parameters


You need to define the parameters used by the service provider project.
Procedure
1. In Project Explorer, select Parameters in the Service Provider Process.
In the Properties view, click

to create a parameter.

2. Set the values as:

Label as myRequest

Mode as In

Type as External Reference

3. Click the Browse button in the External Reference field and map the myRequest parameter to the
Request object in the business object model.
4. Create a second parameter called myResponse. Define this as an Out parameter and as External
Reference.

5. Map the myResponse parameter to the Response object in the business object model.
6. Save the project.

Defining the Task Script


A script defines how the data entered by the user is processed.
Procedure
1. Select the Set Response script task.
2. On the General tab of the Set Response task, select JavaScript from the drop-down list in the Script
Defined As: field.

TIBCO Business Studio Tutorials

222

3. In the Describe Task Script: field, type:


myResponse = com_example_serviceprovider_Factory.createResponse();
myResponse.combinedName = myRequest.forename + " " + myRequest.surname;

4. Select the End event and on the General tab set the Result Type to Message.

Creating the Service Consumer Project


Create the second BPM project that will consume the virtual service.
Procedure
1. Select File > New > BPM Developer Project .
2. Call the project ServiceConsumer.
3. Select BPM as the Destination Environment, and click Next.
4. On the Asset Type Selection page, deselect Business Objects and Emulations and click Next.
5. At the Business Processes page, name the process package SCProcessPackage.xpdl and click Next
twice.
6. At the Select Template page, expand Business Process Templates and select Simple Process.
7. Click Finish.
Result
This creates a project containing:

A blank business object model.

A business process containing a Start and an End event, and a single task.

Defining the Consumer Business Process


Defining the business process in the service consumer project consists of a number of subtasks.
Configuring the Business Process
Procedure
1. Open the business process.
2. Relabel it as Service Consumer Process.
3. In Process Explorer, right-click on Participants and select New > Participant .

TIBCO Business Studio Tutorials

223

4. Call the participant Customer Services Rep and set the Type to External Reference.

5. Click the Browse button next to the Reference field. In the Select Type browser, click on Customer
Service Representative (Life) and click OK.
6. Because this is a Position defined in the EasyAsExtendedOM organization model, you are
prompted to add that project as a reference.

7. Click Yes, and click Finish to finish defining this participant.


8. Select the existing task in the process.
9. Change its Activity Type to User Task, and change its label to Display Result.

TIBCO Business Studio Tutorials

224

10. Click the Browse button by the Participants field and select the new Customer Service Rep as the
participant for this task.
Defining the Process Data
Procedure
1. In Project Explorer, select the Data Fields entry under the Service Consumer Process.
In the Properties view, click

to create a field.

2. Set the Label to myResponseField and the Type to External Reference.


3. Click the Browse button in the External Reference field and map the myResponseField field to the
Response object in the business object model of the ServiceProvider project.
4. When prompted to add ServiceProvider as a reference project, click Yes.
5. In Project Explorer, select the myResponseField data field and drag it over the Display Result task.

6. In the pop-up menu that displays, click on Add Data to View and Assign.
7. In the Properties view of the Display Result task, the Interface tab now displays myResponseField
as an In/Out parameter.
8. In Project Explorer, select Parameters in the ServiceConsumer Process.
In the Properties view, click

to create a parameter.

9. Set the values as:

Label as myRequestParam

Mode as In

Type as External Reference

10. Click the Browse button in the External Reference field and map the myRequestParam parameter
to the Request object in the business object model of the ServiceProvider project.
Defining the Web Service Call
Procedure
1. Add a service task to the process flow, before the existing user task.
2. Define the service type as Web Service.
3. You need to define the service that this task calls. To do this, click the Operation: Select button. The
Operation Picker displays.

TIBCO Business Studio Tutorials

225

4. Select the start event from the ServiceProvider project and click OK.

5. Details are displayed in the Properties view for the task. Note that a system participant is
automatically generated and assigned to the service task.

Generating the Business Service


Procedure
1. Change the label of the Start event of the Service Consumer Process to Get Request and define its
Trigger Type as Message.
2. Right-click on the Get Request start event and select Business Service > Generate .

TIBCO Business Studio Tutorials

226

3. The generated business service displays. It contains a start event, a user task, and a Send task which
opens the Service Consumer Process business process.

4. Change the name of the automatically generated data field from myRequestParam to
myRequestField.
5. Change the automatic mapping on the Input to Service tab of the Send Task so that the
myRequestField field maps to the myRequestParam parameter.
Final Steps
Procedure
1. Clean the project using the Project > Clean menu option to remove any error markers.
2. Save the project.

Checking the System Participant


When you assign an abstract WSDL to a service task TIBCO Business Studio automatically creates a
system participant and assigns it to the service task.
You do not need to configure the system participant. However, if you want to see its properties:
Procedure
1. Select the ServiceProviderProcess_Consumer participant. (This participant is defined at the
Package level in the ServiceConsumer project.)

TIBCO Business Studio Tutorials

227

2. On the Properties view for the participant, General tab, expand the Type and Shared Resource
entries.

3. Note that the participant is defined:

On the Type tab, as System

On the Shared Resource tab, as Web Service, Consumer, and Virtualization


Leave the values unchanged.

Mapping the Parameters in the Consumer Process


You must define mappings between the input and output parameters.
Procedure
1. Select the Service Task.
2. In the Input to Service tab of the Properties view, drag the myRequestParam parameter on the lefthand side of the pane on to the myRequest input parameter on the right, to create a data mapping.

3. In the Output from Service tab, similarly map the myResponse service output parameter on to the
myResponseField data field.

4. Save the project.


TIBCO Business Studio Tutorials

228

Deploying the Projects


You must deploy the provider project before the consumer project.
This procedure assumes that you have already worked through the How to Implement and Deploy the
WelcomeUsers Application tutorial. As part of that tutorial, you created a deployment server called XYZ
Work Server1, and that is the name used for the deployment server in this procedure. If you are using a
different server name, substitute that name in the following instructions.
Deploying the Organization Model
Procedure
You may already have deployed the EasyAs extended organization model as part of another
tutorial. If you have not already done so, deploy the EasyAsExtendedOM project to your BPM
runtime now.
See the How to Implement and Deploy the WelcomeUsers Application tutorial for details of how to
deploy BPM projects.
Deploying the Service Provider Application
Procedure
Deploy the ServiceProvider project to your BPM runtime, as described in the How to Implement and
Deploy the WelcomeUsers Application tutorial.
Deploying the Service Consumer Application
Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and click Deploy Module. The
Deploy Module(s) wizard is displayed.
2. Select Deploy BPM Project then click Next. The Select Project dialog is displayed.
3. Select ServiceConsumer as the module to deploy.

TIBCO Business Studio Tutorials

229

4. Click Next. The Administrator Setup dialog is displayed.

Click
. The refresh ensures that the deployment process has access to the details of
the service provider application that you have just deployed. If you do not do this, it is possible that
the values you need in step 7 might not yet be available.
5. Click Next. The Property Configuration dialog is displayed.Press Next.
6. Click Next. The Wiring Configuration dialog displays so that you can indicate the linkage between
the two applications.

Click on add wire and select com.example.serviceprovider/


SPProcessPackage_ServiceProviderProcess/Virtualization from the drop-down list.
For service virtualization, you should always wire to a Virtualization option here. The full
name of the service will vary from case to case, but will always end in Virtualization.

TIBCO Business Studio Tutorials

230

7. Click away from the field and click Finish. The Progress Dialog is displayed while deployment
takes place, and should indicate that deployment has finished with no errors. Progress messages are
also displayed in the Console view.
8. In the Deployment Servers view, expand XYZServer1 > BPMEnvironment > Applications . A
com.example.serviceconsumer entry is displayed, indicating that the application has been
deployed to the BPM runtime.
9. In the Deployment Servers view, right-click XYZ Work Server1 and select Open > Open
Administrator in web browser . The login screen for the Administrator interface in the BPM
runtime is displayed.
10. Log in as root.
11. Click Applications. The list of available applications is displayed.
12. Check that com.example.serviceconsumer has deployed successfully. Its Runtime State should be
Running. Its Action Status should be Deploy with Start Successful.
13. Log out from Administrator.

Testing the Application


You can now test the application by running an instance of it in Workspace or Openspace. The
ServiceConsumer application will call the service from the ServiceProvider.
If you need more information about the steps in the following procedure, see the following tutorials:
How to Map Users to the WelcomeUsers Organization Model

How to Run the WelcomeUsers Application

Test that the ServiceConsumer application works as intended.


Procedure
1. Log in to Openspace and map a user to the Customer Services (Life) position.
By default, the Organization Browser is available in Openspace. In Workspace, the button
used to display the Organization Browser is by default not visible. However, in both
clients administrators can configure which functions are available. Depending on your
organizations policy, therefore, you may be able to use the Organization Browser from
either client application or from both. This tutorial assumes that you are using Openspace.
2. Log in to Workspace as that user.
3. Click the Business Services pane.
4. Expand All Business Services > ServiceConsumer as far as ProcessPackageGetRequest.

TIBCO Business Studio Tutorials

231

5. Right-click ProcessPackageGetRequest and select Start Business Service from the pop-up menu.

6. The following form is displayed by the business service:

7. Enter a forename and a surname and click Submit.


8. Click Work Views. You can see that a work item has appeared in the Inbox of the user you logged
in as.
If you cannot see the work item, click

to refresh the contents of the work item list.

9. Double-click the Display Result work item to open it. The following form is displayed in the
bottom-right pane (also called the "preview pane").

TIBCO Business Studio Tutorials

232

10. Click Submit.


You can click Event Views to see the events associated with running the business services and
associated business process.
11. Log out of Workspace.

Installing the Tutorial Solution


The solution to the tutorial is provided in the TIBCO Business Studio installation. You can import it into
TIBCO Business Studio.
Procedure
1. Find the VirtualizationSolution.zip file in the location where you installed TIBCO Business Studio,
(for example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Projects into Workspace and click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to the zip file and click Open. The provider and consumer projects are displayed in the
Import wizard.
6. Click Finish. The projects are installed in your workspace.

Using Credential Mapping to Associate a Specific Identity with a Process


Instance
This tutorial provides an example of what you need to do to enable a business process application to
ensure that a process instance always runs using fixed credentials.
You should work through each section in turn to complete the tutorial.

Credential Mapping
By default, when a process instance is started it takes on the identity of the user who started the
process. Whenever an activity in the process instance is executed, the BPM runtime authenticates the
starting users credentials against the appropriate LDAP directory. The activity can only be executed if
that authentication request succeeds.
This authentication model may not be appropriate for some business processes. For example:

If a process takes a significant length of time to complete (perhaps months or even years) the user
who started the process may have left the company before the process instance has finished. When
the next activity in the process instance executes, authentication will fail as the users credentials
have been removed from the companys LDAP directories. The process instance will therefore be
unable to progress.

If a process contains an activity that calls a secured web service, some users may have the necessary
authorization rights to start an instance of the process, but not to access the secured web service.
The process instance will therefore be unable to progress beyond the call to the secured web service.

TIBCO Business Studio Tutorials

233
You can avoid these problems by:

designing your application to include a "wrapper" process that calls the main business process,
using a UsernameToken policy.
The wrapper process must call the main business process by invoking a concrete WSDL
operation, using SOAP over HTTP as the binding type. Credential mapping cannot be
performed using service virtualization as the binding type.

configuring the BPM runtime to enforce this policy, mapping the credentials of any user starting the
wrapper process to fixed credentials that will be used to run the business process.

Claim is the actual business process. CredentialMapper is a "wrapper" process that starts the Claim
process.

For example, at runtime:


Procedure
1. User "Joe Smith" starts an instance of the CredentialMapper process.
2. The Call ClaimBusinessProcess service task calls the Claim process. The service task uses a system
participant that is configured to apply a username token policy to the outgoing service request.
3. A governance agent in the BPM runtime enforces the policy - changing the credentials passed in the
service request from "Joe Smith" to "sysUser".
The Call ClaimBusinessProcess service task must use a concrete WSDL to call the Claim
process, using SOAP over HTTP as the binding type.

TIBCO Business Studio Tutorials

234

4. An instance of the Claim process is started, running as "sysUser". As a result:

The Call Authorization Service service task will always be invoked using "sysUser"
credentials. There is no need to ensure that "Joe Smith" (or any other user who can start the
Claim process) has the necessary authorization to access the remote service.

When the ApproveClaim activity is executed, the "sysUser" credentials will be checked against
the LDAP directory to authenticate the request. The activity can therefore proceed even if "Joe
Smith" has left the company when this happens.

Process Design
The wrapper process (CredentialMapper) is the service consumer. The main business process (Claim)
is the service provider. When designing a credential mapping service like this, you could choose to
develop the two processes in either order - consumer first or provider first.
Prerequisites
Ensure that youi understand:

how to implement a call to a web service in a business process application, and then how to deploy
and test that application. If you are not already familiar with these topics, run through the How to
Call an External Web Service From a Process tutorial before attempting this one.

web service security concepts and techniques.

use of a UsernameToken policy to map credentials.

However, if you develop and deploy the service provider first, problems can occur in the service
consumer with duplicate BOM objects when you import the concrete WSDL from the service provider.
(The concrete WSDL can be generated using the Administrator interface in the BPM runtime.)
To avoid this, TIBCO recommend that you follow this procedure to develop the service:
Procedure
1. Create the CredentialMapper process.
2. Generate a concrete WSDL for the Call ClaimBusinessProcess service task.
3. Create the Claim process, using the concrete WSDL generated from the CredentialMapper process.
However, if the Claim process already exists and is already deployed:
a) Create a new PassThrough process.
b) Implement credential mapping between the CredentialMapper and PassThrough processes, so
that the PassThrough process always runs using the "SysUser" credentials.
c) Call the Claim process from the PassThrough process, over a virtualization binding. This
automatically passes the "SysUser" credentials to the Claim process, as shown.

TIBCO Business Studio Tutorials

235

Result

Creating a Keystore Containing the Security Credentials to Run the Business Process
The credentials that will be used to run the business process must be defined in a keystore that is
available to the BPM runtime.
If you do not have access to the BPM runtime you will need to get an administrator to perform this step
for you.
Procedure
1. Log into the BPM runtime.
2. Using a text editor, open the file:
BPM_CONFIG_FOLDER\tibco\data\admin\enterpriseName\samples\
keystore_data.xml

where:

BPM_CONFIG_FOLDER is the path of the TIBCO configuration folder created when the BPM
runtime was installed.

enterpriseName is the enterprise name specified for the Administrator Server when the BPM
runtime was installed. (The default value is AMX BPM.)

For example:
C:\ProgramData\amx-bpm\tibco\data\admin\AMX BPM\samples\
keystore_data.xml

3. Delete the existing CredentialEntry elements.


TIBCO Business Studio Tutorials

236

4. Add a new CredentialEntry element that defines:

the username (username) and password (secret) of the credentials that will be used to run the
business process.

the alias (alias) and associated password (protectionParam) that will be used to access these
credentials.
For example:
<AMXKeyStore xsi:type="amxdata:AMXKeyStore">
<CredentialEntry alias="myKeystore"
protectionParam="myKeyStoreAliasPassword"
username="sysUser" secret="sysUserPassword" /
</AMXKeyStore>

5. Save the file.


6. Open the BPM_CONFIG_FOLDER\tibco\data\admin\enterpriseName\samples\
keystore_build.xml file and edit the following entries:

adminKeyStorelocation

- the name of the file that will contain the keystore.

adminKeyStorePassword

- the password that will be required to access the keystore file.

For example:
<project name="keystore_build" default="all">
<!-- This property lets you safely define all paths relative to the
absolute location of this Ant file. -->
<dirname property="admin.samples.directory" file="$
{ant.file.keystore_build}"/>
<!-- This import defines the custom AMXKeyStoreTask. -->
<import file="${admin.samples.directory}/admin-scripts-base.xml"/>
<!-- Predefine ${dataFile} to apply the targets in this script with
different parameters. -->
<property name="dataFile" value="${admin.samples.directory}/
keystore_data.xml"/>
<!-Add credential and delete credentials from admin default keystore
-->
<target name="all" depends="addCredential,deleteCredential"/>
<target name="addCredential">
<AMXKeyStoreTask
dataFile="${dataFile}"
adminKeyStorelocation = "my_keystore.jceks"
adminKeyStorePassword = "AKSpassWd"
action="add"/>
</target>
<target name="deleteCredential">
<AMXKeyStoreTask
dataFile="${dataFile}"
adminKeyStorelocation = "my_keystore.jceks"
adminKeyStorePassword = "AKSpassWd"
action="delete"/>
</target>
</project>

7. Save the file.

TIBCO Business Studio Tutorials

237

8. Run the command to generate the keystore file.


ant -f keystore_build.xml addCredential

If Apache Ant is not already installed on the BPM runtime system, download it from
http://ant.apache.org, install as directed in the Ant documentation, and add the ant
executable to your path.
The file containing the keystore (defined by adminKeyStorelocation) is created in the same folder.
For example:
C:\ProgramData\amx-bpm\tibco\data\admin\AMX BPM\samples>ant -f keystore_build.xm
l addCredential Buildfile: C:\ProgramData\amx-bpm\tibco\data\admin\AMX BPM
\samples\keystore_buil d.xml addCredential: [AMXKeyStoreTask] INFO - Keystore
file C:\ProgramData\amx-bpm\tibco\data\admin\ AMX BPM\samples\my_keystore.jceks
does not exist; creating a new keystore file [AMXKeyStoreTask] Adding entry for
alias 'myDatabase'... [AMXKeyStoreTask] Saving to keystore file C:\ProgramData
\amx-bpm\tibco\data\admi n\AMX BPM\samples\my_keystore.jceks BUILD SUCCESSFUL
Total time: 9 seconds C:\ProgramData\amx-bpm\tibco\data\admin\AMX BPM\samples>

Result
See Also
See the following topics in the BPM runtime documentation:

Administration: Resource Templates > Security Resource Templates > Keystore Provider > Creating a
Keystore Containing a Username and Password

Administration: Administrator Interfaces > Command-Line Interface

Creating the Links to the Keystore


A keystore provider resource instance provides a reference to the keystore created.
An identity provider resource instance provides a reference to the specific credentials defined in the
keystore.
An identity provider application (or governance agent):

provides a reference to the identity provider resource instance that will be used to map the
credentials.

enforces the required credential mapping when the wrapper process invokes the business process.
At design-time, in TIBCO Business Studio, the name of the identity provider application
can be referenced from a BPM application using the Governance App. Field, which is
defined for the system participant used to define the web service endpoint.
See "Configuring Security on an Outgoing Service Call" in the TIBCO Business Studio BPM
Implementation guide for more information.

If you do not have access to the Administrator interface in the BPM runtime, you will need to get an
administrator to perform this step for you.
Creating and Install a Keystore Provider Resource Instance
Procedure
1. Log into the Administrator interface in the BPM runtime.

TIBCO Business Studio Tutorials

238

2. Create a Keystore Provider resource template with the following properties:

Location of keystore: Identify the keystore that you created earlier.


Password: Enter the password needed to access the keystore, as defined by the
parameter in the keystore_build.xml file.

adminKeyStorePassword

Scope: Scope the template to your BPM application instance (for example, amx.bpm.app).

Type: Select JCEKS.

Provider: Clear this field and leave it blank.

3. Using the Keystore Provider resource template that you have just created, create and install a new
Keystore Provider resource instance on the BPMNode.
Creating and Installing an Identity Provider Resource Instance
Procedure
1. Create an Identity Provider resource template with the following properties:

Keystore Provider to Supply Identity: Enter (or use the picker tool to select) the name of the
Keystore Provider resource instance that you created earlier.

Enable Access to Credential Store Containing Identity: Select this option.

Key Alias to Access Identity: Enter the alias name that you specified in the
file.

keystore_data.xml

Key Alias Password: Enter the protectionParam password that you specified in the
file.

keystore_data.xml

2. Using the Identity Provider resource template that you have just created, create and install a new
Identity Provider resource instance on the BPMNode.
Creating and Installing an Identity Provider Application
Procedure
1. Create a new identity provider application with the following characteristics:

Environment Name. Select BPMEnvironment.

Application Template Name: Select TIBCO ActiveMatrix Governance Agent Identity


Provider.

Node Name: Select BPMNode

Folder Name: accept the default.

subjectIspConnectorFactory property: Enter the name of the Identity Provider resource


instance you created earlier

2. Deploy and start the identity provider application.

TIBCO Business Studio Tutorials

239

Result
See the following topics in the BPM runtime documentation:

Administration: Resource Templates > Security Resource Templates > Keystore Provider > Creating a
Keystore Containing a Username and Password

Concepts: Platform > Governance

Development Tutorials: Policy tutorials > Preparing an Application that Injects Resource Instances
into Policies

Configuring the Credential Mapping Process to Assign the Security Policy


In the wrapper process, you must assign the appropriate security policy to the system participant that
identifies the web service endpoint used to call the main business process.
Procedure
1. In TIBCO Business Studio, open the wrapper process that will be used to call the main business
process.
2. In Project Explorer, select the system participant used by the web service task that calls the main
business process.
3. On the General tab of the Properties view, expand Shared Resource.
4. Make sure that SOAP over HTTP is selected for the Invoke using field.
5. In the Policy Type field, select Username Token from the drop-down menu.
6. In the Governance App. Name property, enter the name of the BPM runtime identity provider
application that you created earlier. This application will be used to apply the required policy to the
outgoing message used to call the main business process.

How to Send an Email From a Process


This tutorial shows you how to configure a service task to send an email from a business process
application, and then how to deploy and test that application.
You should work through each section in turn to complete the tutorial.
Data fields can be used to dynamically set parts of the email at runtime (for example, the recipient, or
part of the body text of the email).
A connection to an SMTP mail server must be configured, using a BPM runtime SMTP resource
instance. At runtime, when the service task is executed, the BPM runtime constructs the email from the
data provided in the send task and sends the email to the SMTP mail server, which in turn sends it to
the specified recipients.
Prerequisites
You should be familiar with the basics of designing, implementing and deploying process-based
applications using TIBCO Business Studio. If you are not familiar with these things, you should run
through the following tutorials before attempting this one:

How to Design a Simple WelcomeUsers Business Service

How to Implement and Deploy the WelcomeUsers Application

Before You Begin


You will need to know the SMTP address and port number used by your SMTP mail server to be able
to test and run this tutorial.
TIBCO Business Studio Tutorials

240

Importing the AcknowledgeClaim Analysis Project


To avoid having to build the process from scratch and focus just on the steps involved in sending an
email from a process, this tutorial provides a "work in progress" project as a starting point.
This project represents the process at the handover point from business analyst to solution designer:

The overall process has been defined.

The data to be passed in the email has been defined.

The email service call needs to be implemented.

Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. To import the AcknowledgeClaim project into your workspace, find the acknowledgeclaim.zip file
in the location where you installed TIBCO Business Studio.
3. In TIBCO Business Studio, choose File > Import . The Import wizard is displayed.
4. On the Select page, expand General, select Existing Studio Projects into Workspace and click
Next. The Import Projects page is displayed.
5. Click Select archive file, and click on the Browse button.
6. Browse to the zip file and click Open. The project is displayed in the Import wizard.
7. Click Finish. TIBCO Business Studio imports the AcknowledgeClaim project to your workspace.
The project contains the processes:
Result
Process

Description

MakeClaim (business
service / pageflow
process)

This is a business service which, when started by a user:


1. Displays a form to get users email address.
2. Invokes the AcknowledgeClaim business process, passing the users
email address as the input parameter.
Note: Although this tutorial project uses a business service to collect the
data used as input to the web service, this is simply a convenience to make
it easy to run and test the application.

AcknowledgeClaim
(business process)

This is a business process which, when invoked by the MakeClaim


business service:
1. Runs a script which identifies "ReplyTo" and "From" email addresses.
2. Sends an email to the user.
Note that when you import the project, one error marker displays on the
script task in this business process. You will remove this later in the
tutorial.

TIBCO Business Studio Tutorials

241

Creating an Email Service Task


To send an email from a process you use a Service task of type Email.
Procedure
1. Open the AcknowledgeClaim process.
2. Select the Acknowledge claim task.
3. On the Properties view, General tab, change the Activity Type from Task to Service Task. The
right-hand pane now displays a Service Type field.
4. Change the Service Type to E-Mail.
5. Enter a suitable Subject and Body for the email message. For example:

You will populate the To field in the later


6. Click More Details. The E-Mail tab is displayed.

Setting up Dynamic Data Inputs to the Email


Data fields defined in the process can be used to dynamically set parts of the email at runtime - for
example, the recipient, part of the body text of the email, or the contents of attachments.
In the To field, click the Browse button (
Formal Parameter dialog is displayed.

) at the right-hand side of the field. The Select Data Field or

Procedure
1. Select claimant, then click OK. The To field now contains the token %claimant%, indicating that at
runtime the field will be populated with the current value of the claimant formal parameter.

TIBCO Business Studio Tutorials

242

2. In the same way, add the replyToAddress data field to the Reply To field. Your E-Mail tab should
now appear like this.

You can also insert a data field as a runtime token at any point by simply typing the field
name enclosed in percentage characters. You do not have to use the Browse button.
3. Save the project.

Populating the Data Fields


Data fields used as tokens on an email task must be populated before the email task is processed.
For demonstration purposes the AcknowledgeClaim process simply uses a script task which allows
you to use your own email address for the replyToAddress data field.
The claimant formal parameter will contain the email address submitted from the MakeClaim business
process.
Procedure
1. Select the Set email parameters script task.
2. On the Properties view, General tab, change the value of the Script Defined As field to Javascript.
The script area contains a commented assignment for the replyToAddress data field.
3. Delete the comment delimiters (//) at the start of the line.
At this point the error marker on the script task disappears.
4. Change the replyToAddress to your own email address. For example:
replyToAddress = "llawrence@easyas.com";

5. Save the project.

Setting Up a System Participant


When you set the Service Type for the service task to E-Mail, TIBCO Business Studio automatically
creates a system participant and assigns it to the service task.
The system participant will, as part of the deployment process, be configured to identify a BPM
runtime SMTP resource instance that defines the connection to the appropriate SMTP email server. You
will create this resource instance later in this tutorial.
You do not need to configure the system participant. However, if you want to see its properties some
steps have to be performed.
TIBCO Business Studio Tutorials

243

Procedure
1. Select the Default EMail Sender participant. (This participant is defined at the Package level.)
2. On the Properties view, General tab, expand the Shared Resource entry.

3. Leave the values unchanged.

Creating an SMTP Resource Instance


An SMTP resource instance must exist in the BPM runtime before you can deploy the
AcknowledgeClaim application. This resource instance defines the connection information used by the
BPM runtime to contact the SMTP mail server.
There are several different types of resource instance. An SMTP resource instance must be used to
provide a connection to an SMTP mail server.
To define a resource instance, you must use the Administrator interface in the BPM runtime to:
Procedure
1. create a resource template. A resource template specifies configuration properties for resource
instances.
2. create a resource instance based on the resource template, and install it on a host. A resource
instance represents a resource shared between applications. It is then available to applications
running on that nodein this case, to the AcknowledgeClaim application.
Result
This step assumes that you have created the XYZ Work Server1 Deployment Server, as described in the
How to Implement and Deploy the WelcomeUsers Application tutorial.
If you do not have access to the Administrator interface in the BPM runtime, you will need to get an
administrator to perform this step for you.
Creating an SMTP Resource Template
Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and select Open > Administrator .
The login screen for the Administrator interface in the BPM runtime is displayed.

TIBCO Business Studio Tutorials

244

2. Log in using an appropriate username and password.


3. Click Shared Objects > Resource Templates .
Click New (

). The Add Resource Template dialog is displayed.

4. In the Type field, select SMTP.


5. In the Name field, enter EmailServerTemplate.
6. Set the Scope of the template by moving the slider to the far right, above Application. Select your
BPM environment (for example, BPMEnvironment) from the Environment dropdown, and then
select the name of your BPM application instance (for example, amx.bpm.app) in the Application
dropdown.
7. In the Machine Name field, enter the SMTP address of your SMTP mail server.
8. In the Port field, enter the port number used by your SMTP mail server. The default value is (25).
9. Change the Timeout field value to 100000 (100 seconds). This sets the timeout value used by BPM
when contacting the SMTP mail server.
10. Click Save. EmailServerTemplate is added to the list of resource templates.
Creating and Install an SMTP Resource Instance
Procedure
1. Click Infrastructure > Hosts .
2. In the list of Infrastructure Hosts, click SystemHost.
Click New (

). The Add Resource Instance dialog is displayed.

3. In the Resource Templates View field, select SMTP from the drop-down list. The available SMTP
resource templates are listed.
4. Select the row containing the EmailServerTemplate template.
5. In the Instance Name field, change the displayed value to EmailServerTemplate.
In the Available Nodes area, select BPMNode, then click
to move it to the Selected Nodes area
- that is, the node to which you want to add the resource instance.
6. Click Save and Close. EmailServerTemplate is installed on the node BPMNode.

Deploying the Application


As part of the deployment process, you map the system participant used by the email service task to
the SMTP resource instance you created earlier.
Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and click Deploy Module. The
Deploy Module(s) wizard is displayed.
2. Select Deploy BPM Project then click Next. The Select Project dialog is displayed.
3. Select AcknowledgeClaim as the module to deploy.
4. Click Next. There is a short pause while the necessary files generate and then the Administrator
Setup dialog is displayed.

TIBCO Business Studio Tutorials

245

5. Click Next. The Property Configuration dialog is displayed. The list identifies the system
participants used in the process:

DefaultEmailSender1 is used by the Acknowledge Claim email service task. Note that the
value is DefaultEmailSender1, rather than the name of the system participant, which is
DefaultEmailSender.

HttpInboundConnectionConfig is used by the Start Event to expose the process as a


virtualized service to the MakeClaim business service.
DefaultEmailSender1 is the name of a runtime substitution variable which TIBCO
Business Studio creates automatically from the DefaultEmailSender system
participant name.
Using a substitution variable to identify the system participant makes it easy to
change the resource instance used by the application at runtime, without having to
redeploy the application.
See the Administrator interface documentation for your BPM runtime environment
for more information about substitution variables.

6. Note that an error message is displayed. When the DefaultEmailSender participant was defined,
the instance name was specified as EmailSender. The deployment process looks for this instance
name on the host, but no such instance exists.

Select the DefaultEmailSender1 row and click Override....

TIBCO Business Studio Tutorials

246

7. The Property Value dialog displays. Click the drop-down menu in the Name field. It lists the
available SMTP resource instances.

8. Select the resource instance that you created earlier, EmailServerTemplate, and click OK.
This mapping defines that, at runtime, when the Acknowledge claim email service task is executed,
the email is sent to the SMTP mail server defined by the EmailServerTemplate resource instance.
(The mapping can be changed at runtime by reassigning the EmailParticipant1 substitution
variable to a different SMTP resource instance.)
9. Click Finish. The Progress Dialog is displayed while deployment takes place, and should indicate
that deployment has finished with no errors. Progress messages are also displayed in the Console
view.
10. Click OK.
11. In the Deployment Servers view, expand XYZServer1 > BPMEnvironment > Applications . A
com.example.acknowledgeclaim entry is displayed, indicating that the application has been
deployed to the BPM runtime.
12. In the Deployment Servers view, right-click XYZ Work Server1 and select Open > Administrator .
The login screen for the Administrator interface in the BPM runtime is displayed.
13. Log in using an appropriate username and password.
14. Click Applications. The list of available applications is displayed.
15. Check that acknowledgeclaim has deployed successfully. Its Runtime State should be Running. Its
Action Status should be Deploy with Start Successful.
16. Log out from Administrator.

Testing the Application


You can now test the application by running an instance of it in Workspace and checking your email.
If you need more information about the steps in the procedure, see the tutorial How to Run the "Welcome
Users" Application.
Test that the AcknowledgeClaim application works as intended.
TIBCO Business Studio Tutorials

247

Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and select Open > TIBCO . The
Workspace login screen is displayed.
2. Log in as user tibco-admin (or as any other user that you have already added to the system).
3. Click Business Services.
4. Expand All Business Services > uncategorized , then select and start the MakeClaim business
service.
5. A Get email address form is displayed:
a) In the claimant field, enter your own email address.
b) Click Submit.
6. Log out.
7. Check the inbox in your email program. You should receive an email with the Subject and Body
you specified in the Acknowledge claim service task.
If you do not see the email in your inbox, check your junk email folder. The spam filter
settings on your mail program may direct the email there instead of to your inbox.
8. Create a reply to the email. The To address of your reply should contain the address you specified
in the replyToAddress data field.

How to Call TIBCO BusinessEvents from a Process


The applications described demonstrate a simple interface between TIBCO ActiveMatrix BPM and
TIBCO BusinessEvents.
TIBCO BusinessEvents applications can be exposed as web services that can be called by external
applications. The business process in this tutorial calls TIBCO BusinessEvents via a web service
invocation.
You can create a BusinessEvents application, implement a call to the BusinessEvents application via a
web service in a business process application, and then deploy and test that application.
The tutorial is comprised of three sections:

Creating an TIBCO ActiveMatrix BPM application using structured data.

Creating a TIBCO BusinessEvents application.

Testing the integration between the two applications.

You should work through all the steps in each section in turn to complete the tutorial.
The BusinessEvents application is based on a decision table. The table implements a simple rule that
examines activity on a bank account for fraud.
The deposit or withdrawal of more than $500 triggers an alert on the transaction.
The business process application sends the name of the account holder and the amount of the
transaction to BusinessEvents for analysis, then receives a status message regarding the transaction in
return.

TIBCO Business Studio Tutorials

248
Prerequisites

You are not expected to have any specific knowledge of TIBCO BusinessEvents in this tutorial.
However, you should understand the general concepts and purpose of a rules engine.

You are familiar with business process design for TIBCO ActiveMatrix BPM using TIBCO Business
Studio. Note that:

Structured data types will be referenced from the business process.

The input and output parameters used by the web service activity will be defined using
JavaScript mapping.

Before You Begin

Install the following software (from the TIBCO Software Inc. Product Download Site) as per the
documentation referenced within each product:

TIBCO ActiveMatrix BPM 1.1.0

TIBCO Business Studio - BPM Edition 3.5.0

TIBCO BusinessEvents Standard Edition 4.0.1

TIBCO BusinessEvents Decision Manager 4.0.1 (This should be installed into the same
as the TIBCO BusinessEvents Standard Edition.)

TIBCO_HOME

Configure TIBCO BusinessEvents Studio and TIBCO Business Studio BPM Edition to have their
own unique workspace.

From TIBCO Business Studio BPM Edition, create and connect to an ActiveMatrix BPM server
instance.

Creating the ActiveMatrix BPM Project


The BPM project consists of a user task to collect the data - name and transaction amount - followed by
a call to BusinessEvents via web services. Finally, the status of the transaction determined by
BusinessEvents is displayed in a user task.
The use of structured data enables JavaScript mapping to be used in the web service activity.
You must create and deploy a suitable organization model prior to creating and deploying the
ActiveMatrix BPM project.
Each aspect of the application will be defined in turn as part of a BPM Developer Project within TIBCO
Business Studio.
Procedure
1. In TIBCO Business Studio BPM Edition, right-click the Project Explorer and select New > BPM
Developer Project to create a new BPM Developer Project called AdvBEIntegration.
2. Specify the BPM destination environment and click Next.
3. Accept the default values on the screens until the Business Processes screen. Enter the name of the
Process Package as AdvBEIntegration.
4. Accept the default values on the remaining screens and click Finish to create the project.

TIBCO Business Studio Tutorials

249

Creating the Business Object Model Objects


The structured data used by the application is defined using the Business Object Model as a composite
class.
In Business Object Modeler, define a new class called Account with attributes:

name: mandatory; Text.

amount: mandatory; Decimal.

status: optional; Text.

Defining the Business Process


The service descriptor will be generated from the web service task and the parameters automatically
mapped based on the business object model defined.
Configuring the Business Process
Procedure
1. Create three tasks in the project: a user task that accepts the name and amount to be passed to the
decision service, a web service task to call the decision service, and a final user task to display the
status from the decision service.

2. Create a participant to be used in the User tasks and map the participant to both the User tasks.
Make sure the participant is mapped to an entity in your organization model, otherwise
deployment will fail.
Creating a Data Field

TIBCO Business Studio Tutorials

250

Procedure
Create an AccountInstance data field as an external reference to the complex type Account that you
created in the business object model.
Configuring the Web Service Task
Procedure
1. Add the AccountInstance data field to the interface of the web service task.

2. Click Generate to generate the concrete WSDL for the web service task.

3. In the Create WSDL for Activity dialog, edit the WSDL file name and parent folder location if
needed and click Next.

TIBCO Business Studio Tutorials

251

4. In the WSDL Binding Type Selection screen, modify the target namespace to simplify it as
necessary. Choose the Binding Style Document Literal and WSDL Type Concrete and specify the
SOAP Address for the concrete WSDL as http://localhost:8104/AdvBEIntegration/CallBE.
Click Finish.

The concrete WSDL is generated and is available under the Service Descriptors folder.
5. The Input to Service and Output from Service mappings are automatically completed.
Creating a Business Service
Procedure
1. Change the process start event to a Message trigger type.
2. Generate a business service based on the start event by right-clicking the start event and selecting
Business Service > Generate .
3. In the business service, delete the user task that is created by default.
Creating the HTTP Client Shared Resource
Procedure
1. Log into TIBCO ActiveMatrix Administrator and select Shared Objects, then Resource Templates.
2. Choose to create a new resource template.
3. Enter the name of the template as AdvBEIntegrationClient and select the template Type as HTTP
Client.
4. Set the Scope of the template by moving the slider to the far right, above Application. Select your
BPM environment (for example, BPMEnvironment) from the Environment dropdown, and then
select the name of your BPM application instance (for example, amx.bpm.app) in the Application
dropdown.
5. Edit the Port to 8104 and save the template.

TIBCO Business Studio Tutorials

252

Creating the HTTP Client Resource Instance


Procedure
1. From the list of resource templates, select AdvBEIntegrationClient and click on New Resource
Instances.
2. The New Resource Instances dialog displays. Click on SystemHost and select the node BPMNode
to create the resource instance on.
3. Click Save and Install.

Deploying the Business Process Application


The ActiveMatrix BPM application is deployed via TIBCO Business Studio BPM Edition in the usual
way.
Procedure
1. In TIBCO Business Studio Deployment Servers view, right-click the server, and select Deploy
Module.
2. In the Select Module Type dialog, select Deploy BPM Project and click Next.
3. In the Select Project dialog, select the project AdvBEIntegration and then click Next.
4. Accept the defaults in the Administrator Setup dialog and click Next.
5. In the Property Configuration dialog, override the outbound HTTP property to select the existing
resource instance AdvBEIntegrationClient.
6. Click Finish to deploy the application.
You have completed creating and deploying the TIBCO ActiveMatrix BPM application. Proceed to
the next section to create a Business Events application.

Creating the BusinessEvents Project


A new TIBCO BusinessEvents application will be exposed via a web service that is based on SOAP over
HTTP.
The BusinessEvents application consists of:

Transport Infrastructure based around SOAP, including HTTP, event and XML Schema
configuration.

An ontology definition of the account object.

Rule processing to interface the SOAP events to the account object and the invoking of the decision
table.

The decision table definition.

Each aspect of the application will be defined in turn as part of a Studio Project within TIBCO
BusinessEvents Studio.
The majority of the application will be generated based on the WSDL defined in the TIBCO
ActiveMatrix BPM application.
Creating a New BusinessEvents Project

TIBCO Business Studio Tutorials

253

Procedure
1. Launch TIBCO BusinessEvents Studio (displayed as just Studio in the Windows start menu).
2. Click File > New > Other and select the wizard TIBCO BusinessEvents, then Studio Project to
create a new Studio Project called BPMIntegration.
Importing the TIBCO ActiveMatrix BPM WSDL
Procedure
1. Create a new folder by right-clicking the project and then select New > Folder .
2. Name the folder as WSDL.
3. Copy the concrete WSDL generated in the TIBCO ActiveMatrix BPM project to a local directory on
your machine.
4. From TIBCO BusinessEvents Studio, right-click and select Import > > WSDL .
5. Browse and select the WSDL copied in step 3.

Creating the Ontology


A BusinessEvents Concept is the equivalent of a Business Object Model (or structured data) object in
TIBCO ActiveMatrix BPM.
A single Account concept will be defined that represents the name, transaction amount and the status
of a transaction, which will be subsequently determined by the decision table logic.
The name is not explicitly represented in the concept as all concepts have a built in identity parameter,
@extId, which will be referenced as the account holders name in our example.
Creating a Concept
Procedure
1. Right-click the Concepts folder in the project and select New > Concept .
2. Specify a Concept name of Account to be created in the Concepts parent folder.
Configuring the Concept

TIBCO Business Studio Tutorials

254

Procedure
Add the properties to the concept.

an Amount property, of type double.

a Status property, of type string.

Setting Up the Rules and Rule Functions


In TIBCO BusinessEvents, Rules and Rule Functions connect with the Event definitions created earlier
to parse the request data, invoke the decision table, and construct the response. The request and
response in this example are SOAP based messages.
It is not necessary to invoke a decision table rules can be written directly in the Java-based rules
editor. However, in this example the rule simply acts as the conduit by which the decision table is
invoked.
Creating a Virtual Rule Functions Folder
Procedure
1. Right-click the BPMIntegration project and select New > Folder .
2. Specify a Folder Name of VirtualRuleFunctions.
Creating a Virtual Rule Function
Procedure
1. Right-click the VirtualRuleFunctions folder in the project and select New > Rule Function .
2. Specify a function name of ReviewAccount to be created in the VirtualRuleFunctions parent folder.
3. Select the Virtual check box.
Configuring the Virtual Rule Function
Procedure
1. Select the Form tab.

TIBCO Business Studio Tutorials

255

2. Click Add to add a Scope argument of type Concept, resource Account.concept.

Configuring the Rule


Procedure
1. Select the rule created previously when the WSDL was imported.
2. Select the Form tab.
3. Specify the rule actions as shown in the following code snippet. Content and Context assist will
operate as the actions are defined.
System.debugOut("###Action###");
System.debugOut("###Printing SOAP Input###");
System.debugOut(soapeventin@payload);
System.debugOut("###Creating Concept Instance###");
Concepts.Account account = Instance.createInstance("xslt://");
System.debugOut("###Invoking Decision Table###");
VirtualRuleFunctions.ReviewAccount(account);
System.debugOut("###Creating the SOAP Output###");
AdvBEIntegration.AdvBEIntegrationProcess.Events.AdvBEIntegrationProcess_CallBE_OU
TPUT output = Event.createEvent("xslt://");
System.debugOut("###Printing SOAP Output###");
System.debugOut(output@payload);
System.debugOut("###Deleting Concept Instance###");
Instance.deleteInstance(account);
Event.replyEvent(soapeventin, output);

The Instance.createInstance and Event.createEvent definitions will be defined (using the


XSLT mapper) in the next two tasks.
Configuring the Rule XSLT Request Mapping

TIBCO Business Studio Tutorials

256

Procedure
1. Control-click the XSLT mapping request action ("xslt://") to open the XSLT mapper. (This is the first
instance mapping.)
2. Browse to specify the Entity Path of the Account concept.
3. Map the Name and Amount from the request into the extId and Amount in the concept.

Configuring the Rule XSLT Response Mapping


Procedure
1. Control-click the XSLT mapping response action ("xslt://") to open the XSLT mapper. (This is the
second instance mapping.)
2. Browse to specify the Entity Path of the generated Output event.

TIBCO Business Studio Tutorials

257

3. Map the Status from the concept into the Status in the response.

Defining the Decision Table


The decision table in this example defines the rule logic to be applied to the banking transaction. The
decision table is structured to review the amount of the transaction and then set the status flag
accordingly within the concept object.
Creating a Decision Table
Procedure
1. In the VirtualRuleFunctions folder in the project, right-click the Review Account rule function and
select New > Decision Table.
2. In the Select virtual rule function: box, specify the ReviewAccount rule you created in step 2 of
Task B Create a Virtual Rule Function.
3. Specify the name of the decision table as ReviewAccountDT and click Finish.
Configuring the Decision Table
Procedure
1. Drag the Amount property of the Account concept to the condition area of the decision table.

TIBCO Business Studio Tutorials

258

2. Drag the Status property of the Account concept to the action area of the decision table.

Specifying the Decision Logic


Procedure
Configure the two rules as shown by adding two rows to the table and typing the logic into each
cell in the table.

TIBCO Business Studio Tutorials

259

Preparing the BusinessEvents Application for Deployment


In order to deploy the BusinessEvents application a cluster configuration must be created that explicitly
defines how the BusinessEvents engine will interface with the business process application.
Creating a Cluster Configuration
Procedure
1. Right-click the Deployments folder in the project and select New > Cluster Deployment
Descriptor.
2. Specify a file name of default to be created in the Deployments parent folder.
3. Accept the default In Memory setting for the Object Management Type and click Finish.
Configuring the Cluster Configuration
Procedure
1. Select the Agent Classes tab.
2. Add a new destination to the Input Destination Collections.
3. Select the destination from the generated HTTP Channel.
4. Select the pre-processor by browsing for the generated rule function.

Deploying the BusinessEvents Application


At runtime, the EAR file is the deployment container for BusinessEvents and will be generated from the
business process application.
Building the Enterprise Archive File

TIBCO Business Studio Tutorials

260

Procedure
1. Select the BPMIntegration project in TIBCO BusinessEvents Studio Explorer and then select Build
Enterprise Archive from the Project menu.
2. Specify the location and file name for the EAR file import. This should be in the same location
inside the workspace as shown.

Starting the BusinessEvents Engine


The BusinessEvents engine is started from the command line in this example.
The console output provides details of the SOAP requests and responses as well as the processing by
BusinessEvents of the decision table.
Procedure
1. Open a command prompt with a working directory of the BusinessEvents project created
previously.
2. Set the BE_HOME environment variable to the location of the BusinessEvents installation using the
command:
set BE_HOME=c:\tibco_be\be\4.0

TIBCO Business Studio Tutorials

261

3. Use the command to start the BusinessEvents engine:


%BE_HOME%/bin/be-engine --propFile %BE_HOME%\bin\be-engine.tra
-u default -c Deployments/default.cdd BPMIntegration.ear

4. Wait for the started report in the log.


You have completed creating and deploying the TIBCO BusinessEvents application. Proceed to the
next section to test the integration between the applications.

Testing the Applications


You can use Workspace to test the integration between TIBCO ActiveMatrix BPM and TIBCO
BusinessEvents.
You can review the console output from the TIBCO BusinessEvents engine to ensure the correct
behavior is observed.
To test the integration, TIBCO BusinessEvents application must be created and started before
proceeding with the steps described.
Procedure
1. Log into TIBCO Workspace.
2. Start the business service provided by the business process application. (This starts an instance of
the business process.)
3. Specify an account name and an amount in the work item that is generated, then submit it.
4. Use the TIBCO BusinessEvents console to observe the output of the web service call to
BusinessEvents.
5. Open the resulting work item to see the status of the transaction, as returned by BusinessEvents.

How to Call a TIBCO ActiveMatrix BusinessWorks Service from a BPM


Process
This tutorial demonstrates the integration of ActiveMatrix BPM and ActiveMatrix BusinessWorks
Service Engine. It shows how to create, deploy, and then test a BPM process that calls an ActiveMatrix
BusinessWorks Service.
The ActiveMatrix BusinessWorks application provides a simple address lookup service that takes a
postal code as an input, and returns the address (if the postal code specified is valid) or an appropriate
message.
You should work through each section in turn to complete the tutorial.

The business process in this tutorial calls the virtualized service provided by ActiveMatrix
BusinessWorks Service Engine via a web service invocation.

The input of the business process accepts a postal code as a text string. The ActiveMatrix
BusinessWorks process is designed to recognize and return the address for the following postal
codes: SN2 8BL, CA 94304, and MA 02144. For all other values, or for an empty postal code, an
appropriate error message is returned.

TIBCO Business Studio Tutorials

262

The address lookup service uses structured data (xsd:sequence) to return the address of the postal
code.
In this tutorial, the TIBCO Business Studio variant that is installed with ActiveMatrix
BusinessWorks Service Engine is referred to as Studio for Designers, and the one installed
with ActiveMatrix BPM is referred to as TIBCO Business Studio.

You are familiar with the concepts and working of TIBCO ActiveMatrix BusinessWorks and TIBCO
ActiveMatrix BusinessWorks Service Engine.

You are familiar with WSDLs and schema constructs.

Setting up the Environment


Software must be installed and configured to set up the environment.
Procedure
1. Install the following software (in the given sequence) from the TIBCO Software Inc. Product
Download site using the documentation referenced within each product:

TIBCO Rendezvous 8.3.1

TIBCO Runtime Agent 5.7.1

TIBCO ActiveMatrix BusinessWorks 5.9.2

TIBCO ActiveMatrix BusinessWorks Service Engine 5.9.2

TIBCO ActiveMatrix BPM 1.1.0

TIBCO Enterprise Message Service 6.0.1


See the installation guides for the products for additional information about
installation options and permitted combinations.

2. Configure the TIBCO Business Studio variants installed with ActiveMatrix BusinessWorks Service
Engine and ActiveMatrix BPM to have their own unique workspaces.
3. In the TIBCO Business Studio Deployment Servers view, create and connect to an ActiveMatrix
BPM server instance.
Similarly, in the Studio for Designers Deployment Servers view, create and connect to the
ActiveMatrix BPM server instance.

Importing the TIBCO SOA Project and ActiveMatrix BusinessWorks Project


The projects - TIBCO SOA Project containing the BusinessWorks component, and the associated
ActiveMatrix BusinessWorks project - required to test the integration are supplied.
Find the projects SimpleAddressLookup.zip and SimpleAddressLookup-BW.zip from the location
where you installed TIBCO Business Studio and import them into your Studio for Designers
workspace.

Importing the Simple Organization Model (Optional)


A simple organization model that can be used in the tutorial is supplied. However, you can choose to
use your own organization model to develop and run the tutorial.
If you wish to use the organization model that is supplied, find SimpleOrg.zip from the location where
you installed TIBCO Business Studio and import the project into your TIBCO Business Studio
workspace.

TIBCO Business Studio Tutorials

263

Creating the BPM Developer Project


The BPM project consists of a user task to collect the data - postal code - followed by a call to
ActiveMatrix BusinessWorks Service Engine via web services. The output returned by the web service
is displayed in a user task.
The use of structured data enables JavaScript mapping to be used in the web service activity.
You must create and deploy a simple organization model prior to creating and deploying the
ActiveMatrix BPM project. See Importing the Simple Organization Model (Optional) for additional
information.
Procedure
1. In TIBCO Business Studio Project Explorer view, right-click and select New > BPM Developer
Project to create a new BPM Developer Project called SimpleAddressClient.
2. Specify the BPM destination environment and click Next.
3. Accept the default values on the screens until the Business Processes screen. Enter the name of the
Process Package as SimpleAddressLookupClient.
4. Accept the default values on the remaining screens and click Finish to create the project.

Importing the ActiveMatrix BusinessWorks Service Engine WSDL


When you import the WSDL file into the BPM Developers project, the associated Business Object
Model is generated under the Generated Business Objects folder.
Procedure
1. In the Project Explorer, right-click the Service Descriptors folder and select Import, and then select
Service Import Wizard.
2. Choose the option to Import from a File and click Next.
3. Browse to the location of the Studio for Designers workspace and select the file
SimpleAddressLookup.wsdl from the imported SimpleAddressLookup-BW project, and click
Open.
4. Verify the project location and click Finish.

TIBCO Business Studio Tutorials

264

5. The Business Object Model is generated in the Generated Business Objects folder with the
following classes:
InputType with a single attribute postalCode of type Text.

OutputType with the following attributes:

addressLine1: mandatory; Text

addressLine2: mandatory; Text

city: mandatory; Text

country: mandatory; Text

province: mandatory; Text

postalCode: mandatory; Text

FaultType - a primitive type.

Defining the Business Process


The service descriptor will be generated from the web service task and the parameters will be mapped
automatically based on the business object model defined previously.
Configuring the Business Process
Procedure
1. Create three tasks in the project: a user task that accepts the postal code to be passed to the
ActiveMatrix BusinessWorks service, a web service task to call the service, and a final user task to
display the result of the web service call.

TIBCO Business Studio Tutorials

265

2. Create a participant to be used in the user tasks and map the participant to both the user tasks.
The default participant type Role is unsupported. Ensure that the participant is either an
external reference or an Organization Model query.
Creating the Data Fields
Procedure
1. Create the following data fields for the SimpleAddressLookupClient-Process.

2. Add the Postal Code data field to the Interface of the user task Enter Postal Code.
Configuring the Service Task
Procedure
1. Select the service type Web Service and then, select the operation SimpleAddressLookupOperation.
2. In the Input to Service tab, map the data field postalCode to the InputType of the requestMessage.
In the Output from Service tab, click the Auto-map button
at the right-hand corner of the
Properties view. All the Output fields which have the same name as their corresponding data fields
are mapped. Map the remaining data fields manually and save the project.
Creating a Business Service
Procedure
1. Change the process start event to a Message trigger type.
2. Generate a business service based on the start event by right-clicking the start event and selecting
Business Service > Generate .
3. In the business service, delete the user task that is created by default.
Creating a DAA of the SimpleAddressClient Project

TIBCO Business Studio Tutorials

266

Procedure
1. In the Project Explorer, right-click SimpleAddressClient and select Export > Distributed
Application Archive (DAA) Export .
2. Select the SimpleAddressClient folder and click Finish.
The DAA com.example.simpleaddressclient.daa is created under the Exports folder.

Deploying the Applications


Before deploying the ActiveMatrix BPM project, ensure that the simple organization model that is
referenced by the project is deployed.
A simple organization model SimpleOrg.zip is available at the location where you installed TIBCO
Business Studio BPM Edition.
The tutorial describes deploying the applications using the DAA module type. However, you can
choose to deploy the BPM Developer Project directly to the server.
Deploying the TIBCO SOA Project
Procedure
1. In Studio for Designers Deployment Servers view, right-click the server and select Deploy Module.
The DAA Deployment Wizard is started.
2. Select the module type Deploy DAA... and click Next.
3. In the Application Setup dialog, click Workspace..., browse and select the
SimpleAddressLookup.daa from the Studio from Designers workspace. Click Open.
4. Accept the defaults in the Administrator Setup dialog and click Next.
In the Distribution dialog, select the default target application for ActiveMatrix BusinessWorks
Service Engine. (In a typical environment, this default target application is amx.bwse.app.)
Alternately, you can select the Single Node distribution policy and choose the BWSENode from the
drop-down list.
5. Click Finish to deploy the application.
Result
The Progress Dialog displays the execution status. Click Close after the deployment completes.
Deploying the Organization Model
Procedure
1. In TIBCO Business Studio Deployment Servers view, right-click and select Deploy Module. The
DAA Deployment Wizard is started.
2. In the Application Setup dialog, click Workspace..., browse and select the com.tibco.simpleorg.daa
from the workspace. Click OK, and then click Next.
3. Accept the defaults in the Administrator Setup dialog and click Finish.

TIBCO Business Studio Tutorials

267

Result
The Progress Dialog displays the execution status. Click Close after the deployment completes.
Deploying the ActiveMatrix BPM Project
Procedure
1. In TIBCO Business Studio Deployment Servers view, right-click the server and select Deploy
Module.
2. Select the module type Deploy DAA... and click Next.
3. In the Application Setup dialog, click Workspace..., browse and select the
com.example.simpleaddressclient.daa from the workspace. Click Next.
4. Accept the defaults in the Administrator Setup dialog and click Next.
5. In the Property Configuration dialog, override the value of the HttpInboundConnectionConfig
property by clicking Override... and selecting the Existing Resource Instance httpConnector. Click
OK and then click Next.
6. In the Wiring Configuration dialog, wire the promoted reference to the virtualized service
SimpleAddressLookup/SimpleAddressLookupPortType/Virtualization and click away from the
field.
Sometimes the virtualized service may not be visible. In this case, you must refresh the
deployment server view and repeat the steps to deploy the ActiveMatrix BPM project.
7. Click Finish to deploy the application.

Testing the Integration Between Applications


You can use TIBCO Workspace to test the integration.
Procedure
1. Log in to TIBCO Openspace.
2. Create an LDAP Container and map the participants to LDAP resources.
See section How to Map Users to the WelcomeUsers Organization Model in the Create,
Deploy, and Run Your First BPM Application tutorial for details on how to create an
LDAP container and map participants to LDAP resources.
3. Log in to TIBCO Workspace.
4. In the Business Services tab, select and start the business service
SimpleAddressLookupClientStartEvent.
5. In the Work Views tab, open the work item from the Work Items Inbox. Enter the postal code SN2
8BL and click Submit.
The input data is passed to the SimpleAddressLookupService provided by ActiveMatrix
BusinessWorks Service Engine, which processes the data and returns the result.
6. Refresh Workspace and open the work item to view the address.

TIBCO Business Studio Tutorials

268

Result

You can start the business service again and repeat the test with different values for the postal code.
Next Steps
You can:

proceed to the next section Using the Schema Construct xsd groups which explains how to use the
schema construct xsd:groups in the BPM process.

follow the tutorial Using Schema Constructs in a BPM Process which describes how to use the
schema construct xsd:choice in the BPM process and how to map the fields in the Output From
Service tab.

Using the Schema Construct xsd groups


The generated BOM when the output type uses the schema construct xsd:groups is similar to the
generated BOM for the output type using xsd:sequence.

The mapping for the output from the service task to the data fields is also similar. See Configuring the
Service Task for details.
The projects GroupAddressLookup.zip, GroupAddressLookup-BW.zip, and
GroupAddressClient.zip are supplied.
Procedure
1. Find GroupAddressLookup-Solution.zip from the location where you installed TIBCO Business
Studio and unzip the package into a temporary folder.
2. Import the projects GroupAddressLookup.zip and GroupAddressLookup-BW.zip into your
Studio for Designers workspace.
3. Import the project GroupAddressClient.zip into your TIBCO Business Studio workspace.
TIBCO Business Studio Tutorials

269

Result
After importing the projects into the workspaces, run the applications as explained in Testing the
Integration Between Applications.

Using Schema Construct xsd choice in a BPM Process


The use of the schema construct xsd:choice in a BPM process can be demonstrated.
The tutorial is an extension of How to Call a TIBCO ActiveMatrix BusinessWorks Service from a BPM
Process and demonstrates the mapping of the web service output containing structured data.
The ActiveMatrix BusinessWorks service used in this tutorial provides an address lookup service that
takes a postal code as an input, and returns the address (if the postal code specified is valid) or an
appropriate message.
You should work through each section in turn to complete the tutorial.

The business process in this tutorial calls the virtualized ActiveMatrix BusinessWorks service via a
web service invocation.

The input of the business process accepts a postal code as a text string. The ActiveMatrix
BusinessWorks process is designed to recognize and return the address for the following postal
codes: SN2 8BL, CA 94304, and MA 02144. For all other values, or for an empty postal code, an
appropriate error message is returned.

The address lookup service uses structured data (xsd:choice) to return the address of the postal
code.
In this tutorial, the TIBCO Business Studio variant that is installed with ActiveMatrix
BusinessWorks Service Engine is referred to as Studio for Designers, and the one installed
with ActiveMatrix BPM is referred to as TIBCO Business Studio.

Prerequisites

You are familiar with the concepts and working of TIBCO ActiveMatrix BusinessWorks and TIBCO
ActiveMatrix BusinessWorks Service Engine.

You are familiar with WSDLs and schema constructs.

You have completed the tutorial How to Call a TIBCO ActiveMatrix BusinessWorks Service from a BPM
Process. If not, you must complete the following tasks described in that tutorial:

Setting up the Environment required to run the tutorials.

Importing the Simple Organization Model (Optional).

Before You Begin


Import the TIBCO SOA Project and ActiveMatrix BusinessWorks Project
The projects - TIBCO SOA Project containing the BusinessWorks component, and the associated
ActiveMatrix BusinessWorks project - required to test the integration are supplied.
Find the projects ChoiceAddressLookup.zip and ChoiceAddressLookup-BW.zip from the location
where you installed TIBCO Business Studio and import them into your Studio for Designers
workspace.

Creating the BPM Developer Project


You must first create a new BPM Developer project.

TIBCO Business Studio Tutorials

270

Procedure
1. In TIBCO Business Studio BPM Edition Project Explorer view, right-click and select New > BPM
Developer Project to create a new BPM Developer Project called ChoiceAddressClient.
2. Specify the BPM destination environment and click Next.
3. Accept the default values on the screens until the Business Processes screen. Enter the name of the
Process Package as ChoiceAddressLookupClient.
4. Accept the default values on the remaining screens and click Finish to create the project.

Importing the ActiveMatrix BusinessWorks Service Engine WSDL


When you import the WSDL file into the BPM Developers project, the associated Business Object
Model is generated under the Generated Business Objects folder.
Procedure
1. In the Project Explorer, right-click the Service Descriptors folder and select Import, and then select
Service Import Wizard.
2. Choose the option to Import from a File and click Next.
3. Browse to the location of the Studio for Designers workspace and select the file
ChoiceAddressLookup.wsdl from the imported ChoiceAddressLookup-BW project, and click
Open.
4. Verify the project location and click Finish.
5. The Business Object Model is generated in the Generated Business Objects folder with the
following classes:
Result

InputType with a single attribute postalCode of type Text.

OutputType with classes UKAddressType and USAddressType.

TIBCO Business Studio Tutorials

271

UKAddressType with the following attributes:

UKAddressLine1: mandatory; Text

UKAddressLine2: mandatory; Text

UKCity: mandatory; Text

county: mandatory; Text

postalCode: mandatory; Text

USAddressType with the following attributes:

USAddressLine1: mandatory; Text

USAddressLine2: mandatory; Text

USCity: mandatory; Text

state: mandatory; Text

ZIPCode: mandatory; Text

FaultType - a primitive type.

Defining the Type Address in the BOM


When implementing a choice, the result of the choice is unknown at design-time. Hence, you need to
extract the address from the output type instance before displaying it using the user task.
In TIBCO Business Studio, create a business object model with a class Address and the following
attributes:

Address1

Address2

City

Province

PostalCode

TIBCO Business Studio Tutorials

272

Country

Defining the Business Process


The output of the web service task implements a choice. Since the outcome of the choice is unknown at
design-time, you should not map the individual output fields to the corresponding data fields at
design-time. Instead, you must map the response message to the output type instance where both
implement the choice.
Configuring the Business Process
Procedure
1. Create four tasks in the project: a user task that accepts the postal code to be passed to the
ActiveMatrix BusinessWorks service, a web service task to call the service, a script task to extract
the address, and a final user task to display the result of the web service call.

2. Create a participant to be used in the User tasks and map the participant to both the User tasks.
Creating the Data Fields
Procedure
1. Create the following data fields for the ChoiceAddressLookupClient-Process, where
AddressInstance is a reference to the type Address defined in the Business Object Model and
OutputTypeInstance is a reference to the type OutputType defined in the Generated Business
Object Model.

TIBCO Business Studio Tutorials

273

2. Add the data field Postal Code to the Interface of the user task Enter Postal Code.
3. Add the data fields AddressInstance and OutputTypeInstance to the Interface of the service task
Query Address and of the script task Extract Address.
4. Add the data field AddressInstance to the Interface of the user task Display Address.
Configuring the Service Task
Procedure
1. Select the service type Web Service and then, select the operation ChoiceAddressLookupOperation.
2. In the Input to Service tab, map the data field postalCode to the InputType of the requestMessage.

3. In the Output from Service tab, map the OutputType of the response message to the
OutputTypeInstance.
You must not map the individual data fields as the outcome of the schema construct
choice is unknown at design-time. Also, if the mapped data is not returned at runtime, the
mapping at design-time will throw an exception.

Configuring the Script Task


Procedure
1. In the Properties tab for the Script task, define the script task as JavaScript.

TIBCO Business Studio Tutorials

274

2. In the Describe Task Script field, enter the following code to extract the address:
AddressInstance = com_tibco_businessobjectmodel_Factory.createAddress();
if (OutputTypeInstance.UKAddress != null)
{
AddressInstance.address1 = OutputTypeInstance.UKAddress.UKAddressLine1;
AddressInstance.address2 = OutputTypeInstance.UKAddress.UKAddressLine2;
AddressInstance.city = OutputTypeInstance.UKAddress.UKCity;
AddressInstance.province = OutputTypeInstance.UKAddress.county;
AddressInstance.country = "UK";
AddressInstance.postalCode = OutputTypeInstance.UKAddress.postalCode;
}
else
{
AddressInstance.address1 = OutputTypeInstance.USAddress.USAddressLine1;
AddressInstance.address2 = OutputTypeInstance.USAddress.USAddressLine2;
AddressInstance.city = OutputTypeInstance.USAddress.USCity;
AddressInstance.province = OutputTypeInstance.USAddress.state;
AddressInstance.country = "USA";
AddressInstance.postalCode = OutputTypeInstance.USAddress.ZIPCode;
}

Creating a Business Service


Procedure
1. Change the process start event to a Message trigger type.
2. Generate a business service based on the start event by right-clicking the start event and selecting
Business Service > Generate .
3. In the business service, delete the user task that is created by default

Deploying the Applications


Before deploying the ActiveMatrix BPM project, ensure that the simple organization model that is
referenced by the project is deployed.
A simple organization model SimpleOrg.zip is available at the location where you installed TIBCO
Business Studio BPM Edition.
The tutorial describes deploying the BPM Developer Project directly to the server. However, you can
choose to deploy the applications using the DAA module type.
Deploying the TIBCO SOA Project
Procedure
1. In Studio for Designers Deployment Servers view, right-click the server and select Deploy Module.
The DAA Deployment Wizard is started.
2. In the Application Setup dialog, click Workspace..., browse and select the
ChoiceAddressLookup.daa from the Studio from Designers workspace. Click Open.
3. Accept the defaults in the Administrator Setup dialog and click Next.
In the Distribution dialog, select the default target application for ActiveMatrix BusinessWorks
Service Engine. (In a typical environment, this default target application is amx.bwse.app.)
4. Click Finish to deploy the application.

TIBCO Business Studio Tutorials

275

Result
The Progress Dialog displays the execution status. Click Close after the deployment completes.
Deploying the Organization Model
Note that this needs to be done only if the organization model had not been deployed previously.
Procedure
1. In TIBCO Business Studio Deployment Servers view, right-click and select Deploy Module.... The
DAA Deployment Wizard is started.
2. Select the module type Deploy BPM Project and click Next.
3. In the Select Project dialog, select Simple Org and click Next.
4. Verify the environment name and application name in the Administrator Setup dialog and click
Finish.
Result
The Progress Dialog displays the execution status. Click Close after the deployment completes.
Deploying the ActiveMatrix BPM Project
Procedure
1. In TIBCO Business Studio Deployment Servers view, right-click the server and select Deploy
Module....The DAA Deployment Wizard is started.
2. Select the module type Deploy BPM Project and click Next.
3. In the Select Project dialog, select ChoiceAddressClient and click Next.
4. Verify the environment name and application name in the Administrator Setup dialog and click
Finish.
5. In the Property Configuration dialog, override the value of the HttpInboundConnectionConfig
property by clicking Override... and selecting the Existing Resource Instance httpConnector. Click
OK and then click Next.
6. In the Wiring Configuration dialog, wire the promoted reference to the virtualized service
ChoiceAddressLookup/ChoiceAddressLookupPortType/Virtualization.
7. Click Finish to deploy the application.

Running the Tutorial


You can use TIBCO Workspace to test the integration.
Procedure
1. Log in to TIBCO Workspace.
2. In the Business Services tab, select and start the business service
ChoiceAddressLookupClientStartEvent.

TIBCO Business Studio Tutorials

276

3. In the Work Views tab, open the work item from the Work Items Inbox. Enter the postal code SN2
8BL and click Submit.
The input data is passed to the ChoiceAddressLookupService provided by ActiveMatrix
BusinessWorks Service Engine, which processes the data and returns the result.
4. Refresh Workspace and open the work item to view the address.
Result

You can start the business service again and repeat the test with different values for the postal code.

TIBCO Business Studio Tutorials

277

Integrating Data Using POJO


How to Integrate Data into a Process using Plain Old Java Objects (POJO)
This tutorial explains two dependencies of the POJO along with invoking business logic in existing
POJOs from within a business process.
From this tutorial, you will learn:

The POJO with two kinds of dependencies: dependency on a local library, and a dependency on an
external library that is already deployed in the BPM node

Adding a Java service step to a Process

Adding the input/output mappings to/from the Java step

Deploying and running an instance of this process

Importing the Initial Resources


As a starting point, use TIBCO Business Studio projects and a simple POJO supplied with this project.
The POJOTutorialInput archive contains:

A simple POJO that will perform an address lookup based on postal code
(com.example.addresslookup.pojo2).

The POJO has a dependency on an external library already deployed in the BPM node (log4j) and
another that is included in the archive provided, and which you will import
(com.example.addresslookup.lib).

A BPM project with a business process that will invoke the POJO to find the full address of a TIBCO
office from its postal code (AddressLookupInput).

A BPM project with an Organization Model that defines a Group used by the Process
(UC2OrgModel).

Procedure
1. From TIBCO Business Studio, start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. To import the projects into your workspace, find the POJOTutorialInput.zip file in the location
where you installed TIBCO Business Studio (for example, <STUDIO_HOME>\studio\3.n\samples).
3. In TIBCO Business Studio, choose File > Import . The Import wizard is displayed.
4. On the Select page, expand General, select Existing Studio Projects into Workspace and click
Next. The Import Projects page is displayed.
5. Click Select archive file, and click on the Browse button.
6. Browse to the archive zip file and click Open. The projects are displayed in the Import wizard.

TIBCO Business Studio Tutorials

278

7. Click Finish. The contents of the POJOTutorialInput archive are installed in your workspace. It
contains the following:

AddressLookupInput

UC2OrgModel

com.example.addresslookup.lib

com.example.addresslookup.pojo2

Creating a Java service task


To add a Java Service Task you need to first create the task and then map it to the project.
Procedure
1. Expand the AddressLookupInput project, and open the Find Address process that it contains.
2. In the Process Editor window, add a service task between the first (Capture postal code) and
second (Display address) user tasks, and rename it Find full address. (The Service Task will show
an error as it expects a mapping, which you will add later).

3. Select Java in the Service Type drop down.


4. Click the Select Class button and on the resulting filtered dialogue start typing AddressService
until you see the service implementation in the project named com.example.addresslookup.pojo2.
Click OK to select.
5. You will be asked if you want to add com.example.addresslookup.pojo2 as a reference project.
Click Yes to add it.
6. Select from the available methods. In this case there is only one (lookup (String) - String) so it
defaults for you.
7. Save the project.

Setting up Data Inputs and Outputs


Data inputs and outputs must be mapped.
Procedure
1. From the Properties view for the Find full address service task, select the Input to Service tab and
expand lookup(): String on the right hand side.

TIBCO Business Studio Tutorials

279

2. To make the mapping, select postalCode on the left hand side, and drag and drop to postalCode on
the right. You will see a mapping. The red error marker on the Find full address service task, and
on the lookup(): String on the right hand side of the mapping will now disappear, as well as the
error in the Problems view.

3. Select the Output from Service tab and expand lookup(): String. Map RETURNVALUE to address.
Result

Deploying and Running the Process


You must deploy the AddressLookupInput and UC2OrgModel projects before they can be run.
Deploying these projects is similar to the deployment of the WelcomeUsers project described in the
Create, Deploy, and Run Your First BPM Application tutorial. See deployment of the WelcomeUsers
project for more details.
Procedure
1. Connect to your deployment server.
2. Deploy the UC2OrgModel project (which contains the Organization Model you use).
3. Deploy the AddressLookupInput project (containing the process).
4. If you have not already done so, log into TIBCO Openspace. Then:
a) Open the Organization Browser.
b) Add a user to the Group (called Group) which is part of the organization model you deployed.
c) Start a business process.
d) Log in as the user you created in the Group in the organization model.
e) Wait for the work item to arrive, open it, then enter the postal code (you can enter SN2 8BL
which is the postal code for a TIBCO office).
f) Wait for the next work item to appear and check it has the address.

TIBCO Business Studio Tutorials

280

Providing Services
Exposing a Process as a Service
This tutorial shows you how to create a business process that is exposed as a service in the BPM
runtime. The process:

Accepts a users name as an input message from a client application.

Runs a script to generate a welcome greeting that contains the users name.

Returns the greeting in an output message to the client application.

You should work through each section in turn to complete the tutorial.
A process (acting as a service supplier) can expose service operations that can be invoked by other
processes or applications (service consumers).
The process in this tutorial exposes a request-response operation to receive a message from, then
return a response to, a calling application or process.

The WSDL document that defines the request-response operation is provided by the process:

The abstract WSDL is automatically generated by TIBCO Business Studio.

You can generate the concrete WSDL from the Administrator interface in the BPM runtime then
provide it to client application developers.

Prerequisites
You should be familiar with the basics of designing, implementing and deploying process-based
applications using TIBCO Business Studio. If you are not familiar with these things, you should run
through the following tutorials before attempting this one:

How to Design a Simple WelcomeUsers Business Service

How to Implement and Deploy the WelcomeUsers Application

Creating a WelcomeUsersService Project


Use the New BPM Developer Project wizard to create a WelcomeUsersService project.
On the toolbar, select the New tool (

), then choose BPM Developer Project.

Procedure
1. Enter WelcomeUsersService as the Project name.
2. Select BPM in the Destination Environments.
3. Click Finish. The project is displayed in Project Explorer.
4. Expand the project and rename the default process to WelcomeUsersService.
TIBCO Business Studio Tutorials

281

5. Press CTRL + S to save the project.

Configuring the Start Event to Receive a Message From a Client


When a process is exposing a request-response operation, the start event defines the request (Input)
message which, when received from a client, will start the process. The start event must be configured
as a message trigger type.
Defining a start event as a message trigger type causes TIBCO Business Studio to automatically
generate:

an abstract WSDL file - this defines the service operation provided by the start event.

a system participant - this defines the endpoint URI that will be exposed by the process (in the form
packageName/processName).

Procedure
1. Select the Start Event.
2. In the Properties view, General tab, change the Label to Get users name.
3. Change the Trigger Type from None to Message Trigger. TIBCO Business Studio automatically
generates a default service and operation for the Start Event, the details of which are displayed in
the right-hand pane of the tab.

4. Press CTRL + S to save the project. Note that two additional project artifacts have been
automatically created:

a WSDL document, WelcomeUsersService.wsdl , in the Generated Services folder.

a system participant, WelcomeUsersService, in the package-level Participants folder.

TIBCO Business Studio Tutorials

282

Configuring the End Event to Return a Message to the Client


When a process is exposing a request-response operation, the end event defines the response (Output)
message which will be returned to the client when the process ends.
The end event must be configured both:

as a message trigger type, and

as the reply to the earlier request, by pairing it with the upstream start event.

Defining an end event as a message trigger type causes TIBCO Business Studio to automatically update
the abstract WSDL file to add a response message to the service operation provided by the start event.
Procedure
1. Select the End Event.
2. In the Properties view, General tab, change the Label to Send greeting.

TIBCO Business Studio Tutorials

283

3. Change the Result Type from None to Message Result. By default, the end event is automatically
paired with the Get users name start event - this is shown in the left-hand pane of the tab.

The right-hand pane of the tab displays the implementation details defined by the start event.

Defining the Data Inputs to and Outputs from the Process


Formal Parameters must be used to define the inputs to and outputs from the process.
The formal parameters must be mapped to matching message input and output parts in the WSDL
document.
When you create a formal parameter, TIBCO Business Studio automatically creates a corresponding
message part in the WSDL document, and maps the two together.
Procedure
1. In Project Explorer, expand the WelcomeUsersService process and select Parameters.

TIBCO Business Studio Tutorials

284

2. In the Properties view, Parameters tab, add two formal parameters, UserName and Greeting, with
the following characteristics.

Make sure that the Mode value for UserName is In, and for Greeting is Out.
3. Select the Get users name start event.
4. In the Properties view, Input to Process tab, note that the UserName formal parameter has been
automatically mapped to a UserName service input parameter.

5. Select the Send greeting end event.


6. In the Properties view, Output from Process tab, note that the Greeting formal parameter has been
similarly automatically mapped to a Greeting service output parameter.

7. Save the project.


8. In Project Explorer, expand the Generated Services folder and double-click the
ProcessPackage.wsdl file. The WSDL document is displayed in the WSDL Editor. It should look
like this.

If the WSDL source view is displayed click the Design tab at the bottom of the WSDL
Editor.

TIBCO Business Studio Tutorials

285

Result
The WSDL document indicates that the process provides a single PortType, WelcomeUsersService,
which provides a single Getusersname operation. The operation has:

an input message that provides a UserName string, and

an output message that returns a Greeting string.

Creating a Script to Generate the Welcome Greeting


The WelcomeUsersService process does not do anything complex between its start and end events. It
simply runs a script that:

takes the UserName string provided by the start event.

generates the Greeting string that will be returned by the end event.

Procedure
1. Click the Script tool in the Palette in the Tasks drawer.
2. Position the mouse pointer over the sequence flow between the Get users Name start event and the
Send greeting end event, then click to add the script task.
3. Change the script task label to Generate greeting.
4. In the Properties view, General tab, change the Script Defined As field to JavaScript.
5. Enter the following script:
Greeting = "Hello " + UserName + ".";

6. Save the project.

Deploying the Application


This step assumes that you have created the XYZ Work Server1 Deployment Server, as described in the
How to Implement and Deploy the WelcomeUsers Application tutorial; and that the server is connected.
Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and click Deploy Module. The
Deploy Module(s) wizard is displayed.
2. Select Deploy BPM Project and click Next. The Select Project dialog is displayed.
3. Select WelcomeUsersService as the module to deploy, then click Next. There is a short pause while
the necessary files generate.
4. In the Administrator Setup dialog, click Next.
5. The Property Configuration dialog is displayed. HttpInboundConnectionConfig is a string with
the value ProcessPackage_WelcomeUsersService. It identifies the HTTP Connector resource
instance that the BPM runtime will use to make the service available to client applications.
6. Click Finish. The Progress Dialog is displayed while deployment takes place, and should indicate
that deployment has finished with no errors. Progress messages are also displayed in the Console
view.
7. In the Deployment Servers view, expand XYZServer1 <BPM_app> (where <BPM_app> is your BPM
application, by default amx.bpm.app). A com.example.welcomeusersservice entry is displayed,
indicating that the application has been deployed to the BPM runtime.

TIBCO Business Studio Tutorials

286

Generating the WSDL


Developers of client applications who want to use the WelcomeUsers service will need a concrete
WSDL to be able to access the application. You can generate this WSDL from the Administrator
interface in the BPM runtime.
If you do not have access to the Administrator interface in the BPM runtime, you will need to get an
administrator to perform this step for you.
Procedure
1. In the Deployment Servers view, right-click XYZ Work Server1 and select Open > Administrator .
The login screen for the Administrator interface in the BPM runtime is displayed.
2. Log in using an appropriate username and password.
3. Click Applications.
4. In the Applications list, click com.example.welcomeusersservice_1.0.0.timestamp. The application
details are displayed below the list.
Make sure that the application has deployed successfully. The Runtime State shown
against com.example.welcomeusersservice should be Deploy with Start Successful.
5. On the Details tab, click Binding Status.
6. Select the Binding Path entry that ends in WelcomeUsersService_EP (in service).

7. Click Generate WSDL. The WSDL document representing the deployed service is displayed (in a
new browser window).
8. Right-click anywhere in the browser window and select View Source to open the WSDL in
Notepad.
9. Save the document as a text file called WelcomeUsersService.wsdl. You can now supply this to
client application developers.
Note that the soap:address location element uses an IP address of 0.0.0.0. A client
application (or process) running on the same BPM runtime instance as the BPM
application can use this WSDL unaltered to access the service.
If you want to access the service from a client application that is hosted on a remote
system, you will need to replace this IP address with the IP address of the server that is
running the BPM application.

TIBCO Business Studio Tutorials

287

Testing the Application


The WelcomeUsers service can now be invoked (using the WelcomeUsersService.wsdl file) from
another process or SOA application running in the BPM runtime, or from an external application.
All access to the BPM runtime must be by an authenticated user. Any unauthenticated request will be
rejected.
An external application must therefore pass the security credentials - encoded username and password
- of an authenticated BPM runtime user in every message it sends to the BPM runtime.
The encoded username and password (compliant with the Web Services Security UsernameToken
Profile) must be included in a standard SOAP or HTTPS security header via HTTPS communications.
For demonstration purposes, this tutorial uses the open source tool soapUI to generate and run a
simple external application that can call the WelcomeUsers service. You can, if you prefer, use any
other tool that allows you to generate and send a SOAP request from a WSDL file.
Procedure
1. If you do not already have soapUI on your system, download it from http://www.soapui.org.
2. Edit the soap:address

location

element in the WelcomeUsersService.wsdl file as follows:

a) Save the file.


3. Start soapUI.
4. Create a new WSDL project that uses WelcomeUsersService.wsdl.
5. Select the Create Requests checkbox to create sample requests for all operations.
6. Right-click on the project name and select Show Project View.
7. In the Project View dialog, select the Security Configurations tab.

TIBCO Business Studio Tutorials

288

8. Click the
icon to create an outgoing WS-Security Configuration for the project, specifying the
name and password of an authenticated BPM runtime user.
For example:

9. Close the Project View dialog.


10. Expand the project until you reach the Request 1 request on the StartEvent operation.

11. Press ENTER to open the Request Editor. The SOAP request is displayed in the left-hand pane.
12. Replace the default ? value in the parameter string:
<_yit:WelcomeUsersService_UserName>?</_yit:WelcomeUsersService_UserName>

with the value George - this is the user name you will pass to the WelcomeUsers service.
<_yit:WelcomeUsersService_UserName>George</
_yit:WelcomeUsersService_UserName>

TIBCO Business Studio Tutorials

289

13. Click the Aut button (Authentication and Security-related settings) and select the outgoing WSSecurity Configuration you defined earlier as the Outgoing WSS. For example:

Click
to submit the request to the BPM runtime. The following response is displayed in the
right-hand pane:
Hello George.

This shows that the WelcomeUsers service has been invoked. The application has received the
incoming string George, run the Generate greeting script and returned the customized greeting to
the soapUI client.

Using Mediation to Transform and Route an Event to TIBCO BPM


TIBCO Business Studio can be used to create a mediation flow that routes the incoming request to the
correct service implementation (either US or UK service) based on the country name contained in the
incoming request message.
Prerequisites
You should be familiar with the basics of designing, implementing and deploying composites and
mediation components using TIBCO Business Studio. If you are not familiar with these things, you
should run through the following tutorial before attempting this one:

How to Create and Package a Content-Based Routing Mediation Flow - You can find this tutorial in the
TIBCO Business Studio Help under Help > Cheat Sheets > TIBCO SOA Development >
Mediation , and elsewhere.

Each WSDL used in this tutorial implements a call to an Apache Axis2 web service. Before you
begin, you must deploy these web services to a J2EE server (such as Apache Tomcat) that is running
version 1.4.1 of the Axis2 engine.

Procedure
1. Download the AddressServiceAARs.zip file to a temporary directory and unzip it. The zip file
contains the following Axis2 web service archives:

AddressService.aar

UKAddressService.aar

USAddressService.aar

TIBCO Business Studio Tutorials

290

2. Deploy the three aar files to a J2EE server that is running the Axis2 engine, version 1.4.1.
See http://ws.apache.org/axis2/index.html for more information about Axis2.
3. Make sure that these web services have been properly deployed and are running.
Result
If you wish to deploy and test a project that invokes the services implemented in this project, you will
need to have completed the How to Call a Web Service From a Process tutorial.

Creating a TIBCO SOA Project


Use the SOA Resource wizard to create a new SOA project.
Procedure
1. Open Studio for Designers.
2. Select File > New > TIBCO SOA Resources .
The TIBCO SOA Resource Wizard displays.
3. Select TIBCO SOA Project and click Next .
4. Type mediation.myaddressservice.soa in the Project name field and click Next.
5. Accept default values for all checkboxes in the Asset Type Selection dialog and click Next.
6. Select Empty SOA Project in the Composite Project dialog and click Next.
7. Type AddressServiceMediation in the Composite File name dialog and click Next.
8. Click Finish.

Importing the WSDL Files


The wsdl files that you need for this project are provided with TIBCO Business Studio.
Procedure
1. Find the AddressServiceWSDLs.zip file in the location where you installed TIBCO Business Studio
(for example, <STUDIO_HOME > \studio\3. n\samples).
2. Unzip it to a suitable location.
3. In the Project Explorer view, right-click the mediation.myaddressservice.soa > Service Descriptors
folder and select Import > Import > File System .
4. Click the Browse... button

to the right of the From Location field.

5. Navigate to the directory containing the WSDL files.


6. Select the following files for import:

AddressService.wsdl

USAddressService.wsdl

UKAddressService.wsdl

7. Click Finish to import the WSDL files into your project.

Creating and Configuring the Mediation Flow Diagram


In this procedure you create the diagram that defines the mediation flow.
TIBCO Business Studio Tutorials

291

Procedure
1. In the Project Explorer, open the mediation.myaddressservice.soa project.
2. Right-click Mediation Flows and choose New > Mediation Flow from the popup menu to open the
Create Mediation Flow wizard.
3. Select Single empty mediation flow and then click Next.
4. In the Mediation Flow Name field, type AddressService.
5. Click Finish. An AddressService.mediation editor displays.

6. Drag and drop the AddressService.wsdl from the Project Explorer view onto the Mediation
Interfaces pane.
7. Similarly drag and drop the USAddressService.wsdl and UKAddressService.wsdl files onto the
Target Interfaces pane.

8. Save the project.

TIBCO Business Studio Tutorials

292

Adding a Route Mediation Task


To associate the LookUpAddress operation from the Mediation Interface with the target operation you
need to perform some steps.
Procedure
1. Select the LookUpAddress operation from the Mediation Interface.
2. Drag and drop a Route mediation task from the palette to the Mediation Path.

TIBCO Business Studio Tutorials

293

3. Open the Properties > Decision tab of the Route task.


a) Click on Case 1 rule case and rename it to USA.
b) Click the Add rule variable icon
on the tool bar in the Decision tab and specify country for
the Variable Name and accept the String Type.
c) Select the country variable for the USA rule case and choose the "=" comparison operator from
the dropdown.

d)
e) Assign the string USA by typing it between the two single quotes that appear after the operator.

f)
g) To assign the target operation that invokes when this rule is satisfied, select the USA rule case.
Click in the Target Service/ Operation column and choose the AddressServicePortType/
LookupAddress from the drop-down list.
h) Add another rule case, click the Add rule case icon
and rename it UK.
i) Select the country variable for the UK rule case and choose the "=" comparison operator and
assign the string UK between the single quotes.
j) To assign the target operation that invokes when this rule is satisfied, select the UK rule case.
Click in the Target Service/ Operation column and choose the AddressServicePortType1/
LookupAddress from the drop-down list.

k)
4. Open the Input tab of the Route task and expand the MessageData tree, so that all the elements are
visible.

TIBCO Business Studio Tutorials

294

5. Click the country element and then drag and drop to map it to the country rule.

6. Save the project.

Adding Transform Mediation Tasks


To associate the LookUpAddress operation from the Mediation Interface with the target operation you
need to perform some steps.
Adding Transform Tasks in the Input Path View
Procedure
from the Data drawer of the palette, and add a Transform
1. Select the Transform tool
task to the Mediation Path to the right of the USA label.
2. Select the Transform task. On the Input tab of the Properties view, expand the MessageData tree, so
that all parameters are visible.
3. Click the postal code element and then drag and drop to map it to the postal
for the country element.

code

rule. Repeat

4. Repeat Step 1 to Step 3 to add another Transform task to the UK branch of the path, and map the
same elements.

TIBCO Business Studio Tutorials

295

Configuring the Throw Fault Task


Procedure
1. Select the ThrowFault task
(at the end of the Otherwise path in the AddressService.mediation
tab) and click the Browse button in the General tab of the Properties view.
2. The Select a WSDL Message dialog displays. The first three messages are listed as
InvalidCountryFaultMessage; a full pathname displays if you highlight the message. Select the
message that corresponds to the AddressService.wsdl file and click OK.
from the Data drawer of the palette, and add a Transform
Select the Transform tool
task in front of the ThrowFault task on the Otherwise path.

3. Select the Transform task. On the Input tab of the Properties view, expand the MessageData tree, so
that all parameters are visible.

TIBCO Business Studio Tutorials

296

4. This message has to be modified to include an error message as well as the value of the invalid
country code. To do this:
a) Select the Functions tab and expand String Functions.

b)
c) Drag and drop a concat string function to the XPath Expression column next to invalidCountry.

d)
e) In the XPath Expression text box, type this return message to replace the <<string1>>
placeholder, enclosing the message in double quotes:
"Invalid country supplied: "

f) Click the Data Source tab drag and drop country from the Message Data tree into the
<<string2>> placeholder.

g)
h) Click the Show Check and Repair icon
.
i) One error displays. Select the checkbox in the Fix column for the displayed error and click OK.
5. Save the project.

TIBCO Business Studio Tutorials

297

Adding Transform tasks in the Output Path View


Procedure

located on the top right

1. Navigate to the output path view by clicking the Output path icon
area of the Mediation Flow.
2. Add a Transform task to each of the two branches of the Mediation path.

3. For each Transform task in turn:


a) Select the task. On the Input tab of the Properties view, expand the MessageData tree, so that all
parameters are visible.
b) Map each line of the address in the Data Source tab to the corresponding line in the Mediation
Operation Context pane to the right.

4. Save the project.


Configuring the Fault Path View
Procedure

1. Navigate to the fault path view by clicking the Fault path icon
the Mediation Flow.

located on the top right area of

TIBCO Business Studio Tutorials

298

2. Select the last InvalidCountryFaultMessage fault

from the mediation fault path.

3. On the Properties > General tab for this fault choose the InvalidCountryFaultMessage from the
Fault to Send drop down list.

4. Repeat Step 2 and Step 3 for each fault that displays an error indicator.
5. For each fault that still displays a problem, add a Transform task on the Path to the left of the fault
marker (as the Timeout Faults already havesee the illustration in Step 2).
6. For each fault in turn:
a) Select the new Transform task.
b) On the Input tab of the Properties view, drag and drop the parameter that reflects the name of
the fault from the Data Source tab to the corresponding value on the right-hand side.
7. Save the project.

Creating the Shared Resources


You must create the substitution variables which will be bound to the shared resources variables; then
create the shared resources themselves; and then carry out the binding.
Creating Substitution Variables
Procedure
1. In the Project Explorer, expand the Resource Templates folder.

TIBCO Business Studio Tutorials

299

2. Double-click the SubstitutionVariables.substvar file.


The file opens in the SVar Configuration editor.
Click the Add icon

3. Type HostNameUS in the Name field, select String from the Type drop-down list and type
localhost in the Value field.
4. Similarly add another variable.
Type PortNumUS in the Name field, select Integer from the Type drop-down list and type 8080 in
the Value field.
5. Repeat step 4 and step 5 to create the HostNameUK and PortNumUK variables.

Creating the Shared Resources


Procedure
1. In the Project Explorer, right-click the Resource Templates folder, and select New > HTTP Client
Resource to open the New HTTP Client Resource Template dialog.
2. In the File Name field, type USAddressServiceHttpClientSharedResource.httpClient
3. Click Finish. You will use this shared resource for each reference that you will create for this
composite.
4. Similarly create another HTTP Client Shared resource named
UKAddressServiceHttpClientSharedResource.httpClient
Binding Properties of the Shared Resources to the Substitution Variables
Procedure
1. In Project Explorer, double-click USAddressServiceHttpClientSharedResource.httpClient. The
HTTP Client Resource Template editor displays.

TIBCO Business Studio Tutorials

300

2. Click the icon

located on the top right of the HTTP Client Configuration pane.

The Binding Editor displays with a list of properties.

3. Select Host and click the Pick...button.


4. Select HostNameUS and click OK.
5. In the Binding Editor, select Port and click the Pick...button.
6. Select PortNumUS and click OK.
7. Click the Done button.

TIBCO Business Studio Tutorials

301

8. Repeat step 1 through step 7 to bind the substitution variables for the
UKAddressServiceHttpClientSharedResource.httpClient resource.
In step 4 select HostNameUK and in step 6 select PortNumUK.
9. Save the project.

Configuring the Mediation Composite


Use the Composite Editor to configure the Mediation Composite.
Procedure
1. In the Project Explorer, double-click the mediation.myaddressservice.soa > Composites > >
AddressServiceMediation.composite composite file.
2. Expand mediation.myaddressservice.soa > Mediation Flows and drag and drop the
AddressService mediation file to the composite editor.
This will automatically create a Mediation component.
3. Name the Mediation component AddressServiceMediationComp.

4. Save the project.

Creating the Service


This procedure shows how to create the service.
Procedure
1. In the AddressServiceMediationComp composite, right-click the Mediation component Service
chevron (the single chevron at the left of the component) and select Promote.

TIBCO Business Studio Tutorials

302

2. Select the promoted service.

3. In the Properties view for the promoted service, select the Bindings tab.
4. Click the Add Binding icon

. The Binding Type dialog is displayed.

5. Select Soap Binding and click Finish. A SOAP Service Binding is listed in the Properties view.

6. Save the project.

Creating the References


This procedure shows you how to create the references.
Procedure
1. In the AddressServiceMediationComp composite, right-click one of the Mediation component
reference chevrons and select Promote.
2. Click the promoted reference and navigate to the Bindings tab.

TIBCO Business Studio Tutorials

303

3. Click the Add Binding icon

The Add Binding dialog box displays.


4. Select SOAP Binding. The check box Generate Required Resource Templates is selected by
default. Uncheck it, in order to use the shared resource that you have already created manually.

5. Click Finish.
The new binding information is displayed in the Bindings tab.
6. In the Transport Configuration pane of the Bindings tab, click the browse button
the right of the HTTP Client Configuration field, and select
USAddressServiceHttpClientSharedResource from the dialog box.

located at

7. Click OK.
8. Save the project.
9. Repeat steps Step 1 through Step 7 for the other Mediation component reference chevron (but select
UKAddressServiceHttpClientSharedResource in Step 6).

Creating the Distributed Application Archive


The Distributed Application Archive (DAA) is what is deployed to the node.
Procedure
1. In the Project Explorer, expand the Composites folder.
2. Right-click the AddressServiceMediation.composite and select Create DAA....
3. Select the location for the deployment archive (you can accept the default Deployment Artifacts)
and click Next three times.

TIBCO Business Studio Tutorials

304

4. Click Finish.
The deployment artifacts are created.

Importing a Tutorial Solution


The solution to the tutorial is provided in the TIBCO Business Studio installation.
Procedure
1. Find the AddressServiceSolution.zip file in the location where you installed TIBCO Business
Studio (for example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
3. The Import wizard is displayed. Select General > Existing Studio Projects into Workspace and
click Next.
4. Click Select archive file, and click on the Browse button.
5. Browse to the AddressServiceSolution.zip file and click Open. The solution project is displayed in
the Import wizard.
6. Click Finish. The project is installed in your workspace.

TIBCO Business Studio Tutorials

305

Using Openspace

How to Get Started with Openspace


This tutorial describes how to customize the layout of Openspace, and how to use the Business
Services and Work Views gadgets in Openspace.
Openspace is a web application that enables you to host gadgets and widgets. Using Openspace, you
can add web content from different sources as gadgets and customize how they are displayed.
Openspace provides a unified view of all your gadgets and acts as a gateway to your frequently used
services.
Openspace provides an interface that connects to TIBCO BPM runtime. Using Openspace, you can
access the functions you need to carry out your daily tasks, such as mapping users to organizational
entities and running business services. A business service is a set of actions that accomplishes some sort
of business function. For example, a business service could be designed to handle an incoming
insurance claim. A business service can display forms, start processes, access databases, run scripts or
call web services.
On completion of this tutorial you will be familiar with:

logging into Openspace

adding gadgets in Openspace

using layouts in Openspace

using the Business Services gadget to start business services.

Before You Begin


This tutorial uses the WelcomeUsers application, which is a sample application used to illustrate BPM
functionality. For more information about the WelcomeUsers application see the Create, Deploy, and
Run Your First BPM Application tutorials.
Before you start this tutorial, make sure that:

The WelcomeUsers application is deployed to BPM. See the How to Implement and Deploy the
WelcomeUsers Application tutorial.

The user Clint Hill is mapped to the Testers position in the WelcomeUsers organization model.
See the How to Map Users to the WelcomeUsers Organization Model tutorial.

For more information about TIBCO Openspace, see the TIBCO Openspace User Guide.

TIBCO Business Studio Tutorials

306

Logging in to Openspace
You will be logging in as user Clint Hill, who was mapped to the Testers position in an earlier tutorial .
Procedure
1. In your browser, type in the Openspace login URL:
protocol://host:port/openspace

where:

protocol is the communications protocol being used by Openspace, either http or https. This
was determined at installation.

host

port

is the DNS name or IP address of the server hosting the BPM runtime.
is the port being used by Openspace. The default value is 8080.

When you start Openspace, the Openspace login screen is displayed.


2. In the User Name field, type Clint Hill.
3. In the Password field, type tibco123.
4. Select Remember User Name if you do not want to type in your user name every time you login to
Openspace.
5. Click Login.

Adding a Gadget
Openspace uses personas to determine what layouts, themes and gadgets are displayed when you log
in.
An Openspace administrator can create different personas that display different combinations of
layouts, themes and gadgets according to the requirements of their users. This is useful because it
means that users do not have to define these themselves when they first log in.
As supplied, Openspace provides two personas:

Standard. The Standard persona is initially blank. You can use the Standard persona to configure
which layouts, themes and gadgets are displayed when users log in, depending on your
requirements.

Default. If no Standard persona has been defined, the first time you log in to Openspace, the
Default persona is used. The Default persona displays a selection of tabs and gadgets that users are
most likely to find useful.

TIBCO Business Studio Tutorials

307

Procedure
1. On logging in as Clint Hill the opening tab of the Default persona is displayed,.

The Default persona has the following tabs:

Business Services

Work Views

Process Views

Reporting

Event Views

Organization

Calendar

2. Make sure that the Business Services tab is selected.

TIBCO Business Studio Tutorials

308

3. Click the tab name to display the User Preferences area.

4. Click
next to More Gadgets. The Openspace Gadget Store is displayed. It shows all the gadgets
that are available to be added to Openspace.

5. Select the Spotfire gadget.


6. Click
of the selected tab.

beside the Spotfire gadget. This gadget is added to the User Preferences area

Once the gadget has been added,


Store.

is displayed beside the gadget in the Openspace Gadget

TIBCO Business Studio Tutorials

309

7. Click to close the Openspace Gadget Store.


You can now see the Spotfire gadget on the User Preferences area of the tab.

This gadget is shown without the white border that most of the gadgets have, because it is not yet
added to any tab.
8. From the Layout pane of the User Preferences area, select box 2. The selected box changes color and
an illustration of the two-column layout is displayed..

9. Click on the two-column layout to apply it to the tab.


There is only one possible two-column layout. If you click on box 3, you see a choice of
two three-panel layouts. Click on the one you want to apply.
10. Click on the Spotfire gadget to add it to the tab.

TIBCO Business Studio Tutorials

310

11. The Spotfire gadget is added below the Work Views gadget and you need to drag it into position
next to the business services gadget.
The User Preferences area of the tab now displays the Spotfire gadget with a white box round it like
the others:

You must have a TIBCO Web Player installed to access the Spotfire BPM Visualizations. If
you do not, the error screen is displayed.
12. Click the Business Services tab name to close the user preferences area.

Starting a Business Service


When you start a business service, a message is displayed in the form instanceid invoked where
instanceid is a unique alphanumeric value that identifies this particular business service, and the first
user interface page in the business service is displayed in the gadget.
The business service does not generate work items. The user who starts the business service completes
the user interface pages for the business service and then the business service starts an instance of a
process.
The business service is considered complete when the final user interface page has been completed.
Procedure
1. Click on the business service you want to start.
There is no category set for the WelcomeUsers business service, so the business service is
displayed as uncategorized. The category is specified in TIBCO Business Studio at design
time. See "Using Categories" in the TIBCO Openspace User Guide.

TIBCO Business Studio Tutorials

311

2. Click

The business service is started and the first interface user page is displayed.

3. Type a number in thePhone Number field. the In the Username box, type Clint Hill.
4. Click Submit. Submitting the user interface page completes the business service. When business
services are completed, they are automatically purged from the system.
5. Click on the business service to display a summary of the business service details.

6. Select the Work Views tab.


7. From the Work Views gadget, click

The business service has automatically started the Welcome Users process and sent the first work
item to Clint Hills work item list.

TIBCO Business Studio Tutorials

312

8. Double-click the work item to open it. Note that the message contains the name you supplied in the
business service:

9. Click Submit. Submitting the work item completes the process. When processes are completed,
they are automatically purged from the system.
Result
Post requisites
You should now start and run some business services in the Business Services gadget.
For More Information, see:

TIBCO Openspace User Guide for more information about TIBCO Openspace.

TIBCO Organization Browser User Guide for information about how to use the Organization Browser
gadget.

TIBCO Business Studio Tutorials

313

Using Pageflows and Business Services


How to Model and Run Pageflows
A pageflow process is a short-lived process designed to display user interface pages to the user in
sequence. It can also include other activities - such as web service or database calls - which can be used
to drive the interaction with the user.
This tutorial shows you how to create a pageflow process.
A pageflow process is a specialized version of a normal business process that can be used to provide an
animated user interface - a sequence of forms rather than just a single form - for a single work item to
the same user.
Before you start this tutorial, you can become familiar with TIBCO Business Studio by completing the
following initial tutorials:

How to Design a Simple WelcomeUsers Business Service

How to Implement and Deploy the WelcomeUsers Application

You can find these tutorials under Start here > Create, Deploy and Run Your First BPM Application .
You may also wish to complete the following tutorials covering the use of the organization model:

How to Use the Graphical Organization Modeler

How to Add Groups, Capabilities and Privileges to an Organization Model

After completing this tutorial, you will be familiar with using the pageflow process.

Importing the Initial Resources


It is good practice to use a separate organization model rather than to include the model within the
same project as your business processes.
In this procedure you will import an existing project to use as the basis for this tutorial. The
WelcomeUsers project includes a business process and a business service (called RequestCall). A business
service is a type of pageflow, which is used to collect information and can be used as a mechanism to
start off a business process.
You will also import an organization model in another project.
If you are continuing this tutorial directly from a previous one, you have already started TIBCO
Business Studio, and the WelcomeUsers project may already be open. If so, skip the first two steps of
this procedure.
Procedure
1. Start Studio for Designers.
Following this tutorial will be simpler and clearer if you close any other projects that you
may have open in your TIBCO Business Studio workspace, using the Project > Close
Project menu option.
2. If the WelcomeUsers project is not open, import the solution from the tutorial How to Implement
and Deploy the WelcomeUsers Application. Find the WelcomeUsersImplementSolution.zip file
in the location where you installed TIBCO Business Studio (for example, <STUDIO_HOME >
\studio\3. n\samples).
3. In TIBCO Business Studio, select File > Import .

TIBCO Business Studio Tutorials

314

4. The Import wizard is displayed. Select General > Existing Studio Projects into Workspace and
click Next.
5. Click Select archive file, and click on the Browse button.
6. Browse to WelcomeUsersImplementSolution.zip and click Open. The
WelcomeUsersImplementSolution project is displayed in the Import wizard.
7. Click Finish. The WelcomeUsersImplementSolution project is installed in your workspace
8. In Project Explorer, expand the WelcomeUsers project.
If you are continuing from previous work with the WelcomeUsers tutorials, the project
will be called WelcomeUsers. If you have imported it, you will be using a project called
WelcomeUsersSolution. It will be referred to simply as WelcomeUsers for the rest of this
tutorial.
9. Delete the Organization Model in the WelcomeUsers project by right-clicking on Organization and
selecting Delete. You will be asked if you want to delete Organization from the file system. Click
OK to confirm.
10. Select Project > Clean... . In the Clean dialog, select the WelcomeUsers project, and press OK.
This ensures that the output file for the deleted organization model, which is normally hidden, is
also deleted.
11. Import the EasyAsExtendedOMSolution project, following the instructions above, and expand the
organization model.

Mapping a Participant to an Organization Model


First you will map the Participant Process Tester, which is used by the user task in WelcomeUsers, to a
position in the imported organization model.
Procedure
1. In Project Explorer, expand the WelcomeUsers project as far as the WelcomeUsers process, and
double-click on that process. It is displayed in the Process Editor (at the top centre of the screen).

2. Select the Display Message user task. On the General tab in the Properties view, note that the task
is assigned to the Participant Process Tester.
3. In the Project Explorer view of the WelcomeUsers project, expand Participants at the process
package level (you may need to expand the process packages as well). Note that the Process Tester
participant is already defined. Note that, both in Project Explorer and on the General tab in the
Properties view, you will see an error indicator. This is because the Process Tester participant
referred to the organization model which you deleted in Importing the Initial Resources.

TIBCO Business Studio Tutorials

315

4. On the General tab in the Properties view for ProcessTester, expand Type if it is not already
expanded.
External Reference is already selected.
5. Click

6. In the Select Type dialog, select Tester in the organization model, and then OK.

7. You will be shown the following message:

8. Click Yes to reference EasyAsExtendedOMSolution from the WelcomeUsers project.


Now the user task is still assigned to the Participant Process Tester, but that participant is now
mapped to the position Tester in the EasyAsExtendedOMSolution organization model.

TIBCO Business Studio Tutorials

316

9. Press CTRL + S to save the changes you have made.


You can save your work at any point. If there are unsaved changes, an asterisk is
displayed next to the changed organization model or process package in the Project
Explorer view.
It is advisable to save after completing each procedure.

Creating a New Pageflow Process


A pageflow process can be used to display a sequence of forms to a user, to do a particular task, like
displaying details about a users name or contact details.
In this task you create a new pageflow process to gather further details about the user, using the New
Pageflow Process wizard. This displays a series of forms which the process can use to record some
more details about the user whose name was specified in the Request Call business service and
incorporated in the Generate Message task of the WelcomeUsers process.

TIBCO Business Studio Tutorials

317

Procedure
1. When you first start the Process Editor, the palette (on the right side of the diagram) might be
collapsed; if so, click the Show Palette button (at the top right corner of the Process Editor) to
expand it.

The Palette contains a number of drawers, each of which contains a set of tools.

2. Click the Tasks drawer to open it.


3. Click the User Task tool

4. Position the mouse pointer between the existing user tasks and the end event, then click to add the
new user task.
5. Change the task name to Request Additional Data (click away from the field to save your name
change).
6. Assign Process Tester as the participant for this task.

TIBCO Business Studio Tutorials

318

7. Right-click the Request Additional Data user task and select Pageflow > Generate... .

The New Pageflow Process wizard starts.


8. On the Select Parameters For Pageflow dialog, uncheck PhoneNumber and Message, because
UserName is the only one of the existing parameters that the pageflow will use.
9. Click Next.

TIBCO Business Studio Tutorials

319

10. On the New Process Wizard dialog, label the pageflow process Request Additional Data Pageflow.
Accept the Start and End template option, and click Finish.

The process that you created is displayed in the Process Editor. A pageflow process has a different
default color scheme from a business process.
Pageflows do not contain pools or lanes.

A pageflow process is stored under the Processes branch of the Project Explorer alongside business
processes. Note that a parameter UserName has been created in the new pageflow process. This
corresponds to the parameter of the same name in the WelcomeUsers process, and is created
because you indicated in the New Pageflow Process wizard (by leaving UserName checked) that
the pageflow process would use this data.

If you look at the Properties view for the Request Additional Data task in the WelcomeUsers
process, the pageflow is indicated in the right-hand pane of the General tab.

TIBCO Business Studio Tutorials

320

Adding a Sequence of Tasks to the Pageflow Process


A pageflow process can be used to display a sequence of forms to enable the user to do a particular
task, like gathering name details about a customer.
All tasks that are available in a business process are available within a pageflow process with the
exception of a business process user task. Pageflow processes use a special task that does not have
participants, and does not generate work items. These are referred to as pageflow user tasks.
In this procedure you create the user interface tasks in the pageflow process to capture details about a
user, using the process created in Creating a New Pageflow Process.
Procedure
1. Position the mouse pointer over the sequence flow between the Start and End events, then click to
add the first user task.

2. Click the user task once to select it, then click again to make the task name editable.

3. Change the task name to Get the users cellphone number (click away from the field to save your
name change).

TIBCO Business Studio Tutorials

321

4. Add two more user tasks after the first one, and name them Get the users email address and Ask
the user for a security question (click away from the field to save your name change).
Your pageflow process now looks like the following illustration.

Associating Existing Data with the Tasks


Fields that are defined in one process cannot be directly used by another process. Data can be passed
from one process to another using parameters. You can associate a parameter with a user task in the
same way that you have already associated data fields with the user tasks in the business process.
The tasks in this pageflow process will display the user name that was entered during the initial
business service, and each task is used to collect a different piece of information about that user.
In this procedure you associate an existing (UserName) parameter with the pageflow user tasks that
you created in the previous procedure.
Procedure
1. Expand the Request Additional Data Pageflow process in Project Explorer until you can see the
Parameters.
2. Select Parameters > UserName in Project Explorer. Drag and drop UserName data field onto each
of the three tasks in this process, in turn.
Note in the following illustration the green outline that displays around the tasks to which
the UserName field has already been assigned. This is because the Enable Reference
Highlighting button in the toolbar is enabled. When you select a parameter, field or
particpantin this case, the UserName parameterthe tasks to which it is assigned are
highlighted. See "Adding Data to the Process" in the How to Design a Simple WelcomeUsers
Business Service tutorial for more details.

3. Each time, a popup menu is displayed. Click Add Data To View.

TIBCO Business Studio Tutorials

322

4. If you look at the Interface tab in the Properties view for any of these user tasks, the corresponding
parameter is displayed.

Adding Further Data to the Pageflow Process


The tasks in this pageflow process will display the user name that was entered during the initial
business service, and each task is used to collect a different piece of information about that user.
Creating Fields
In this procedure you create new data fields for the information being collected by the pageflow
process.
Procedure
1. In Project Explorer, expand the Request Additional Data Pageflow process as far as the Data
Fields entry, and select Data Fields.
2. In the Data Fields tab in the Properties view, click

to create a new field.

3. Change the Label from the default Field to Cellphone Number; leave the Type as Text.
4. Similarly add the following fields:

Email Address. Accept the default values.

Security Question. Change the Length to 500 and otherwise accept the default values.

Security Answer. Accept the default values.

Assigning Fields to Tasks


In this procedure you associate the new data fields you created with the user tasks.
Procedure
1. In Project Explorer, select the Cellphone Number field.
2. Drag the field over the Get users cellphone number user task, and drop it.
3. Select Add Data To View And Assign from the pop-up menu.
4. In the same way, assign the Email Address field to the Get users email address task
5. Assign both the Security Question and Security Answer fields to the Ask the user for a security
question task.

TIBCO Business Studio Tutorials

323

6. Press CTRL + S to save the changes made to the process.


Runtime Behavior
The user will be presented with the first task in the pageflow process, Get users cellphone
number, at runtime. As soon as they enter a value and press Submit, the same user will be
presented with the Get users email address task and Ask the user for a security question task in
turn.

Deploying the Project


Since the WelcomeUsers project references the organization model in the EasyAsExtendedOMSolution
project, the organization model must be deployed for the WelcomeUsers project to be able to run.
Save the project that you have created. You have now completed the tutorial.
Procedure
1. Check whether the EasyAsExtendedOMSolution project has already been deployed in a previous
tutorial. To do this:
a) Expand the Deployment Servers view and select your deployment server.
b) If the Properties view indicates that the Server State is Disconnected, right-click on the server in
the Deployment Servers view and select Connect.
c) Expand your selected deployment server, expand amx.bpm.app, and check whether
EasyAsExtendedOMSolution is included in the list. If so, it is deployed.
2. If it is not already deployed, deploy the organization model. Follow the procedure in the How to
Implement and Deploy the WelcomeUsers Application tutorial to deploy the
EasyAsExtendedOMSolution project.
3. Follow the same procedure to deploy the WelcomeUsers project.

Running the Project


Once you have deployed the project, you can test it by running an instance.
This assumes that users must have already been mapped to the organization model used by the
application (see the How to Model and Run Pageflows tutorial).
If you need more information about the steps in the following procedure, see the tutorial How to Run
the WelcomeUsers Application, which you can find under Start Here > Create, Deploy and Run Your
First BPM Application .
Procedure
1. Log into TIBCO Workspace by either of the following methods:

In the Deployment Servers view, right-clicking XYZ Work Server1 and selecting Open >
Workspace ;

Entering a browser URL or following a web page as directed by your system administrator.
The TIBCO Workspace login screen is displayed.

2. Enter a User Name of "Clint Hill" with a Password of "tibco123", then click OK. The main
Workspace user interface is displayed.
3. Click Business Services, and under WelcomeUsersSolution > ProcessPackage , double-click
Request Call to start an instance of the Request Call business service.
The Collect Data form is displayed.
4. Enter a name and telephone number and click Submit.
TIBCO Business Studio Tutorials

324

5. Click Work Views.


You can see that a Display Message work item has appeared in Clint Hills Work Items Inbox.
(Refresh the contents of the Inbox if you cannot see the new work item.) Double-click to open it.
6. Press Submit.
The form for the Get the users cellphone number task, the first task in the Request Additional
Data Pageflow process, is displayed.
7. Enter a number and click Submit.
8. Repeat step 5 and step 7 for the Get the users email address task, and again for the Ask the user
for a security question task.

Verifying the Results


You can verify the results of your tutorial by installing the tutorial from the samples folder in the
product directory. Your project must look similar to the sample solution project.
Procedure
1. Find the PageFlowSolution.zip file in the location where you installed TIBCO Business Studio (for
example, <STUDIO_HOME > \studio\3. n\samples).
2. In TIBCO Business Studio, select File > Import .
The Import wizard is displayed.
3. Select General > Existing Studio Projects into Workspace , and click Next.
4. Click Select archive file, and click the Browse button.
5. Browse to PageflowSolution.zip and click Open.
The Pageflow Solution project is displayed in the Import wizard.
6. Click Finish.
The PageflowSolution project is installed in your workspace.

TIBCO Business Studio Tutorials

325

Debugging a Business Process


How to Debug a Business Process
This tutorial demonstrates how to debug a business process that has been designed in TIBCO Business
Studio and deployed to a server.
This tutorial describes the steps for debugging a simple business process. You can also debug a
pageflow process. This follows a very similar procedure to that described here, but you need to enter
different values at some points - see for example Configuring the Tester, step 3.
For an independent pageflow or business service, if it contains a user task, it cannot be stepped through
using the TIBCO Business Studio debugging tools alone. It requires a web service call (via pageflow/
business service APIs) to move over these tasks.
You should use the Process launcher and Emulation launcher in a single node setup. The Process
Launcher and Emulation launcher are not supported in the multi-node HA environment. These tools
are targeted for the process debugging purposes and not meant for the production environment. They
rely on monitoring the process creation notifications from the debugger and will not work when the
process instances can be created on anyone of the multiple nodes.
Although it uses a very simple process, this tutorial demonstrates some of the fundamental points of
the analysis phase for any business process:

Import the project.

Deploy the process to BPM.

Add breakpoints to check the process flow. To prepare a process for debugging, you need to set
breakpoints in a process so the tester suspends execution and allows you to debug. Otherwise, the
program runs to completion without letting you do any debugging.

Add testpoints to check the data flow. To check the flow of data in a process, you need to add
testpoints and/or assertions in the process and pass values through these variables.

Configure and launch the tester, which applies the breakpoints defined to the already deployed
process.

After you complete this tutorial, you should be familiar with:

how to add breakpoints to an activity

how to add testpoints and test data to an activity

how to configure and launch a process in the debug perspective

how to launch a tester

how to execute the process in the tester and check the output (with and without emulation data).

Before you Begin


Before you start this tutorial, you should have completed:

TIBCO Business Studio Tutorials > Create, Deploy, and Run Your First BPM Application > How to
Design a Simple WelcomeUsers Business Process

TIBCO Business Studio Tutorials > Create, Deploy, and Run Your First BPM Application > How to
Implement and Deploy the WelcomeUsers Application

TIBCO Business Studio Tutorials

326

Understanding the Process


After you design a process in TIBCO Business Studio, you can debug the process at runtime.
This tutorial provides you with a sample Get
runtime.

Balance

process that you need to deploy to the BPM

Procedure
1. Find the sample project in the location where you installed TIBCO Business Studio. For example:
STUDIO_HOME\studio\3.x\samples.
2. Start TIBCO Business Studio.
3. Select File > Import... from the Menu to open the Import dialog.
4. Expand General > Existing Studio Projects into Workspace, and click the Next button to open the
Import Projects page.
5. Select the Select Archive File radio button, and browse to your local copy of demo-invoke.zip.
Click the Open button.
The demo.invoke project appears in the Project list in the Import dialog.
6. Click the Finish button.
The demo.invoke project is imported into your workspace.
7. In Project Explorer, expand demo.invoke > Process Packages > GetBalance.xpdl > GetBalance
(GetBalance)Processes and double-click GetBalance-Process(GetBalanceProcess).
8. Familiarize yourself with the process.
9. Deploy the GetBalance process on BPMNode to your BPM runtime.
Deploying this project is similar to the deployment of the WelcomeUsers project described in the
Create, Deploy, and Run Your First BPM Application tutorial.

Preparing TIBCO Business Studio for Debugging


You must set Preferences in TIBCO Business Studio for debugging.
Procedure
1. In TIBCO Business Studio, select Window > Preferences .
2. In the Preferences dialog, select the TIBCO BPM Debug item from the Preferences tree on the left.
3. Check the Enable BPM debug mode checkbox in the right panel.

TIBCO Business Studio Tutorials

327

4. Click Apply. Then clickOK.


Result
Running a process in debug mode consumes substantial resources. Therefore, remember to disable
debug mode when you finish debugging.

Preparing the Process for Debugging


To prepare a process for debugging, you need to set breakpoints in a process so the tester suspends
execution and allows you to debugotherwise, the program runs to completion without letting you do
any debugging.
To check the flow of data in a process, you need to add testpoints and/or assertions in the process.

Adding Breakpoints
A breakpoint suspends the execution of the process instance when the execution reaches the location
where the breakpoint is added. You can add the breakpoints to activities such as events, tasks,
gateways, and sub-processes. However, you can add only one breakpoint type per activity.
Procedure
1. In the Modeling perspective, right-click the Catch Message Event (Start) activity in the Process
Editor, and select Breakpoints > Add after from the pop-up menu.

2. A red dot appears on the activity.

TIBCO Business Studio Tutorials

328

3. In the Modeling perspective, right-click the Script Task activity in the Process Editor, and select
Breakpoints > Add Both from the pop-up menu.

4. Two red dots appear on the activity:


Result

The activities that have breakpoints display with one or two red dots on them. The breakpoints are of
the following types:

Before The running process instance suspends on entry of that activity.

Both The running process instance first suspends on entry of the activity, and after resuming or
stepping, suspends again on exit of that activity.

After The running process instance suspends on exit of that activity.

You can open the Debug perspective from the toolbar. Select the Open Perspective icon and select
Other... > Debug and click OK.

Once in the Debug perspective, you can click the Breakpoints tab to see the list of breakpoints added in
the process.

TIBCO Business Studio Tutorials

329

Adding and Editing Emulation Files


By adding testpoints and/or assertions, you can prepare to emulate a process and add test data to
certain activities to check the data flow at various points in a process.
A BPM project has either one emulation folder or no emulation folder. Therefore, you can add an
emulation folder to a BPM project without one, or remove an emulation folder from a project that has
one.
An emulation file contains emulation data. You can add multiple processes into an emulation file or
add the same process into one file multiple times.
In an emulation file, a process presents an emulation case which contains five types of elements.
Element

Description

Input

Keeps the value of parameters that are used to start a process instance if the
corresponding StartEvent trigger type is set as none. Or keeps the SOAP request
message if the trigger type is set as message.

Output

Keeps the parameter values while a process instance terminates, or keeps the
SOAP response message. Note that you cant create outputs in the current
version. They are created from the debug result.

Testpoint

Can be considered a script task that replaces the corresponding task while
debugging.

Assertion

A declaration of whether a sequence flow is executable or not. An assertion


failure causes the suspension of a process instance.

Intermediate
Input

Keeps the SOAP request message of Catch Message Intermediate Event.

TIBCO Business Studio Tutorials

330

Procedure
1. The Emulations folder is available under the project folder.

From Project Explorer, right-click the Emulations folder, and select New > Emulation File.

The New Emulation File dialog appears as shown:

2. Click Next to accept the default values in the Emulation Folder field and File field.
3. Check the GetBalance.xpdl checkbox.

4. Click Finish.
TIBCO Business Studio Tutorials

331

5. In Project Explorer, expand Emulations > demo.invoke1.em .


6. Double-click the GetBalance-Process process.
The GetBalance-Process process opens the demo.invoke1.em file in the Testpoint Editor.

7. Right-click the Script Task activity, and select Testpoint > Add .
8. In the Edit Testpoint dialog, click Add. The Select Variables dialog appears.
9. Select the variables accNum,
to the Edit Testpoint dialog.

depositAmt,

and

newBal

using Ctrl + Click, then click OK to return

10. In the Edit Testpoint dialog, type the following variable values in the Value field:
Type

Value

acctNum

TIBCO

depositAmt

3000.0

newBal

5000.0

11. Click OK to close the Edit Testpoint dialog.

TIBCO Business Studio Tutorials

332

12. The Emulation data appears in the Properties view. The Script Task activity on which the
testpoint is defined appears in the Project Explorer under the Emulations folder.

Configuring the Tester


Before running the tester, it must be configured.
Prerequisites
To launch the application in debug perspective, make sure that:

TIBCO ActiveMatrix BPM is running.

TIBCO Host runtime is running and the application is successfully deployed.

Procedure
1. Click Run > Debug Configurations... from the TIBCO Business Studio toolbar.
Alternatively, you can click the
command.

button and select the Debug Configurations..

The Debug Configurations dialog is displayed.

TIBCO Business Studio Tutorials

333

2. Right-click the TIBCO Process Engine configuration type, and select New.

The following dialog to configure TIBCO Process Engine appears.

TIBCO Business Studio Tutorials

334

3. Enter the connection details required by the TIBCO Process Engine (as described below or supplied
by your administrator).

Name type BPMNode_configuration.

In the Available Engines field under Server Process Engine, use the Add button to select the
Process Engine you require. You can select multiple engines at the same time, so you can run
both BPM and Pageflow.

Type select the type of BPM or Pageflow depending on whether you are debugging a
business process or a pageflow. In this tutorial you should select BPM.

Host Nametype the IP address of the machine on which the application is deployed and
running. You can use the Browse button to locate it.

ProtocolSelect http as protocol. If you have installed BPM runtime with SSL, select https.
To use HTTPS protocol, Secure Socket Layer (SSL) must be configured for TIBCO
Business Studios JVM before launching TIBCO Business Studio.
To configure the SSL, download the trusted certificate file from the server runtime
and import it to the keystore using Javas keytool utility.
The trusted certificates are a collection of certificates from servers to whom you will
establish connections. If the server you wish to establish a connection presents a
certificate that does not match one of your trusted certificates, the connection is
refused.

PortType 8080, the port number specified when you deployed the process.

User NameType a user name - for example tibco-admin.

PasswordType the password, for example secret.

4. Click TestConnect to verify the engine connection parameters. The Connection Successful dialog is
displayed if the parameter values are valid.
5. Click Save.
6. Click Apply.
7. Click Debug.
Runtime Behavior
The tester connects to the TIBCO Process Engine and starts a new debug session.
The tester does not deploy the process on the engine. The application that contains the
process being debugged, and which is running, has already been deployed. See step 9 in
Understanding the Process .

Launching the Tester


The tester allows you to connect to the remote engine and debug the existing processes running on that
engine. Once the tester is launched, you are placed into the Debug view.
Procedure
1. After the tester is configured, if you are not already in the Debug perspective, click Debug.
TIBCO Business Studio Tutorials

335

2. Notice that in the Debug perspective, various panels display different aspects of the process being
debugged.

The Debug view displays an entry for the server connection.

Runtime Behavior
From the Debug perspective, you can view and control all the processes running on the engine.
The Debug view in the top left area displays:

BPMNode_configurationSpecifies name of the configuration to connect to TIBCO Process


Engine.

<launched > < host name > : 8080/bxEngine/node/ProcessDebuggerSpecifies the name of


the debug target and the TIBCO Process Engine that the BPMN tester connects to. Its label
format is:
<state>TIBCO Process Engine at <host>:<port number>
where <state> is either <launched> or <terminated>.
After you select a process, the details of the testpoints and breakpoints used in the process are
displayed in the top right area in the Testpoints and Breakpoints views. Variables can be seen
in the Variables view only when a process instance starts and hits a breakpoint.

Running a Process
You can start a process via the Process Launcher view.

TIBCO Business Studio Tutorials

336

Procedure
1. In the Debug perspective, click the Process Launcher tab to open the Process Launcher view.

The Processes panel to the left of the Process Launcher view lists the templates that have been
deployed on the currently selected server.
If the corresponding BPM process does not exist in your workspace, the process template will not
be displayed.
The following commands are available in the Process Launcher view:

Refresh - Refresh the process template list manually when some process templates are
deployed or undeployed. The process template list does not refresh automatically.

Close All - Close all the tab pages except for the main tab page.

Load Emulation File - Load the emulation elements from the emulation files.

Save Emulation Result - Save the inputs and outputs in the Process Launcher view and the
testpoints and assertions in the Testpoints view into an emulation file after a process instance
has been debugged.

2. Select the GetBalanceProcess process template.


A Catch Message Event is selected by default. You can also select a different Catch Message Event
from the combo box in the top right area of the Process Launcher view.
3. Type parameter values if the trigger type of the selected catch message event is set as none. Input
the SOAP request message if the trigger type is set as message. What you type here will be treated
as the input to the Catch Message Event that starts the process being tested. You must alter the
default values in the Catch Message Event SOAP request:

TIBCO Business Studio Tutorials

337

4. Click the
button. A tag page is created in the Process Launcher view. The SOAP request message
and response message are displayed if the connection protocol is HTTP or HTTPS, and if the Catch
Message Event trigger type is set as message after the process instance is completed.

5. Click the
button to view the input parameters in the left panel, and the output parameters in the
right panel.
The hypertext label displays the status of the process instance. For example, Completed.
6. Click the hypertext label, and a dialog opens displaying the details of the activities.

Debugging the Process with Test Data


To interact in Debug view, you can use the following toolbar. Which icons in the toolbar are enabled at
any time depends on the states of the debug models and the debug event notifications from the engine.

The process may be in one of the following states when debugging:

"Suspended" means the process is halted by a breakpoint. In this state, you can browse/modify the
variables in the Variables view

"Active" means the process is running, and the variables will not be listed in the Variables view.

"Completed" means the process runs successfully.

"Cancelled" means that you terminate the process instance before it finishes.

When debugging the process, you should press "Step Over" or "Step Into" if you want to change the
state to "suspended" . If you press "Resume" while debugging a process, the state of the process does
not change to "suspended" so you cannot see the variables in the debug window.

TIBCO Business Studio Tutorials

338

Procedure
1. Load the emulation elements from the emulation file.
a) From the top right area, select the Testpoints tab and click the
node from an emulation file.

button to select the process

b) The Select ProcessNodes dialog appears.

c)
d)
e)
f)

Select demo.invoke from the Projects drop-down list.


Select demo.invoke.em and GetBalance-Process.
Click the OK button.
Notice that the Testpoints view in the top right area displays the predefined testpoint in the
demo.invoke process as shown:

2. Select the Script Task activity.


3. From the bottom area, select Properties > Emulation .
4. Notice that the values passed as emulation data (that you defined earlier) are as follows:
Variable

Value

acctNum

TIBCO

depositAmt

3000

newBal

5000

TIBCO Business Studio Tutorials

339

5. Type the following values as input parameters to start GetBalanceProcess:


Variable

Value

acctNum

ABC

depositAmt

1000

6. Notice that the GetBalanceProcess process starts in the Debug view.


7. Notice that the process starts and stops at the first breakpoint after the Catch
activity.

Message Event

8. Click the Variables view in the top right area and notice the variable values at the first breakpoint
after the Catch Message Event activity:

9. Select the Script Task activity and select Properties > General to see the formula to calculate the
newBal value:
newBal = 1000.0 + depositAmt
Click the
The Script

button on the task bar to execute the next step in the process.
Task

activity starts as shown:

10. Click the Variables view to see the values.


The values of variables are still the same at the breakpoint set before the Script

Task

activity.

TIBCO Business Studio Tutorials

340

11. Select the Script Task activity and click the Properties tab, notice that Script
data with a testpoint that was added at Adding and Editing Emulation Files.

Click the
12. The Script

button to execute the Script


Task

Click the

Task

Task

has emulation

activity.

activity executes and displays the output data as shown:

button to complete the process with the Reply

to Catch Message Event

activity.

13. Notice that the value of the newBal variable remains at 5000, as specified in the emulation data.
14. Remove the testpoint and emulation data for the Script

Task

activity as follows:

a) Select Script Task, right-click and click Testpoint > Remove .


b) From soapUI, pass the following values as input parameters to start GetBalanceProcess:
Variable

Value

AcctNum

ABC

depositAmt

1000

c) Click the

button to complete the process up to the End

Event

activity.

TIBCO Business Studio Tutorials

341

15. Check the value of the newBal variable.


The value appears as shown:
Variable

Value

AcctNum

ABC

depositAmt

1000

newBal

2000

Runtime Behavior
The process stops execution at every breakpoint and allows you to edit values for variables from the
Variables view.

Performing Batch Testing


If you want to run multiple processes without debugging, you can perform batch testing. The
Emulation Launcher view is the process batch testing UI.
The emulation file needs an input in order for batch testing to be executed. See Adding and Editing
Emulation Files .
Procedure
1. In the Debug perspective, click the Emulation Launcher tab to open the Emulator Launcher view.

The left panel displays all the emulation files in your workspace. The right panel displays the
process execution status.
The following commands are available in the Emulation Launcher view:

Select All Processes - Select all the process cases in your workspace.

Deselect All Processes - Deselect all the process cases in your workspace.

Refresh - Refresh the emulation file list manually when an emulation file is added, deleted, or
changed. The emulation file list does not refresh automatically.

Close All - Close all the tab pages except for the main tab page.

Save Emulation Result - Save the inputs and outputs in the Process Launcher view and the
testpoints and assertions in the Testpoints view into an emulation file after an emulation case
has been debugged.

2. Select a process case from the left panel.


You can select a process case only when the connection to the server is active.

TIBCO Business Studio Tutorials

342

3. Click the
button to execute the process cases one by one.
The process execution status is displayed in the right panel.

The result label is in red if the process instance fails or is cancelled.


4. Click the process name label, and a tab page in Emulation Launcher view is created, which displays
the inputs and outputs.

TIBCO Business Studio Tutorials

Potrebbero piacerti anche