Using a Custom Process Starter in a Project That Gets Information about a Checking Account
Java Event Source allows you to create a custom process starter written in Java.
Before you begin
Copy the AccountInformation.txt file from TIBCO_HOME\bw\n.n\samples\palette\java\JavaEventSource to c:\tmp directory on Windows and /tmp on UNIX.
- Procedure
- In the samples directory, select and double-click tibco.bw.sample.palette.java.JavaEventSource. For more information, see Accessing Samples.
- In Project Explorer expand the tibco.bw.sample.palette.java.JavaEventSource project.
- Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
- Fully expand the Processes directory and double-click PublishAllBalances.bwp.
- Click .
- At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
- Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the checkbox next to tibco.bw.sample.palette.java.JavaEventSource.application.
- Click
Debug.
This runs the sample in Debug mode.
- Click the
Terminate
icon to stop the process.
ResultThe process writes the customer last name, account ID, and checking balance to the
PublishEvnSourceBalance.log file at
c:\tmp\JavaEventSource.
Understanding the Configuration
This sample uses the Java objects such as, LocalBank, Account, Balance, and SystemProperties. The source for these objects is in the src directory.
The process runs as follows:
- The Java Event Source activity reads balances from the AccountInformation.txt and outputs an instance of the java.util.LinkedList class that contains a collection of all balances.
- The CollectionToArray activity invokes the java.util.LinkedListtoArray method to convert the collection to an array of objects.
- The group then iterates over each object in the array.
- The Balance activity takes the current object in the array and converts its data to an XML document.
- The PublishBalance activity publishes the data from the output of the Balance activity.
Troubleshooting
- If the Output tab of Java To XML activity is not populated, then press the Reload button next to the Class Name in Java To XML activity.
- If any problem markers are visible in the project, close and re-open the project or import the project in a clean new workspace.