
Activity Example - File
Example Description
The file poller waits for the new_orders_file to be updated. As soon as an update is detected, TIBCO ActiveMatrix BusinessWorks starts a process that creates an empty approval file and then uses the ship_to_address to calculate the shipping costs (by calling a sub-process).
The process then waits for the empty approval file to be updated. Finally, a file is written (customer_notification) that gives the customer the relevant shipping information.
It is important to note that in an actual system, other tasks (for example, DB query, email acknowledgement etc.) should be used to implement this scenario. However, we have chosen files to highlight the use of the activities in the File Palette.
Setup
Use TIBCO Designer to create a new project and then import File.zip by selecting Project->Import Full Project.
(Optional) Modify the default filenames (if required).
By default, the filenames are defined as global variables. If you want to change these defaults, you should:
Click Edit -> Global Variables to display the list of currently configured global variables.
Modify BW_new_order_file to point to the XML file that contains the new order details and triggers the process. The default value is c:\temp\BW_new_order.xml.
Modify BW_shipping_costs. This file should contain the shipping costs information. The default value is c:\temp\BW_shipping_costs.xml.
Modify BW_customer_notification. This file will be created by TIBCO ActiveMatrix BusinessWorks to notify the customer of the complete shipping details. The default is c:\temp\BW_customer_notification.txt.
Modify BW_approval_file. This file will be created by TIBCO ActiveMatrix BusinessWorks and the user should enter the approval status. The default is c:\temp\BW_approval_file.txt.
Running the example
Verify whether the default file names are correct for your system (Refer to the setup section).
Open the imported zip file in TIBCO Designer and click on the Process Order in the Project tree panel (top left) to open Process Definition.
(Optional) You may want to turn on the Moving Ball option which is available in the view->Test->Moving Ball menu from the TIBCO Designer.
Click on the Start Test Mode icon to run the process in test mode
Copy the xml files shipped with this example to the directories listed in the Global Variables. This will trigger the example.
You will see that the data travels to the Wait for Approval File Change task and then will stop. Edit the empty file listed in the Global Variable BW_approval_file and type either
approved
or
delayed
Save the file. This should trigger the process to continue.
Expected Results
The final result is a BW Approval File that contains information similar to the following:
Approved:
Hank Hill,
Your order has been approved
The cost is as follows,
Purchase cost : $123
Shipping costs : $40
Total Cost : $163
Delayed:
Hank Hill,
Your order has been delayed due to problems
We will contact you at your Arlen address with further details.
Regards,
TIBCO Software Inc.
Troubleshooting
The process is not being triggered
Verify that the Global Variable BW_new_order_file, is referring to a valid xml file.
If you have already run the example, then you will need to update the new order xml file as the process will not be triggered again until the file is modified.
Activity example - JDBC
Example Description
This example illustrates the use of JDBC palette activities via JDBC Query & JDBC Update. It also shows how to set up shared JDBC connections and how to use them in process definitions.
Two JDBC connections are created (JDBC_ORACLE & JDBC_SQLSERVER) for demonstration purpose. Please go to the "Shared Resources" folder and see how these are configured. However, this example is only setup to work with Oracle database.
The "JDBC_TEST" process uses one of this shared resource "JDBC_ORACLE". First it queries the table for a specific record using the "JDBC_Query" activity and then updates another table using the "JDBC_Update" activity. Finally it writes a file indicating the number of records written.
Setup
Run the JDBC.sql file from the examples directory on the oracle server using a specific user_id.
Running the example
To run the example, follow these steps:
In TIBCO Designer, create a new project and import the project zip file “JDBCTest.zip” by selecting the Project->Import Full Project menu selection.
Once the project is imported, save the project.
Click on "JDBC_ORACLE" shared resource and change the username/password/URL to connect to your Oracle server.
Save the project and click on "Test connection" to make sure everything is ok.
Update order_id in the Global Variables section to 142.
Click the Tester tab, then click the Start Testing Viewed Process icon in the tester window.
Click Start Selected in the Select Processes to Load dialog.
The activities and transition lines are higlighted in green as incoming information is processed.
Verify the result in c:/temp/out.txt
Expected Results
You should see all the transitions turn green.
order_description in the sub_order table got updated to 'TESTING JDBC CONNECTION'.
The output file, c:/temp/out.txt by default, should show that one record was written.
Activity example – JDBC Transaction Group
Example Description
This example illustrates the use of the TIBCO ActiveMatrix BusinessWorks Transaction Group resource to provide JDBC transaction support for database operations. The JDBC Transaction type provides transaction support only for the JDBC activities, and it does not provide transaction support for JMS or Checkpoint resources. The JDBC Transaction group allows you to perform multiple database operations within the group as a single unit of work. All database operations performed within the transaction group are either committed or rolled back.
This example performs two database operations within the JDBC Transaction group. The transaction is started at invocation of the first JDBC activity in the group and terminated at the end of the group. If the end of group is reached without any error, the transaction is committed and both the database operations are completed. However, if the end of the group is reached from an error or an exception, the transaction is aborted and both database operations are rolled back.
TIBCO ActiveMatrix BusinessWorks provides JDBC transactions by using the database’s native transaction support. When using a JDBC Transaction group, the operations performed by multiple JDBC activities are part of a same transaction only when all the JDBC activities in the group use the same JDBC Connection resource. In this example there are two JDBC activities (JDBC Update-1 and JDBC Update-2) that are contained in a JDBC transaction group and each of these activities perform an insert operation on different database tables. However, both the JDBC activities in the group use the same JDBC Connection resource.
To participate in a JDBC Transaction group, the JDBC Connection resource used by JDBC activities in the group must be configured as type “JDBC” (Connection Type = JDBC). .
Requirements
External components required for executing this example:
Oracle database or another database supported by TIBCO ActiveMatrix BusinessWorks.
Setup
Configuration of external components for executing this example:
Create two database tables called “bwTxTest” and “bwTxTest2” using the SQL commands “create table bwTxTest (userData varchar(60)) and table bwTxTest2 (userData varchar(60))”. You can also run the createTxTestTables.sql file that is provided in the examples directory to create the required tables on the Oracle server. The database table “bwTxTest” is used by the JDBC Update-1 activity and database table “bwTxTest2” is used by the JDBC Update-2 activity in this example.
Description of Process Definitions
There is a single process definition in the supplied project: JDBCUpdate.
The process JDBCUpdate performs two database insert operations within a transaction context provided by the group resource and executes as follows:
The first activity in this process is a Timer activity configured to run this process once.
The Generate Test Data activity is a JavaCode activity that outputs a string used by the JDBC activities to update the database tables.
The JDBC Update-1 activity starts a transaction and performs an insert operation on the table “bwTxTest”.
The JDBC Update-2 activity performs an insert operation on the table “bwTxTest2”. Because the JDBC Update-2 activity uses the same JDBC Connection resource as the JDBC Update-1 activity, it automatically participates in the transaction started in JDBC Update-1 activity.
The Assign resource “abortTx” sets the shared variable “AbortTx” based on the value of the global variable “AbortXATransaction”. By default, the global variable “AbortXATransaction” is configured to contain a value of “false”. The value of the global variable “AbortXATransaciton” should be set to true, if you want to abort the transaction instead committing the transaction.
The value of the shared variable “AbortTx” determines the outcome of the transaction. If the value of the shared variable “AbortTx” is “false”, the process transitions to the end of group and the transaction is committed. Otherwise, the process transitions to the GenerateError activity causing the group to abort the transaction.
When the transaction is committed, both the JDBC Update-1 and JDBC Update-2 operation are successful. If the transaction is not committed, neither operation is performed.
Running the example
To run the example, follow these steps:
Configure the external components required for executing this example as specified in the “Setup” section of this document.
In TIBCO Designer, create a new project and import the project zip file “transaction_jdbc.zip” by selecting the Project->Import Full Project menu selection.
Once the project is imported, save the project.
Click on the JDBC Connection resource “JDBC-Connection” of the JDBCTransaction folder and modify the value for the fields: JDBC Driver, Database URL, User Name and Password. The values for these fields must reflect your database environment.
Save the project.
Click on the process JDBCUpdate of the JDBCTransaction folder in the project panel.
Click the Tester tab, then click the Start Testing Viewed Process icon in the tester window.
Click “Load & Start Current” in the Select Processes to Load dialog.
The activities and transition lines are highlighted in green as incoming information is processed.
Using SQL commands, verify that both tables have been updated correctly.
Expected Results
On successful commit of the transaction, the JDBC Update-1 activity should insert a new row containing “JDBC Transaction Test Data: Y-M-D, H:M:S” into the database table “bwTxTest” and JDBC Update-2 activity should insert a new row containing “JDBC Transaction Test Data: Y-M-D, H:M:S” into the database table “bwTxTest2”.
Activity example – SOAP over HTTP Example
Example Description
This example illustrates both the creation and invocation of a SOAP over HTTP web service using TIBCO BusinessWorks.
The web service created in this example queries all the books in a bookstore by their Author. The web service has one operation, which is implemented in a Process Definition. A client for this web service is configured using the service’s WSDL file. At run-time, the client sends a SOAP request that contains a name of an Author and receives a list of books.
Description of the project
The following shared resources are defined in the project:
- Books.xsd – The XSD Schema file that contains the definition of the types used by the web service’s interface
- BooksInterface.wsdl – The WSDL file that represents the interface of the web service
- BookStore.xml – An XML document that represents the bookstore database
- BooksService.wsdl – The WSDL file that describes the web service
- HTTPConnection.sharedHttp – The HTTP Connection Shared Resource that contains the transport configuration
- QueryBooksByAuthor.process – The process definition that represents the web service. The first activity in this process definition is the SOAP Event Source, which stores the Web Service’s configuration. The event source’s output schema contains the Author parameter that is used for querying the bookstore. This parameter is mapped to the input of a Call Process activity, which calls another process definition (see bellow) that defines the query. The Call Process activity returns a list of books that is mapped to the input of the SOAP Send Reply activity.
- Query.process – The process definition that represents the business logic of the service. This contains a Read File activity that reads the bookstore (XML document) and an XML Parse activity that parses the XML document. Finally, the filter is executed at the end of the process flow in the End activity (see the End activity’s Input tab).
- WSClient.process – The client of the web service. This process definition contains a Timer activity, that is used for triggering the client and a SOAP Request Reply activity that is the actual client of the web service.
Setup
All the resources needed to run this example are part of the project. There is just one global variable that must be set:
ReadBookStoreXML – This is the full name of the XML file that contains the bookstore database (BookStore.xml).
Running the example
To run the example, follow these steps:
Set the global variable that is used in this project, as specified in the “Setup” section.
In TIBCO Designer, create a new project and import the project zip file “soap_over_http.zip” by selecting the Project->Import Full Project menu selection.
Once the project is imported, save the project.
Click the Tester tab, and then click the Start Testing Viewed Process icon in the tester window.
Select the following Process Definitions: QueryBooksByAuthor and WSClient.
Click on Load Selected button.
The activities and transition lines are highlighted in green as incoming information is processed.
Click on the SOAP Request Reply activity and then select the “Output Data” tab. Verify that the query was executed properly.
Expected Results
The SOAP Request Reply Activity should execute successfully. The query should return one book with the following title: “The Power of Now”.
Activity example – JMS Receiver
Example Description
This example illustrates the usage of a JMS Queue Receiver within TIBCO ActiveMatrix BusinessWorks.
JMS Queue Receiver - this is a starter activity that receives Queue messages.
This example has been tested with the following JMS Servers:
TIBCO Enterprise Message Service
Setup
Unzip the contents of the zip file queueReceiver.zip to a directory.
Start the TIBCO Enterprise Message Service.
Description of Process Definitions
The process QueueReceiver illustrates receiving a Queue message and responding to the incoming message. This process definition executes as follows:
The JMS Queue Receiver activity listens on the destination queue.sample and creates a job when it receives a message.
Running the Example
To run the example, perform the following:
In TIBCO Designer, open the project queueReceiver.
Click on the process definition QueueReceiver in the project panel.
Click the Tester tab, then click the Start Testing Viewed Process icon (F9) in the tester window.
Select QueueReceiver and Click Start Selected in the Select Processes to Load dialog.
Trigger the process QueueReceiver by sending a request.
The activities and transition lines are highlighted in green as incoming information is processed.
Expected Results
Click-> Window -> Show Console.
The following information is displayed in the console:
2025 May 05 21:43:19:267 GMT -0500 BW.queueReceiver User [BW-User] - Job-5001 [QueueReceiver.process/Log]: Received a Queue Message. Request = test message 2.
This project illustrates the usage of a JMS Queue Receiver and JDBC Database Insert within TIBCO ActiveMatrix BusinessWorks v5.
Activity Example – On Notification Timeout
Example Description
This example illustrates the use of the TIBCO ActiveMatrix BusinessWorks On Notification Timeout activity. The On Notification Timeout activity provides a mechanism to handle timeouts resulting from notifiy activity. The On Notification Timeout activity is called when the process that has notify activity has timed out due to associated wait activity not getting triggered during the timeout interval.
The example contains a simple repository with a notify activity process , wait activity process and On Notification Timeout process.
Running the example
To run the simple on notification timeout example, follow these steps:
In TIBCO Designer, create a new project and import the project OnNotificationTimeout.zip by selecting the Project->Import Full Project menu selection.
Click the Start Test Mode icon.
Load both the Notify and On Notification Timeout processes.
A Notify process will start automatically.
The On Notification Timeout process will get triggered after the timeout has elapsed.
MOP Service - SOAP HTTP endpoint
Example Description
This example implements a service using the service resource for determining information about zip codes. This includes getting information for the city at the given zip code, and for getting the distance between two cites (defined by their zip codes).
Setup
Unzip SOAP_HTTP.zip to c:\temp\SOAP_HTTP.
Open the project in TIBCO Designer by using the Project->Open menu. Specify c:\temp\SOAP_HTTP in the Project Directory field.
Running the example
To run the example, select the TestService/getCityDistanceTest and TestService/getCityInfoTest as well as the service named ZipInfo-service1.
Description Process Definitions
The service ZipInfo-service1 provides a means for getting city information about a zip code.
The getCityDistanceTest and getCityInfoTest are the two test processes which can be used to see the service in action.
This example uses HTTP as its transport. It represents a simple HTTP based service using SOAP 1.1. It has one endpoint ZipPortEndpoint1.
Expected Results
For the getCityInfoTest, you should see information corresponding to the zip code that is defined in the zip field. Its default value is "61801", which should return information about Urbana IL.
For the getCityDistanceTest, you should see information corresponding to the distance between two zip codes. The default values are "61801" for Urbana IL and "61820" for Champaign IL.
Troubleshooting
Data does not appear for getCityInfo or getCityDistance:
Verify that the BW engine is running.
Verify that the service is running.
JDBC Process in Subsets and Batch Updates Example
Example Description
This example illustrates the usage of JDBC Query - Process in Subsets and JDBC Update - Batch Updates. JDBC Query activity allows users to process the result set in smaller subsets rather than processing the entire result set at once. JDBC Update activity can be configured to perform multiple statements in one batch.
The "processInSubsets" process is configured to process query in subsets.
The "batchUpdates" process is configured to perform multiple insert statements in one batch.
Setup
Run the createTestTables.sql on the Oracle database to create test tables using a specific user id.
Description of Process Definitions
There are two example process definitions in the supplied project: processInSubsets and batchUpdates
The example processInSubsets executes as follow:
querySrcOrderTab is a JDBC Query activity configured to retrieve subsets of the result set of SRC_ORDER_TABLE table.
Check the "Process In Subsets" field on the Advanced tab.
Set the "subsetSize" input item to the number of records you whish to process for each execution. In this example, it is set to a global variable named SUBSET_SIZE.
ProcessSubset Iterate loop group processes each subset to write its records to an output file, a global variable named PROCESS_IN_SUBSETS_OUTPUT_FILE.
To retrieve subsets of the result set, you must use a Repeat Until True loop group to iterate until the entire result set is processed. For this, both querySrcOrderTab and ProcessSubset are grouped into ProcessInSubsets Repeat Until True loop group with the exit condition: $querySrcOrderTab/resultSet/lastSubset = "true".
The example batchUpdates executes as follow:
querySrcOrderTab is a JDBC Query activity to retrieve the entire result set of SRC_ORDER_TABLE table at once.
batchUpdates is a JDBC Update activity configured to perform multiple insertions in one batch. It inserts all the records of SRC_ORDER_TABLE table to DEST_ORDER_TABLE table.
Check the "Batch Update" field on the Advanced tab.
Map $querySrcOrderTab/resultSet/Record to the "Record" input repeating element. Set the "ORDER_DATE" input item to "current-dateTime()".
Write $batchUpdates/jdbcUpdateActivityOutput/noOfUpdates to an output file, a global variable named BATCH_UPDATES_OUTPUT_FILE.
queryDestOrderTab retrieves the entire result set of DEST_ORDER_TABLE table at once.
ProcessResultSet Iterate loop group processes the result set to write its records to the same output file, a global variable named BATCH_UPDATES_OUTPUT_FILE.
Running the example
To run the example, follow these steps:
Import the full project
In TIBCO Designer, create a new project and select the Project->Import Full Project menu selection.
Click "ZIP Archive" tab in the "Import Project" dialog. Browse and import the project “JDBCDemo.zip”.
Once the project is imported, save the project.
Click on "TIBCO_Oracle" JDBC shared resource and change the Database URL/User Name/ Password to connect to your Oracle database. Click on "Test Connection" to make sure everything is ok. Save the project.
JDBC Query - Process in Subsets
In TIBCO Designer, click the "Project" tab and click "processInSubsets" to load the process definition.
Click the "Tester" tab, then click the "Start testing viewed process" icon to bring up "Select Processes to Load" dialog.
In this dialog, click "Load & Start Current" to start "processInSubsets" process.
The activities and transition lines are highlighted in green as the process is executed.
Verify the result in C:/processInSubsets.txt.
JDBC Update - Batch Updates
In TIBCO Designer, click the "Project" tab and click "batchUpdates" to load the process definition.
Click the "Tester" tab, then click the "Start testing viewed process" icon to bring up "Select Processes to Load" dialog.
In this dialog, click "Load & Start Current" to start "batchUpdates" process.
The activities and transition lines are highlighted in green as the process is executed.
Verify the result in C:/batchUpdates.txt.
Expected Results
JDBC Query - Process in Subsets
You should see all the transitions turn green.
The output file, C:/processInSubsets.txt by default, should show all the records retrieved from SRC_ORDER_TABLE table.
JDBC Update - Batch Updates
You should see all the transitions turn green.
The output file, C:/batchUpdates.txt by default, should show the "Number of Updates" and all the records retrieved from DEST_ORDER_TABLE table.
This example illustrates how the HTTP Request and HTTP Response activities can be used. It proceeds as follows:
The Incoming HTTP Request process starter listens on the connection specified by the Listening HTTP Connection shared resource. Listening HTTP Connection is defined to listen on port 8089.
Converts given USD Amount to INR.
TIBCO Business Works is a no-code to low-code enterprise application integration product offering from TIBCO Software Inc. Learn TIBCO BusinessWorks v5 beginner to advanced with zero coding experience. Enterprise application integration (EAI) using TIBCO Business Works v5 refers to the process of integrating different enterprise applications within an organization using TIBCO's Business Works software. This software is a middleware platform that enables the integration of various applications, systems, and data sources into a unified whole. Maintain highly reliable, scalable, and secure integrations that are critical to your business with the TIBCO BusinessWorks™ component. Implement enterprise-wide integration strategies using both traditional enterprise patterns and modern approaches built with microservices.
A zero-coding model-driven environment simplifies development complexity, helping reduce costs and speed up your time to market. Mission critical connectivity TIBCO BusinessWorks supports a broad range of modern and traditional integration capabilities including: Application integration, Support for all application integration styles, including:
APIs: RESTful, HTTP, and SOAP
Event-driven integration flows
Messaging
File-based integration
Legacy integration styles including large XML and mainframe
Visual orchestration of APIs and microservices Data integration
Data migration, replication, and synchronization
Complex data transformation
Simplified field mapping with AI-driven smart mapper
Out-of-the-box capabilities for log-based change data capture, batch processing, and paging