Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 2 Getting Started : Working with Studio

Working with Studio
The Studio provides a design time environment for adding custom extensions to a project. It is an Eclipse-based user interface, which is used to build, maintain, configure, and modify deployments for the project. It is integrated into the standard Eclipse menus wherever appropriate, and works with many established Eclipse UI methodologies and plug-ins.
Starting Studio
Run the Studio as follows:
1.
Navigate to the ASG_HOME/studio/eclipse directory.
2.
On the Windows platform, double-click the studio.exe executable.
You can also type the following command on a command prompt window:
   cd ASG_HOME\studio\eclipse
   studio.exe
You can start the Studio by following the Windows menu Start > All Programs > TIBCO > TIBCO ENV > TIBCO API Exchange 2.1 > Studio
On the LINUX platform, type the following command on a command prompt window:
   cd ASG_HOME/studio/eclipse
   studio
 
3.
A Welcome screen displays when you run the Studio first time. Click the X next to Welcome to close the welcome screen.
4.
Loading the Default ASG_DefaultImplementation Project
1.
2.
Select File > Import > TIBCO BusinessEvents > Existing TIBCO BusinessEvents Studio Project.
3.
Click Next.
4.
On Existing TIBCO BusinessEvents Project Import Wizard, select the values for the following fields:
a.
Click Browse
Select ASG_HOME\projects\ASG_DefaultImplementation project.
b.
Select the Copy project into workspace check box.
5.
Click Finish.
6.
In the Studio Explorer, on the upper left, select the ASG_DefaultImplementation project and expand ASG_DefaultImplementation > DefaultImplementation node to view the channels, rule functions, rules and, other resources in the project.
Editing, Validating, and Building the Default ASG_DefaultImplementation Project
After you import the ASG_DefaultImplementation project in the Studio, you can edit the default project to add the custom rule functions, rules, or any extensions as required to customize the default transaction processing pipeline.
To Add or Edit a Resource in a Project
You can add or edit a resource in the project as follows:
1.
2.
a.
Select the RuleFunction node, right-click and select New > Rule Function.
b.
c.
d.
3.
a.
b.
c.
4.
To save changes in just the currently viewed resource, click File > Save or click Ctrl+S, or click the Save button.
To Validate a Project, Project Folder, or Project Resource
In Studio Explorer, do one of the following:
A pop-up window displays the message, "Validation was successful" or summary information about any problems. Details about problems are displayed in the Problems view.
To Fix Validation Errors
Many validation issues can be fixed using the Quick Fix feature. In the Problems view, right-click on a problem and select Quick Fix.
To Build the Default ASG_DefaultImplementation Project
To build the EAR file of the project for testing before deployment, follow these steps:
1.
In the Studio Explorer, highlight the ASG_DefaultImplementation project. From the top menu, select Project > Build Enterprise Archive.
If you see a message prompting you to save all project resources, click Yes. This means that an unsaved resource editor is open.
2.
3.
Click Apply to save the configuration details. To revert to the version already saved, click Revert.
Click OK to build the archive.
Debugging Project in Studio
You can choose to keep the generated Java files, for example, to troubleshoot some problem with an EAR file. To do so, clear the Delete Temporary Files check box, and specify where to store the Java files in the Compilation Directory field.
If you clear the Delete Temporary Files check box, specify the directory where you want to save the Java files generated during the process of building the EAR file.
This section explains how to debug the ASG_DefaultImplementation project within the Studio.
You can set the breakpoints, stepping through the code, suspending launched programs, examining the contents of variables, providing rule input, and so on, using the Studio debugger.
The Studio debugger integrates with the Eclipse Java development toolkit debugger. You can debug local projects using their CDD and EAR files.
To debug the ASG_DefaultImplementation project in Studio, follow these steps:
1.
Copy TIBCO_HOME/be/5.1/bin/be-engine.tra to TIBCO_HOME/be/5.1/bin/be-engine.tra.bak
2.
Copy TIBCO_HOME/asg/2.1/bin/asg-engine.tra to TIBCO_HOME/be/5.1/bin/be-engine.tra
3.
Open the ASG_CONFIG_HOME/asg/asg.properties file and copy the entire contents.
4.
Open the TIBCO_HOME/be/5.1/bin/be-engine.tra file, go to the end of the file and append the contents of ASG_CONFIG_HOME/asg/asg.properties file.
5.
In the TIBCO_HOME/be/5.1/bin/be-engine.tra file, uncomment and set the following property to the project configuration folder.
tibco.clientVar.ASG/ConfigRoot=C:/ProgramData/TIBCOASG/tibco/cfgmgmt/asg/default
For example, if you want to debug a BookQuery project configuration, set the property as follows:
tibco.clientVar.ASG/ConfigRoot=C:/ProgramData/TIBCOASG/tibco/cfgmgmt/asg/BookQuery
You must change the value of the tibco.clientVar.ASG/ConfigRoot property to the configuration of the project you are working on.
6.
Save your changes for the TIBCO_HOME/be/5.1/bin/be-engine.tra file.
7.
8.
Import the ASG_HOME/projects/ASG_DefaultImplementation project in the Studio. See Loading the Default ASG_DefaultImplementation Project.
9.
In Studio Explorer, select the ASG_DefaultImplementation project. From the menu, select Run > Debug Configurations.
10.
For local debugging, On the Debug Configurations dialog, select and double-click the TIBCO BusinessEvents Application node on the left. Ensure that the ASG_DefaultImplementation project is selected.
Select the Main tab and configure values as explained in Debug Configuration Parameters Reference.
Select the Environment tab and configure the environment variables as needed, to run or debug the project in Studio.
For example, edit the following variable to set the value as:
PATH: PATH:TIBCO_HOME/tibrv/8.3/bin
where PATH is the existing value of the PATH variable.
You can add new variables using the Environment tab. You can select and then edit the existing variables. You can append your edited variable to the existing environment variable, or replace the existing environment variable with the specified variable. For example, if a custom function depends on a native library, you can add the path to that library using the PATH, LD_LIBRARY_PATH, SHLIB_PATH, or LIBPATH variable, as appropriate for your operating system.
Select the Classpath tab and configure the classpath for external libraries or custom functions, as needed.
For example, if the project uses Rendezvous or JMS channels, then you can add the Rendezvous or JMS libraries to the classpath.
Browse to select the ASG_DefaultImplementation project. This appears by default as this project is currently selected in the Studio.
Browse to select the CDD file as ASG_HOME\bin\asg_core.cdd to be used for this debug configuration.
Set this value as: TIBCO_HOME\asg\2.1\bin\asg_core.ear
11.
On the Main tab, click the Apply button to save the debug configuration changes.
12.
Click the Debug button to launch the debugger. Verify that the debugger is launched.
Set the Debug Perspective within Studio
You can set the debug perspective within the Studio as follows:
1.
Switch to the Debug perspective. Select Window > Open Perspective, or click the Open Perspective () button. Then select Other > Debug.
2.
Select Debug Configurations. From the Debug Configurations dialog, select a debug configuration and click Debug.
3.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved