As the IDE of choice for many enterprises today, and in keeping with its mantra as a comprehensive, highly integrated & collaborative Java EE, Web & Mobile IDE optimized for WebSphere, IBM Rational Application Developer (RAD) continues to evolve and adapt to enable enterprises to compete & win in an era that weighs heavily on speed, quality & agility of software delivery through different form factors.

Java EE 7

In this first installment of our beta release, RAD V9.5 Beta integrates and extends Eclipse Luna and correspondingly implements and encapsulates a rich set of WebSphere tools in supporting a wide variety of programming models for the Java EE 7 specification targeting WebSphere Application Server Liberty Profile (February Beta). This includes, but not limited to, the following technologies …

Enterprise Java Beans(EJB) 3.2 Lite

Java Servlet 3.1

Java Persistence API 2.1 (JPA)

Java API for WebSocket

JavaServer Faces 2.2 [1][2]

Context and Dependency Injection (CDI) 1.2

Bean Validation tools

Liberty Profile

Highly optimized for WebSphere, RAD is committed to bring speed and agility to development & test by leveraging the superiority of the highly composable and lightweight Liberty Profile for not only Java EE & Web but Portal development as well. Starting with this beta release, users can now implement & deploy JSR 168 and 286 portlets directly from RAD to Liberty Profile. [3]

And in taking a significant step forward in becoming the de facto runtime of choice for development, test and production, Liberty Profile is now fully enabled and supported as a remote application server. In this beta release, users can now develop, deploy, test, debug and profile using RAD against a Liberty Profile server running on a remote system or on the Cloud. [4]

IBM Bluemix

Expanding on the initial set of Bluemix tools that was first introduced in RAD V9.1.1, this beta release continues to bring an exceptional out-of-the-box experience by integrating the latest set of Eclipse-based tools in support of IBM Bluemix along with its Cloud Foundry dependencies. As IBM’s PaaS provider, Bluemix offers a wide range of highly composable cloud-based services for application development on & for the Cloud. RAD V9.5 Beta significantly enhances developer’s experience by enabling support for incremental publishing of applications (vs what used to require a full re-deploy) as well as the ability to debug applications deployed on IBM Bluemix. [5]

Hybrid Mobile with Cordova

In continuing with our commitment to offer and extend our support for Apache Cordova and its growing community at large, RAD V9.5 Beta now supports Cordova V4.0.0 and continues to focus on improving user experience by not only adapting to Cordova architecturally but in also preserving its characteristics & structure that are most familiar with Cordova developers. Beyond the project wizards, code assistance, validation and ease of testing on devices and/or emulator directly from the Eclipse workbench, RAD enables the increasingly popular option of doing development through Cordova’s Command Line Interface (CLI) that is conveniently accessible through the workbench. In this beta release, developers now have the option of working with Cordova plugins located on local file system or in a Git repository in addition to Cordova’s publicly accessible Plugin Registry that is integrated with the Cordova plugin management console in RAD. [6][7]

DevOps & Code quality

As the premium IDE for the enterprise, RAD offers an extensive & highly integrated suite of code quality tools & capabilities that enables organizations to deliver high quality applications as part of a DevOps continuous delivery lifecycle. This includes a Java Code Coverage tool that supports both static & dynamic code instrumentation; a static code analysis tool with over 500 Java code review rules & complexity metrics; and a Java profiler that enables easy and quick identification of performance bottlenecks through memory, thread and execution flow analysis during development and test.

By enabling improved initial code quality outcomes; RAD also enables improved speed and Leanness downstream in the Test and Deploy phases of the DevOps lifecycle. Integrated & optimized for WebSphere runtimes, Apache Cordova & IBM Bluemix, RAD is ready out-of-the-box to tap into the value that Cloud can bring in pursuit of improved DevOps outcomes. Using RAD together with Rational Team Concert (RTC)/ Rational CLM brings further benefits of team efficiency and speed, and enhances the transparency of DevOps processes to enable their more effective governance.

In this beta release, RAD continues to push the envelope on governance by uniquely offering a software analyzer team advisor for Rational Team Concert that allows project administrators to set preconditions governing source code delivery. As with our popular code coverage capability that prohibits code drop to RTC in the event of an unsatisfactory code coverage analysis; RAD V9.5 Beta now enables the option of applying the same rigor and integration with RTC to proactively detect undesirable anti-patterns and/or non-compliant coding standards, and in preventing code delivery from taking place if the quality requirements were not met. [8]

Also included in this beta release is an experimental technology known as test optimization advisor (TOA) for optimizing test coverage and utilization in support of DevOps practices. The TOA beta currently supports the following features:

Provides the ability to associate a code coverage result with a test

Provides the ability to generate code coverage information at the JUnit level

Analyzes single and multiple code coverage results from manual and automated tests to provide insight to developers and testers:

On which code needs additional testing

On possible redundancies in the set of tests analyzed

Using a test baseline, provides a list of tests that need to be rerun when code in a file is changed, eliminating the need to run every test, allowing for improved continuous integration

To download, or to find out more about Rational Application Developer V9.5 Beta, visit our Early Program site

Rational Application Developer v9.5 Beta bundles the latest version of the IBM Eclipse Tools for Bluemix which includes 4 new features and bug fixes.

Incremental publish of applications

Remote debug applications

Run on Server for JavaScript files

Remove unused routes

With the new support for incremental publish and remote debug of applications, we now only need to publish the delta code changes instead of redeploying the entire application, significantly reducing the deployment time and making application development targeting Bluemix easier than ever.

To try the new features first we need to create an IBM Bluemix server:

Open Rational Application Developer v9.5 Beta.

Right click the Servers view > New > Server > IBM Bluemix.

Enter your IBM ID user/password and click Next.

Select the Organization and Space you want to work with and click Finish.

The new server will be added to the Servers view.

Incremental publish of applications

One of the most interesting and time-saving features is the new support to incrementally publish applications. Before this update, even if a single line of code was changed we needed to re-deploy the entire application to integrate the change, now with the introduction of the Development Mode we are able to deploy only the changes we made. To activate this mode just right click the deployed application and click on Enable Development Mode. When the Development Mode is active, the Bluemix Tools will automatically calculate the deltas since the last time the application was updated and deploy only the modified files.

From the Servers view, right click the application and select Enable Development Mode.

When the application is ready the message "Developing" will displayed next to the application name.

Now the next time you make a change and deploy it, you will notice the deployment time was significantly reduced.

Remote debug applications

With the introduction of remote debug capabilities in IBM Eclipse Tools for Bluemix we can debug application running directly in Bluemix, but notice that this feature is available only to J2EE applications and packaged Liberty servers that are published from the tools. The process is similar to debug any other application locally, to enable this mode, from the Servers view, just right click the application you want to debug and click on Enable Application Debug, the application will be automatically restarted debug mode, after that, you can set breakpoints, view variable contents, run code step by step and use all other debug tooling included in Rational Application Developer 9.5 Beta.

From the Servers view, right click the application and select Enable Application Debug.

When the application is ready to be debugged the message "Developing, Debugging" will displayed next to the application name.

As you can see, the Development Mode is automatically activated along with the Debug capabilities. so you can use the incremental publish feature described before.

Run on Server for JavaScript files

As said before, re-deploy of applications is not longer needed to take every action in place. A great example of this new functionality is the possibility to explicitly define a entry point for Node.js applications. If you have several JavaScript files in your project and you want to define one of them as the main entry point for your application you just need to run the desired file in the IBM Bluemix server.

Right click in the .js file you want to designate as the entry point > Run As > Run on Server.

The application will be re-installed removing all previous conflicting configurations, and the selected JavaScript file will take place as the entry point.

Once application is started, the browser will be launched to show the new entry point selected.

In previous releases, to define a different entry point you needed to manually edit the package.json file, now you just need to run the file in the same way as any other application.

Remove unused routes

Every time you deploy an application to Bluemix a route is associated to it, in previous releases it was possible to map more routes to the same application, but now we are able to view all routes in the selected Space, including orphan routes (the ones that are not bound to any application) and delete them, in the past the only way to achieve this was using the following commands in the Cloud Foundry command line:

cf routes (List all routes).

cf unmap-route (Unmap selected route from a application).

cf delete-route (Delete selected route).

To launch the new Cloud Routes dialog:

From the Servers view, double click the IBM Bluemix server.

Switch to the Applications and Services ta

In the Routes section click the Remove... button.

In the dialog window by default are displayed only the orphan routes.

Select all routes you want to delete and click on Finish, the selected routes will be removed from Space.

If you want to delete a route that is currently being used by an application, select the Show In Use checkbox.

Recently, Chris Cook wrote an excellent article sharing some excellent obstacles enterprises have been hit with as they try to deal with the onslaught of demands in supporting internal-based mobile apps for their workforce as well as the BYOD revolution overtaking these companies.

In he writes “App revenues topped $30 billion in 2012, and the figures are getting better and better every year. ‘There’s an app for that,’ has become a cliché. There are apps on iTunes and Google Play for almost any need you may have (and thousands of apps for needs you don’t have). While generic apps are doing quite well, there hasn’t been concurrent upsurge in enterprises mobile apps development.

Most enterprises have enough resources and the will to create mobile apps for internal use. But there is no clarity in the market on the best strategy for enterprise app development. Some companies are adamant on creating close, internal apps, while others feel that using generic apps and tweaking them could be a better option. There is also a lack of best practices on how to distribute the apps and how to secure them.

As BYOD gains greater acceptance, the need for enterprise mobile apps increases. Although the enterprise mobile market is in its initial stage, most business leaders understand the need for mobile apps. A recent survey of industry leaders and managers by Appcelerator shows that most enterprises feel that more mobile apps will be developed than desktop applications in 2013. But, we are still not seeing the long-awaited enterprise app development revolution. Let’s take a look at the biggest obstacles to mobile app adoption by enterprises.

Security & Control Concerns – The strongest driving force behind the development of an enterprise app is a desire to provide better services to customers and help employee’s function with greater efficiency. So, most mobile apps for enterprises deal with company and/or client data. How secure the apps is, how it collects data and how secure the data is – these are the main concerns of most enterprises. Any security breach can spell big trouble for large organizations.

This is the main reason why most companies build internal apps and build their own app stores to manage their apps. Providing different privileges to different levels of employees and users through mobile apps is also a rather difficult process. Controlling and securing mobile enterprise apps is the biggest reason for the low rate of mobile adoption in enterprises.

Low on the IT Department Priority List – Many industry leaders feel that there are too many issues with enterprise mobile app development – lack of standard technology, problem of integrating the app with enterprise data, inability to formulate a long-term mobile app strategy, etc. Most IT departments in enterprises are working hard on other areas, and they simply do not have the time or resources to custom build applications.

Creating an app (or getting it developed elsewhere), setting the distribution channels for the app, updating the app and tweaking the app to support an array of mobile devices – these are daunting and time-intensive tasks. With most IT staff working on other organizational goals, it is, at times, not possible for enterprises to initiate a mobile app development project.

Inability to Calculate Impact in Long Run – Enterprise app development takes a lot of time, effort and money. Unless all the members who use the app have the same devices, the app will have to be developed for multiple mobile devices. This further exacerbates the situation. The rate at which technology is changing makes it extremely difficult for enterprises to measure the impact of apps in the long run. With Cloud technologies offering similar services, it becomes difficult for enterprises to come to a clear decision.

To Wrap it Up – While there are several factors that inhibit the flight of mobile enterprise app development, the popularity and ubiquity of mobile devices makes it imperative for all enterprises to replace many of their desktop apps with mobile apps. The mobile platform also creates opportunities that desktop apps simply cannot offer. Thankfully, there are countless success stories of large business organizations building and deploying mobile apps successfully. So, even if there are a few teething problems, the future holds promise.

Recently, Kerry Butters wrote an article on the advancement and future projections of mobile hybrid apps in the marketplace. This is something we have been hearing from our customers. While we aren’t finding that it is a one or the other approach (aka Native VS HTML5 view), we do see a continued need for hybrid app development as organizations struggle to provide the highest quality of app possible, with feature-rich experiences, combined with a stringent delivery system forcing them to meet certain requirements by the carriers and app stores.

In Kerry’s article she writes “According to the latest research from analysts at research firm Gartner, hybrid apps will be used in over 50% of mobile devices by 2016.

This is due to the growing use of HTML5-based web apps which unlike native apps, do not have to use multiple versions of an app for different devices. However, HTML5 with offline capabilities haven’t really come up to scratch, causing developers to consider using hybrid architectures.”

"The BYOD trend and the increased pressure on organizations to deploy mobile applications to accommodate mobile work styles of employees will lead businesses to manage a portfolio of mobile application architectures, and hybrid architectures will be especially well-suited to business-to-employee applications,” said Van Baker, research vice president at Gartner.

Gartner also predict that mobile devices will overtake PCs as the most common way to access the internet by the end of the year and by 2016, PC shipments are expected to be less than 50% of combined tablet and mobile shipments.

"The implications for IT is that the era of PC dominance with Windows as the single platform will be replaced with a post-PC era where Windows is one of a variety of environments that IT will need to support,” said Mr Baker.

It’s also thought that a wide range of internet-capable devices, including set-top boxes, smart TVs and wearable devices will become much more popular.

"While hybrid apps will be the majority of enterprise mobile apps, web technologies like HTML5 will make up the most commonly used languages for building mobile applications by 2015,” said David Mitchell Smith, vice president and Gartner Fellow.

"We recommend organizations are open to augmentations to the Web (such as hybrid Application Development) to deploy on mobile today, with the goal that more should be done without those augmentations after 2015,” said Mr. Smith.

"Organizations also need to continue to develop web technology skills, find the right uses for promising new technologies and approaches like HTML5, and deal with the uncertainty and speed of the consumer-driven mobile landscape. All the while it’s important to maintain IT governance while increasing productivity and usability.’”

In addition to the comprehensive documentation provided with IBM® Rational® Developer for System z®, we also offer a vast array of supplemental sources of education, insight, and expertise through the Rational Developer for System z Tech Portal.

The Tech Portal is a set of folders in the Eclipse environment with a broad range of assets beyond what the software provides, including technical guidance, development techniques, and IBM z/OS® language development content in the following formats:

Supplemental content within the product

Microsoft PowerPoint files

Microsoft Excel spreadsheets

Microsoft Word files

Graphics files

Links to community content on the Internet

IBM sites

Other companies' sites

You can find the package on the IBM developerWorks® site. It includes detailed directions for setup, use, deployment, and maintenance (all in PowerPoint format).

This is a continuation of the tutorial Improving the quality of your Web applications with IBM Rational Application Developer for WebSphere Software(Link) and will reuse the sample application adapted for mobile. In this tutorial, you will learn how to add testing capabilities to your new or existing Apache Cordova applications in Rational Application Developer.

Introduction

Rational Application Developer for WebSphere Software 9.5 Beta 2 (referred to as RAD in this article) is shipping with new code quality tools for JavaScript-based applications. These tools allow developers to create unit tests for your JavaScript code.

Jasmine, a framework that allows developers to create JavaScript unit tests based on Behavior-Driven Development (BDD), is the first JavaScript unit test framework supported by the product. A typical Jasmine test is composed of:

Test file: Also called Spec file. This is a plain JavaScript file that holds your test code.

Test suite: Also called Spec and is defined by the function describe. Contains a description of the test suite as well as a callback function that, in turn, contains the setup, scenarios and tear down of the tests. A Spec file can hold as many test suites as the developer requires.

Test case: Defined by the function it. This is placed inside the describe function, meaning this belongs to a test suite. This is also defined with a meaningful description and a callback function, which holds the logic of the test case. In this callback function, you can use a function called done that is used to set the test as complete, very useful for asynchronous tests as you will see in this tutorial.

Test runner: Also called Spec runner. This is a regular HTML file that loads the Jasmine files as well as the Spec files and API files. This HTML file triggers the test execution once it is loaded by the web browser.

There are other functions and concepts related to Jasmine and they are very well documented in Jasmine web site, but the above artifacts are the basic constructs of a test.

The sample in this tutorial is a library in where a person can consult which users (called customers), authors, books and loans are registered in the library. The application is composed of two applications:

LibraryREST: This is the back-end of the application, which exposes REST API to add, retrieve and update entities.

LibraryMobile: The mobile application of the library, based on Apache Cordova. It is built with jQuery and wraps the service objects in an object-oriented approach for an easy encapsulation and testing.

This mobile application reuses the assets from LibraryjQueryOO and LibraryTest projects, developed in tutorial Improving the quality of your Web applications with IBM Rational Application Developer (Link).

Pre-requisites

IBM Rational Application Developer 9.5 Beta 2.

IBM WebSphere Application Server Liberty Profile 8.5 must be installed already and a server instance created in the workspace.

Note that a folder tests is added under www/js folder of the project. This tests folder contains the Jasmine files that are needed to run the tests and will also contain the tests.

Creating test cases

Creating test cases is trivial in RAD, just invoke the Jasmine Spec file wizard and select the files and/or functions that will be under test and RAD will generate skeleton code; this allows you to focus on your test logic instead of the wiring code to make it work with Jasmine.

Right click on the test project and select New > Folder

Expand the tree of the test project up to www/js/tests and select tests folder.

Set the folder name to specs.

Click on Finish.

Right click on the specs folder and select New > Jasmine Spec File

Set a name for this test file. In this tutorial the name used is AuthorsSpec.

Click Next.

Expand AuthorsService.js and select the functions in it.

Click Finish.

The file is created and opened in an editor for quick editing. At this point, you can start adding your own test logic. Also note that you have a test case per function (in Jasmine, each it() function is equivalent to a test case, while describe() function is equivalent to a test suite).

Note that the code above doesn't do an extensive testing of the API, but the recommended practice is to test both valid and invalid values to ensure integrity and reliance. Because of simplicity, this code is just testing scenarios that will always be true.

You can try the same steps for creating the test cases for each of the service JS files in www/js/api folder

If you want to add more test suites, test cases or expect scenarios, you can use the content assist (Control key + Space bar key) in the JavaScript editor to display the code templates in there.

Creating the test runner

Creating test cases is one thing, but creating the runners is different. Since Jasmine runs the tests on a client environment, a web browser in this case, an HTML is required to fire up the execution of the tests.

Right click in the test project and select New > Web Page.

Enter a name for this file. In this tutorial the name is runner.html.

Select Jasmine Spec Runner in the templates section.

Click Options... to customize the HTML.

Select Jasmine Files.

Click Add...

Select AuthorsService.js file from LibraryMobile/www/js/api folder.

Click OK.

Click Add... again.

Select the test file from LibraryMobile/www/js/tests/specs and click OK.

Make sure the order is as follows. If not, then use the arrows to order them.

Click Close.

Click Finish.

The HTML page is opened in Rich Page Editor. If not there yet, add the jQuery script file to complete the runner configuration. Copy and paste this code right in the beginning of the header of the HTML.

<script src="js/libs/jquery-1.11.3.js"></script>

And also add this tag at the end of the scripts section.

<script src="cordova.js"></script>

Now the test is completed and you are ready to try the tests.

Deploying and testing

Note: At this point, you should already have one Cordova platform installed in the project. If not, go to this link for instructions on how to configure one in the workspace:

IBM Rational Application Developer V9.5 Beta (Feb) had the portlet tooling capabilities integrated for the WebSphere Liberty Profile and with the Beta refresh, it offers the tooling to create JSF 2.2 portlet projects targeted for the IBM WebSphere Application Server Liberty profiles. You can create and maintain resources for JSF 2.2 portlet applications by using JSR 286 as well as JSR 168 portlet API.

To create and publish the JSF portlet projects on WebSphere® Application Server Liberty Profile, you need to ensure the following pre-requisites features are properly configured in your IBM WAS Liberty profile. These features are hosted on WASdev along with IBM WAS Liberty profile.

Portlet Container feature

Portlet Serving features

JSF Portlet Bridge feature (Beta)

The enhancements for JSF2.2 tooling in IBM Rational Application Developer v95 Beta (June) and JSF 2.2 Portlet bridge Beta adds the support for following features as per the JSF2.2 specification

Generating the portlet configuration artifacts like portlet.xml and faces-config.xml,

Updated code generation in facelet code as JSF 2.2 feature have different name spacing than JSF2.0

The file upload component in palette view

JSF 2.2 HTML 5 Support

JSF 2.2 Stateless views

Once the portlet project is deployed on the Liberty profile, you can configure the WSRP (i.e. web services for remote portlets) producer on IBM WebSphere Liberty profile and consume these portlets on WebSphere Portal server through WSRP by placing them on a portal page.

You can read more about the configuration of environment and creation of JSF portlet project in the knowledge center.

For more information about JSF 2.2 portlet support , visit our Knowledge Center.

To find out more about Rational Application Developer V9.5 Beta, visit our Early Program site.

In a previous blog post for Rational Application Developer v9.5 Beta (Feb), we covered how to use Software Analyzer Team Advisor to improve code quality by allowing RTC administrators to set code delivery preconditions, forcing developers to adhere to certain static code analysis rules when they deliver their code. In RAD 95 Beta (June), we are adding a new feature so that Software Analyzer can be run as part of Rational Team Concert builds and the results of running both Java Code Review rules and Java Software Metrics can be viewed as part of the general build results.

Software Analyzer Build Integration requires a new offering called Rational Code Quality Extension for Continuous Integration to be installed into IBM Rational Team Concert Build System Toolkit 4.x, 5.x or 6.0 on the build machine. The Software Analyzer package under Code quality tools for Rational Team Concert Build System Toolkit must be selected during install. IBM Rational Team Concert client 4.x, 5.x or 6.0 must be installed on the RAD client workbench. Use the -clean option when starting the build engine.

Procedure

On your client workbench IDE, create a build definition using the provided wizard. Select the Software Analyzer - Jazz Build Engine - Ant template on the General Information page, and make sure Software Analyzer is selected on the Post-build page. The build definition editor will open up automatically after completing the wizard.

Fill out the appropriate fields relating to Supporting Build Engines, Jazz Source Control and Ant. Select the new Software Analyzer tab and fill in the Software Analyzer TargetResource directory field. This is the main folder where the Eclipse projects for analysis reside and will be the same load destination directory that is specified in the Jazz Source Control page.

In the Software Analyzer page Rule Selection section, select one of the two following options:

Use an existing .dat file: A rule file that has been previously exported can be specified to be used during the build.

Make a rule selection: Select one or more rules to use during software analysis.

The Software Analyzer page Report Options section offers options for generating html and xml reports as well as affecting general build results so that if any rules marked as severe are violated the build fails

Results

When Software Analyzer is specified as a post-build participant, a new Software Analyzer Results tab appears in the build results. This tab contains a summary of the Software Analyzer results, including up to 100 of the most serious results for Java Code Review and/or Java Software Metrics. If HTML or XML reports were selected to be generated in the build definition they will be available in the Downloads tab of the build results.

Summary

Software Analyzer RTC Build Integration in RAD v95 Beta (June) allows users to run static code analysis rules as part of an RTC build and see the results as part of the RTC general build results.

For more information about Software Analyzer integration with Rational Team Concert builds, visit our Knowledge Center.

Java profiling tools in Rational Application Developer (RAD) enables users to analyze execution flow, memory usage and thread usage. It can be very useful for tracking down performance problems in these areas. Java profiling is currently supported for applications running on local and remote WebSphere Application Servers, but only on local WebSphere Application Server Liberty profile. The ability to run Java profiling on remote WebSphere Application Server Liberty profile is now added in Rational Application Developer v9.5 Beta. Users can now run trace based profiling or sample based profiling on remote Liberty profile similar to the support on remote WebSphere Application Server.

As in the case of WebSphere Application Server, the Rational Agent Controller is required on the remote server where Liberty Profile is installed to enable remote profiling.

Prerequisites and required configurations

Before you begin profiling on a remote Liberty profile server, make sure you follow these information to configure your local system and remote systems:

Liberty Profile has been installed on both local and remote systems, configured and ready for application deployment

Set the JAVA_HOME property for your remote Liberty profile server.The Liberty profile requires a JRE in which to run. You can specify the JDK or JRE location using the JAVA_HOME property in the server.env file. For example, if server.env doesn't exist in the <Liberty Install dir>\urs\servers\<servername> directory on your remote system, create one and add this line:

JAVA_HOME=<RAD install dir>\jdk\jre

Ensure that the server is started. The wlp/bin directory contains a script called server to help with controlling the server process.

Profiling on remote Liberty profile server

Here are the steps for profiling an application using remote Liberty profile server:

In the Enterprise Explorer view, right-click a resource that you want to profile on the server and select Profile As > Profile on server. The Profile on Server wizard opens.

Choose an existing server or manually define a new server. Click Next. The Add and Remove Project page opens.

Under the Configured Projects list, verify your application you want to profile is added. Click Finish.

If the server is already started in run or debug mode, you will be prompt to switch to profile mode. Select the Switch mode (will restart if necessary) radio button and click OK.

Another Profile on Server wizard opens with Profile Settings and Destination tabs. Use this wizard to specify your profiling criteria, such as selecting the relevant data collectors, analysis types, filters, and configuring the profiling data destination. Click Finish.

If you are in any perspective other than the Profiling perspective; the Confirm Perspective Switch dialog opens, click Yes to switch to the Profiling perspective.

In the Servers view, the server state now displays Profiling.

After the server starts in profiling mode, in the Profiling Monitor view, you can find the server process, process id and the corresponding profiler and analysis type.

Here is the Profiling Monitor view for Execution Analysis:

In addition to traced-based profiling, sample-based profiling using Health Center agent is also supported on remote Liberty Profile. To profiling with Health Center agent on remote Liberty Profile server, on the Profile on Server wizard with Profile Settings and Destination tabs, you can:

Or click the Profiling Quick Start button to use the Profiling Quick Start wizard.

Select My application runs slower than expected

Select Sample-based profiling. Click Next.

Here is the Profiling Monitor view to show profiling sample data collected using Health Center Agent:

the above example shows which methods are using the most processing resources. Methods with a higher Self % value (those higher up near the top of the table) are good candidate for optimization to improve on execution time.

Rational Application Developer V9.5 Beta extends its Java profiling capability to support remote Libery Profile in addition to WebSphere Application Server full profile for both local and remote configurations. It offers developers and testers an exceptional developer experience having these tools fully integrated into the IDE, and enabling easy and quick identification of performance related issues through memory, thread and/or execution flow analysis during development and test.

In software development we often find the concept of “flow”, that takes users through a series of screens, similar to wizards, includes booking, sign up, checkout systems, etc. in which we have a well defined starting node and depending on the requirements, more than one exit node. we can implement flows like this using ad-hoc techniques, i.e: creating links between the pages involved in the flow and passing data across the views using a CDI scope (Session scope is commonly used in this situations). But we will end up with a structure that will be difficult to re-use in other applications and not safe because different instances of the flow will share the same data even if the flow is opened in different windows or browser tabs.

Faces Flow is a JSF "big ticket feature" that brings a lot of new concepts, These features make Faces Flow a suitable tool to implement wizard-like structures. One of the most interesting parts of this feature is the new CDI annotation, @FlowScoped, which has the following JavaDoc:

A flow scoped bean (@FlowScoped), is a bean used to back a entire flow instead of just a single view. This new scope is specifically designed to work with Faces Flow, because it exists for an instance of the flow and it can only be accessed from views inside the flow, this is specially useful because is an user launch the same flow in different browser tabs they won´t interfere with each other, every instance of the flow is completely isolated. A flow scoped bean looks as follows:

Faces Flow follows the Convention Over Configuration design pattern, so, by convention, having a folder called the same as the flow and a view (facelet) inside that folder with the same name too, automatically designates it as the initial node, but if for certain reason you don't want to use the conventions, you can always specify a different start node.

To enter a flow simply specify the flow name in the action attribute of a command button or a command link:

<h:commandLinkvalue="Enter flow"action="FlowName"/>

To exit from the flow we could use a returnnode or simply navigating to a view that is not part of the flow:

<h:commandLinkvalue="Exit flow"action="ReturnName"/>

There are two ways to define a flow: you can use CDI annotations or use a configuration file. This file follows the same structure of the standard faces-config.xml; Rational Application Developer V9.5 Beta provides a simple editor to define flows. Remember that all annotations can be overridden by XML configurations, everything that can be defined using annotations can also alternatively be specified in the flow configuration files.

There’s also a new flowScope EL (Expression Language) variable that can be used to store and share data across the flow, this variable is explicitly associated with the current flow, so there is no risk in launching the same flow in different browser tabs. its values can be accessed in the same way as any other EL object:

#{flowScope.someKey}

One important thing that really sets Faces Flows apart from the old navigation rules is that nodes in a graph are not restricted to views, currently there are 5 types of nodes:

Nodes of a Faces Flow graphs are not restricted to views (facelets), this is a huge improvement over the current techniques to build flows, because instead of just linking pages, we can also call Java methods and create switch/case structures to dynamically determine the next node in the flow, at the moment there are 5 type of nodes:

View – A regular page like foo.xhtml that represents a certain view that is part of a flow.

Switch – One or more EL expressions of which the first that returns true determines the next node.

Return – Specify the exit point of the flow.

Method Call – Specify a Java method call, this method can return an outcome to determine the next node in the flow.

Faces Flow Call – A call to another flow, starting a nested flow. The first flow will continue once the nested flow is completed. There can be an arbitrary number of nested flows.

Now let's jump to a simple real-world scenario, "I want to implement a registration process, consisting in several pages asking users for basic info like name, address and email, but the implementation should be re-usable so I can easily use it in different applications with no extra coding".

Prerequisites

To start working with the new JSF 2.2 features first we need to download a runtime that supports the new JSF implementation, like Glassfish 4 and also we need to install its adapter.

Now that we have the runtime and the adapter installed, we can create a GlassFish server.

In RAD, right click the Servers view > New > Server

Select GlassFish > GlassFish 4, click Next

Search for the installation folder and click Finish.

New JSF 2.2 tools for creating Faces Flow

Rational Application Developer V9.5 Beta provides a new wizard and editors to easily define flows, the tools also are able to create the configuration file and the initial node so we can start working with the flow right away. The first step is to create a JSF 2.2 project:

Click File > New > Project > Web > Web Project.

In the Name field type a name for your project.

In the Project Templates list, select JavaServer Faces, click Next.

In the left list, select JSF Settings, then in the JSF Version combobox select 2.2 (The new tooling is only enabled in JSF 2.2 projects, so make sure to select the right version).

In the left list, select Deployment, then in the Target Runtime combobox select GlassFish 4.

In the left list, select JSF Library, in the Type combobox make sure GlassFish System Library is selected.

Click Finish.

Now that we have a JSF 2.2 project we can start creating the flow using the new tooling.

Right click the project > New > Faces Flow Definition.

In the New Faces Flow Definition wizard type "FlowDemo" as the Flow name, and select the Create Flow configuration file checkbox, it will look like this:

Click Finish.

The basic structure of the flow will be automatically created in the project:

FlowDemo folder: This folder will contain all facelets (nodes) in the flow.

FlowDemo-flow.xml file: Configuration file used to define the flow.

FlowDemo.xhtml file: Initial node in the flow.

The flow will consist in 3 pages with buttons to navigate across the flow, asking users the following info:

Page 1

Name

Surname

Email

Page 2

Address

Zip code

Phone number

Page 3 (This page is just a confirmation view that will display the info entered in the previous pages and also a button to exit the flow).

Now let's create the pages (we only need to create two more pages because the first one was already created by the New Faces Flow Definition wizard).

Create two more facelets (nodes)

Right click the FlowDemo folder > New > Web Page, make sure the Facelet template is selected and type "FlowDemo2" as the File name.

Right click the FlowDemo folder > New > Web Page, make sure the Facelet template is selected and type "FlowDemo3" as the File name.

Open FlowDemo3.xhtml, replace all existing code with this one (Notice the Home Page button will call a return node called "home" to exit the flow. We will define this return node in step 4 using the Flow Configuration file):

Create a Java bean (since the bean will be annotated with @FlowScoped, it will live as long as you're navigating through the specified collection of views registered in the flow, @FlowScoped is a CDI scope that defines the scope of bean in the specified flow. This enables automatic creation of the bean when the flow is launched and destruction when the scope is exited.

Right click index.xhtml > Run As > Run on Server > select Glassfish and click Finish, it will look like this:

Click on the Start flow button to navigate to the initial node, enter the required info, it will look like this:

Click on the Next button to navigate to the next node in the flow, enter required info, it will look like this:

*Notice the Zip code list is populated using the values returned from the RegistrationBean.

Click Finish to navigate to the last node in the flow, this page should contain the info from the previous nodes (The data was transported across the flow using the implicit EL object #{flowScope}).

Click on the Home Page button to navigate to the index page using the home return action defined in the FlowDemo-flow.xml file.

Faces Flow provides a way to create isolated wizard-like complex structures encapsulating related views, but it goes beyond that, by providing a system to re-use the flow in different applications with minimal or no changes in the code.