Tuesday, November 15, 2016

MobileFirst on Bluemix: Getting Started

Hi folk,

As I explained in previous post the IBM MobileFirst Platform is available as an on-premise server or on the IBM Bluemix cloud offering. In this example I'm going to focus on the MobileFirst for Bluemix cloud offering for creating a mobile application and then download to emulate in a test environment.

You’ll first need to sign into your Bluemix account. If you don’t already have one, you can create a trial account for free.

The steps are divided into::
Step 1 - Create the MobileFirst service to register the applications
Step 2 - Create an application
Step 3 - Download code and emulate

Step 1 - Create the MobileFirst service to register the applications

Procedure:
1. Login into IBM Bluemix dashboard
2. Click Catalog tag menu
3. Click Mobile option
 3. Click Mobile Foundation
4. You can find the different prices and rates. Create a developer instance for free. Change the default server name and click Create
5. The creation of the service allows you to parameterize advanced options. In this example I want to start the default basic server. Scroll down and click Star Basic Server
Note: Starting the server can take up to 10 minutes to complet.
6. Launch the administration console. Click Launch Console
Note: Copy the automatically generated password for the admin user

7. Login with admin user to MobileFirst Operations Console

 

Step 2 - Create an application

Procedure:
1. Go to IBM Bluemix Mobile project dashboard from menu App and select Mobile
2. Click Create Project
3. Select the Business Directory starter and click Create Project
4. Write the Project Name and click Create
5. Click Build Get Code
6. Select Android platform
Note: Generate Code can take up to 1 minutes to complet.

After the code has been generated, three options are displayed:

 

Step 3 - Download code and emulate

Procedure:
1. Click Download Code
2. Unzip the file
3. Open Android Studio and Open an existing Android Studio project
4. Select the folder unziped
Note: If an error occurs when synchronizing the project Gradle. Click Install and wait for the installation to finish
5.  Click Run to build and run the application in the emulator
In the emulator appears the application created in Bluemix !!
I just set up a development environment with an application created from a Bluemix template, wow!

Soon I will publish how the application is registered on the created MobileFirst service and how the application uses Bluemix services. Be Patient !!!

Cheers!

IBM MobileFirst Platform 8.0 - Developing Applications (Adding the MobileFirst SDK to Android Applications)

Folk, I'm still testing IBM MobileFirst Platform 8.0. Today it's time to add the MobileFirst SDK to Android Applications.

I will follow once again the guide documented in the development site of IBM MobileFirst Platform.

Hope that helps!

Let's go, the dependencies correspond to core functions and other functions:
  • IBMMobileFirstPlatformFoundation - Implements client-to-server connectivity, handles authentication and security aspects, resource requests, and other required core functions
  • IBMMobileFirstPlatformFoundationJSONStore - Contains the JSONStore framework
  • IBMMobileFirstPlatformFoundationPush - Contains the Push Notifications framework
Prerequisites:
  • Android Studio and MobileFirst CLI installed on the developer workstation
  • A local or remote instance of MobileFirst Server is running
  • Setting up your MobileFirst development environment and Setting up your Android development environment
Procedure:
1. Create an Android Studio project or use an existing one


2. In Android → Gradle Scripts, select the build.gradle (Module: app) file
3. Add the following lines after apply plugin: 'com.android.application': 
repositories{
     jcenter()
}

4. Add the following line inside the android section: 
packagingOptions {
     pickFirst 'META-INF/ASL2.0'
     pickFirst 'META-INF/LICENSE'
     pickFirst 'META-INF/NOTICE'
}

5. Add the following line inside the dependencies section:
compile 'com.ibm.mobile.foundation:ibmmobilefirstplatformfoundation:8.0.+'
6. In Android → app → manifests, open the AndroidManifest.xml file. Add the following permissions above the application element:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

7. Add the MobileFirst UI activity next to the existing activity element:
<activity android:name="com.worklight.wlclient.ui.UIActivity" />
Note: If a Gradle Sync request appears, accept it.

8. Registering the application to MobileFirst Server, go to project folder and run:
$ mfpdev app register
Verifying server configuration...
Registering to server:'http://###.###.###.###:9080' runtime:'mfp'
Registered app for platform: android


Note: To check the registration in the console, in this example I have installed the MobileFirst Server component in my local environment: http://localhost:9080/mfpconsole/login.html



9. Creating a WLClient instance, in this example, added in MainActivity class.
WLClient.createInstance(this);
Note: Creating a WLClient instance should happen only once in the entire application lifecycle. It is recommended to use the Android Application class to do it.

10. Run the app in Run → Run 'app'
Cheers!!!

Monday, November 14, 2016

IBM MobileFirst Platform 8.0 - Developing Applications (Adding the MobileFirst SDK to iOS Applications)


The MobileFirst Foundation SDK consists of a collection of pods that are available through CocoaPods and which you can add to your Xcode project:
  • IBMMobileFirstPlatformFoundation - Implements client-to-server connectivity, handles authentication and security aspects, resource requests, and other required core functions
  • IBMMobileFirstPlatformFoundationJSONStore - Contains the JSONStore framework
  • IBMMobileFirstPlatformFoundationPush - Contains the push notification framework
  • IBMMobileFirstPlatformFoundationWatchOS - Contains support for Apple WatchOS
Prerequisites:
  • Xcode and MobileFirst CLI installed on the developer workstation
  • A local or remote instance of MobileFirst Server is running
  • Support level
    • Xcode 7.1 and later
    • iOS 8 and later
Procedure:
1. Create an Xcode project or use an existing one (Swift or Objective-C). For example I have chosen Swift.
Note: Swift is a new programming language for iOS, macOS, watchOS, and tvOS apps that builds on the best of C and Objective-C, without the constraints of C compatibility. Swift adopts safe programming patterns and adds modern features to make programming easier, more flexible, and more fun. Swift’s clean slate, backed by the mature and much-loved Cocoa and Cocoa Touch frameworks, is an opportunity to reimagine how software development works. 




2. If CocoaPods is already installed in your development environment, skip to step 3.
Open a Command-line window and navigate to the root of the Xcode project and run:
Note: "pod setup" command might take several minutes to complete. Use a git process.

$ sudo gem install cocoapod
$ pod setup
Setting up CocoaPods master repo
Setup completed

3. This creates a Podfile
$ pod init

4. Edit the Podfile.
Comment out or delete the contents of the file.
Add the following lines and save the changes:

use_frameworks!

platform :ios, 8.0
target "MyHelloiOS" do
    pod 'IBMMobileFirstPlatformFoundation'
end

5. Back in the command-line window, run the commands. These command add the MobileFirst Native SDK files, add the mfpclient.plist file, and generate a Pod project.
Note: The commands might take several minutes to complete.

$ pod install
Analyzing dependencies
Downloading dependencies
Installing IBMMobileFirstPlatformFoundation (8.0.2016070718)

[!] Please close any current Xcode sessions and use `MyHelloiOS.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

$ pod update
Update all pods
Updating local specs repositories

CocoaPods 1.2.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.0.beta.1

Analyzing dependencies
Downloading dependencies
Using IBMMobileFirstPlatformFoundation (8.0.2016070718)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

6. Close Xcode and open Xcode MyHelloiOS.xcworkspace file


7. Registering the application to MobileFirst Server, go to project folder and run:
$ mfpdev app register 
Verifying server configuration...
Registering to server:'http://####.####.####.####:9080' runtime:'mfp'
? Enter your bundleId: jif.examples.helloios
To prevent future prompting for the bundle ID in iOS projects, update the '<string>' element that corresponds to the '<key>CFBundleIdentifier</key>' in your Info.plist file.
Registered app for platform: ios

8. In Xcode, right-click the project entry, click on Add Files To [ProjectName] and select the mfpclient.plist file, located at the root of the Xcode project.




 Cheers!!!

IBM MobileFirst Platform 8.0 - Developing Applications (Adding the MobileFirst SDK to Cordova Applications)

Hi folk, again back with new developments. I will start a series of post about the development of applications for mobile devices based on IBM MobileFirst Platform.

The idea is to learn new concepts about: MobileFirst-provided APIs for Native, Cordova and Web applications, such as JSONStore and WLResourceReuest.
The MobileFirst Cordova SDK is provided as a set of Cordova plug-ins, and is registered at NPM.
NPM is the package manager for JavaScript.

Available plug-ins are:
  • cordova-plugin-mfp - The core SDK plug-in
  • cordova-plugin-mfp-push - Provides push notifications support
  • cordova-plugin-mfp-jsonstore - Provides JSONStore support
  • cordova-plugin-mfp-fips - Android only. Provides FIPS support
  • cordova-plugin-mfp-encrypt-utils - iOS only. Provides support for encryption and decryption
The Cordova platform versions supported by the MobileFirst plug-ins, are:
  • cordova-ios: >= 4.1.1 and < 5.0
  • cordova-android: >= 5.1.1 and < 6.0
  • cordova-windows: >= 4.3.2 and < 5.0
Prerequisites:
  • Apache Cordova CLI 6.x and MobileFirst CLI installed on the developer workstation.
  • A local or remote instance of MobileFirst Server is running.
  • Setting up your Cordova development environment.
Before you start, make sure that the MobileFirst Server is running.

Procedure:

1. Check Cordova version
$ cordova -v
6.1.1

2. Create Cordova project
$ cordova create MyHelloCordova jif.example.hellocordova MyHelloCordova --template cordova-template-mfp
Creating a new cordova project.
Retrieving cordova-template-mfp using npm...


Note:
“MyHelloCordova” is the folder name of the application
“jif.example.hellocordova” is the ID of the application
“MyHelloCordova” is the Name of the application
--template modifies the application with MobileFirst-specific additions
Because the application was configured using the MobileFirst template, the MobileFirst core Cordova plug-in is added automatically.



3. Change directory to Cordova project:
$ cd MyHelloCordova

4. Add one or more supported platforms to the Cordova project by using the Cordova CLI command: cordova platform add ios|android|windows. For example:
$ cordova platform add android

5. Registering the application to MobileFirst Server
$ mfpdev app register
Verifying server configuration...
Registering to server:'http://####.####.####.####:9080' runtime:'mfp'
Updated config.xml file located at: /Users/jorge/Development/Mobile/mfp/workspace/MyHelloCordova/config.xml
Run 'cordova prepare' to propagate changes.
Registered app for platform: android


Note: You can also register applications from the MobileFirst Operations Console

6. Propagate changes and run the example
$ cordova prepare
$ cordova emulate


Monday, February 8, 2016

IBM MobileFirst Platform - Part II. Install the Mobile Test Workbench

Let's go! with the Mobile Test Workbench, if you have MobileFirst Studio installed (IBM MobileFirst Platform - Part I Install Developer Studio),  you can automate the functional testing of Android and iOS applications that were built with MobileFirst Studio.
  1. Start Eclipse, and then select Help > Eclipse Marketplace
  2. In the Find field, type MobileFirst Platform Test Workbench and click Go
  3. Click the Install button
  4. Select the features that you want to install, and then click Next.
  5. Click Next, and then review and accept the license terms, and then click Finish to begin the installation
  6. Follow the prompts to complete the installation
  7. Restart Eclipse IDE for the changes to take effect
Note: Testing Android applications with the Test Workbench requires a JDK. Be sure to add the path to the JDK in Eclipse under Window > Preferences > Java > Installed JREs, and set it as the default JRE by selecting its corresponding check box

When IBM MobileFirst Platform Test Workbench is installed, you can install the mobile test client for Android and the mobile test client for the iOS Simulator.

IBM MobileFirst Platform - Part I. Install Developer Studio

IBM MobileFirst Platform Studio is an Eclipse plug-in that helps you quickly build, run, and manage mobile web, hybrid, and native apps., allowing developers to perform all the coding and integration tasks that are required to develop a fully operational application ror a variety of mobile, tablet, desktop and web environments

I'll install the plug-in in my IBM Rational Software Architect Designer 9.5 based on Eclipse 4.4.2



Note: Ensure that your Eclipse workspace path does not contain any spaces, which can cause failures when apps are deployed to the internal development server, or when the MobileFirst Operations Console is started.
  1. Start Eclipse, and then select Help > Eclipse Marketplace.
  2. In the Find field, type MobileFirst Platform and click Go.
  3. Click the IBM MobileFirst Platform Studio Install button.
  4. IBM MobileFirst Platform Studio and all features are preselected. Confirm your selection and click Next.
    • Always select IBM MobileFirst Platform Studio
    • IBM Dojo Mobile Tools and IBM jQuery Mobile Tools are optional, select them based on your anticipated use 
  5. Review and accept the license terms, and then click Finish to begin the installation
  6. Follow the prompts to complete the installation
  7. Restart Eclipse IDE for the changes to take effect.
Note: If your Eclipse workbench has IBM Rational Team Concert™ V4.0 Eclipse Client already installed, you might need to clean the Eclipse environment before you use Studio.

First you have is the welcome page with some links to mobile features.

 
 Enjoy it and you can start to create mobile apps!


Monday, July 13, 2015

Cobol programming language - Install openCOBOL

What is COBOL
COBOL (Common Business Oriented Language) was the first widely-used high-level programming language for business applications.
COBOL is used for writing application programs and we cannot use it to write system software. 


COBOL is a standard language that can be compiled and executed on machines such as IBM AS/400, personal computers, etc.
 

It was designed for business-oriented applications related to financial domain, defense domain, etc. It can handle huge volumes of data because of its advanced file handling capabilities.
 

Logical control structures are available in COBOL which makes it easier to read and modify. COBOL has different divisions, so it is easy to debug.

What is OpenCOBOL

OpenCOBOL is an open-source COBOL compiler. OpenCOBOL implements a substantial part of the COBOL 85 and COBOL 2002 standards, as well as many extensions of the existent COBOL compilers.

OpenCOBOL translates COBOL into C and compiles the translated code using the native C compiler. You can build your COBOL programs on various platforms, including Unix/Linux, Mac OS X, and Microsoft Windows. cobc binaries exist for HP/UX, zOS, SPARC, RS6000, AS/400 and more.

The compiler is licensed under GNU General Public License.
The run-time library is licensed under GNU Lesser General Public License.


More information: http://www.opencobol.org

Install procedure:

I have done the installation on a virtual server with RHEL 7.1 64 bits and root as user.

1) Download software
$ wget http://downloads.sourceforge.net/project/open-cobol/gnu-cobol/1.1/gnu-cobol-1.1.tar.gz

2) Unzip file
$ tar zxvf gnu-cobol-1.1.tar.gz

Note: In RHEL 7.1 you must have installed the following libraries

GNU MP (libgmp) 4.1.2 or later
    libgmp is used to implement decimal arithmetic.
    GNU MP is licensed under GNU Lesser General Public License.

GNU Libtool (libltdl)
    libltdl is used to implement dynamic CALL statements.
    GNU Libtool is licensed under GNU Lesser General Public License.


If you have not installed then:
$ yum install gmp-devel libtool 

3) Configure and install
$ cd gnu-cobol-1.1
$ ./configure

$ make
$ make install

Note: if you get the following error "configure: error: Berkeley DB db.h is missing or has incompatible version"

$ yum install libdb-devel.x86_64


4) Test cobol compiler
$ cobc -V

cobc (GNU Cobol) 1.1.0
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Keisuke Nishida
Copyright (C) 2006-2012 Roger While
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Built     Jul 08 2015 13:37:40
Packaged  Jan 20 2014 07:40:53 UTC
C version "4.8.3 20140911 (Red Hat 4.8.3-9)"


5) Create a test file
$ vi myFirstCob.cob

IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE-01.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
MAIN.
DISPLAY "My First COBOL" UPON CONSOLE. |
STOP RUN.
 

$ cobc -x -free myFirstCob.cob
$ ./myFirstCob

Note:

./myFirstCob: error while loading shared libraries: libcob.so.1: cannot open shared object file: No such file or directory

It'll add the libcob.so to LD_LIBRARY_PATH

$ vi /etc/ld.so.conf.d/gnu-cobol-1.1.conf
Write the following:
/usr/local/lib

$ ldconfig

Run again sample program.

$ ./myFirstCob





Wednesday, January 1, 2014

Rational Team Concert - Migrating 32-bit to 64-bit environment

Hi folk,

I will describe in this post, using Rational Team Concert (RTC) 3.0.1, the migration procedure followed from 32-bit environment to 64-bit environment.

Easy right?

For this example I have prepared three virtual machines with the following characteristics:
  • RHEL 5.5 (32 bits)
    • hostname: cocbase
    • IP: 192.168.186.173
    • Install software:
      • IBM WebSphere Application Server ND 7.0.0.23
      • IBM HTTP Server 7.0.0.23 
      • IBM Installation Manager 1.5.2
      • IBM Rational Team Concert 3.0.1 
  • Ubuntu 12.04.3 LTS (64 bits)
    • hostname: ubuntu64ddbb
    • IP: 192.168.186.169
    • Install software:
      • IBM DB2 ESE 9.7
      • OpenLDAP
  • RHEL 5.5 (64 bits)
    • hostname: cocbase
    • IP: 192.168.186.175
    • Install software:
      • IBM WebSphere Application Server ND 7.0.0.23
      • IBM HTTP Server 7.0.0.23 
RTC initial described in the following diagram:



So, let's start!

The procedure:
  1. Verify that your hardware and software
  2. Check special instructions for UNIX systems
  3. Setting up a WebSphere Application Server:
    1. Security
    2. Specific settings on the Java Virtual Machine
    3. LDAP configuration
  4. Install IBM Installation Manager 1.5.2
  5. Install IBM Rational Team Concert 3.0.1
  6. Change owner and permissions on applications
  7. Deploying applications
  8. Stop Web services 32 bits environment
  9. Copy filesystem
  10. Start application server and web services 64 bits environment
  11. Check migration
1. Verify that your hardware and software
A 64-bit operating system and a minimum of 4 GB of server memory provide the best environment for running the Jazz Team Server (JTS). For a complete list of system requirements for the current release, see System Requirements. For sizing guidelines, see Maximizing performance.

2. Check special instructions for UNIX systems
This link provides information about installing Rational solution for Collaborative Lifecycle Management (CLM) products on UNIX systems.

3. Setting up a WebSphere Application Server
Security
  • The Java™ 2 Security option must be turned off:

  • Ensure that the Use available authentication data when an unprotected URI is accessed application server security setting is selected

Specific settings on the Java Virtual Machine
Click Servers > Server Types > WebSphere application servers > Server1.
Under Server Infrastructure, click Java and Process Management > Process definition.
Under Additional Properties, click Java Virtual Machine.
  • Add the value 100 to Initial Heap.
  • Add the value 4096 to Maximum Heap Size. Set the value according to your environment. A typical medium-size team can use a value of 4096 MB, providing 4 GB of heap memory for the JTS process on a 64-bit computer.


Click Apply, and then click Save directly to the master configuration.

It should create the following custom properties under Java Virtual Machine > Additional Properties, click Custom properties.


Click Apply, and then click Save directly to the master configuration.
For more information use this link.

LDAP configuration
These are the settings that I have in my example:
  • Primary administrative user name: wasadmin
  • Type of LDAP server: Custom
  • Port:389
  • Base distinguished name (DN): dc=example,dc=com
  • Bind distinguished name (DN): cn=admin,dc=example,dc=com

In Global security > Standalone LDAP registry > Advanced Lightweight Directory Access Protocol (LDAP) user registry settings:
  • User filter: (&(uid=%v)(objectclass=person))
  • Group Filter: (&(cn=%v)(objectclass=groupOfNames))
  • User ID map: *:uid
  • Group ID map: *:cn
  • Group member ID map: *:member

Verify that the connection is successful:


Verify the user registry settings:


4. Install IBM Installation Manager 1.5.2
The 64-bit version of Installation Manager checks each package for 64-bit support. If a package does not support the 64-bit version, you receive a warning.
Use a 32-bit version of Installation Manager to install the package.
  • Installation path: /opt/IBM/InstallationManager
Note: http://www-01.ibm.com/support/docview.wss?uid=swg21459143

5. Install IBM Rational Team Concert 3.0.1
This link describes the process of installing the Rational solution for Collaborative Lifecycle Management (CLM) products with IBM Installation Manager.
  • Installation path: /home/jorge/rtc301profile
Note: It is the same installation path that the 32-bit environment. This way we make sure not to change the index location.
Note: The installation is performed using the root user and the CCM context root is /jazz because it comes from a migration from RTC 2.0.x.

6. Change owner and permissions on applications
For example, execute:
$ chown -R jorge:jorge /home/jorge/rtc301profile
$ chmod -R 755 /home/jorge/rtc301profile

7. Deploying applications
This link describes the process of deploying CLM applications on WebSphere Application Server.
The web application files (.war) are copied into:
  • Installation path: /home/jorge/rtc301profile/server/webapps
Note: If WebSphere Application Server is installed in a non-root environment, the user who deploys the CLM applications must have read and write access to the installation directory and all subdirectories.


Note: The clmhelp.war is not deployed in this example.

8. Stop Web services 32 bits environment
Open the WAS administration console, the 32-bit environment, and stop web services.


9. Copy filesystem
You must copy the properties files of the applications, and indexes from the 32-bit environment to 64-bit environment.
Note: Before the copy I recommend making a backup.

10. Start application server and web services 64 bits environment
Open the WAS administration console, the 64-bit environment, and start the application server and the web services.
Note: Make sure the applications are started correctly and that there is no error in the trace files.


11. Check migration
Open the JTS server administration console and verify the status sumary:


Also check the Change and Configuration Management (/jazz) status sumary:


To terminate migration perform the following tests:
- Make entry checks and basic operations with web client
- Make entry checks and basic operations with Eclipse client

Sumary:
Finally we have the new environment set up and ready to work.


As an additional recommendation, you can have the 32-bit environment as a copy of safety precautions for a couple of days to be deleted after a while.

Wednesday, October 2, 2013

Java to UML transformation extensios - Part I

Hi folk, 

In this post, I will show you how to make a Java to UML transformation extension using IBM Rational Software Architect (RSA).

But first, in terms of modeling, what is a transformation?

A transformation is:
  • A mechanism that takes a set of source elements and changes them into a new set of target elements.
  • A set of transforms that you can configure, specify as public in the plug-in manifest file, and run using a transformation configuration.

So, with the transformation extensions you can extend and enhance custom transformations or the transformations that are available in the IBM Rational modeling products.
The transformation framework extensibility is based on the Eclipse plug-in architecture. Transformation extensions are plug-ins that contain the following items:
  • An extension to this extension point: com.ibm.xtools.transform.core.transformationExtensions
  • One or more TransformationExtension elements, which defines the rules, extractors, or transforms that enhance the functionality of the extended transformation
  • One or more ExtendTransform elements, which define the transform to extend  

For example, I'll use two rules and an extractor as show the following image:


- RuleA: select interfaces contains in Java Project
- ExtractorB: extract information from the interface methods
- RuleB: select methods that take input parameters

Concepts:
  • Transformation context: contains the values for all of the parameters of the transformation
  • Source: the initial object, or set of objects, passed into the transformation operation
  • Target container: A reference to the locations where any generated artifacts are located

First thing to check is the packages installations. Run the IBM Installation Manager and be sure that Transformation authoring is selected.

 


Ok, let's get to work.

Procedure to create a Plug-in Project transformation extension:

  1. Open RSA and create a new project. File -> New -> Project...
  2. Select Other -> Plug-in Development -> Plug-in Project and click Next
  3. Write in Project name: org.jif.transform.java2uml and click Next
  4. Write Versión 1.0.0 and in Rich Client Application select No
  5. Click Next
  6. Select Custom plug-in wizard from templates and click Next
  7. Select Transformation Extensions and click Next
  8. In Target transformation ID, select com.ibm.xtools.transform.java.uml.Java-to-UML. Click Next
  9. Insert the 3 transformation elements for the example as shows following image
    • RuleA
    • ExtractorB
    • RuleC
  10. Click Finish
  11. In the Plug-in Manifest Editor (Plug-in Development perspective), click on tab Extensions
  12. Select true in the enabled property in Extension Element Details

Now, we can launch an Eclipse application to set up the test environment for the example.

Procedure to transform Java to UML:
  1. In the Plug-in Manifest Editor (Plug-in Development perspective), click on icon Launch an Eclipse application 
  2. Create a new Java Project. File -> New -> Project...
  3. Select Java -> Java Project and click Next
  4. Write in Project name: Java Program and click Finish
  5. Create 3 classes and 2 Interfaces: 
    • org.jif.test.fix1
      • ClassA
      • InterfaceA
    • org.jif.test.fix2
      • ClassB
      • InterfaceB
    • org.jif.test.fix3
      • ClassC
  6. Define classes and interfaces as:
    • InterfaceA has method getName() and return value as String
    • InterfaceB has method calculate(int val) and return value as int
    • ClassA implements InterfaceA and add a private string attribute name and the override method from interface
    • ClassB implements InterfaceB and add the override method from interface
    • ClassC has method print(String text) and not return value
  7. Open the Modeling perspective
  8. Create a new project. File -> New -> Project...
  9. Select General -> Project and click Next
  10. Write in Project name: UML Project and click Finish
  11. Create a model UML, File -> New -> Model
  12. Select Standard template and click Next
  13. Select General -> Blank Package and in File name: org
    •  The model org, you can delete later. What we need is a model container.
  14. Browse Destination folder and select UML Project
  15. Click Finish
  16. Create a new Transform, File -> New -> Transformation Configuration 
    • Write in Name: java2uml 
    • Select Configuration file destination: Java Program
    • Select the Java to UML transformation
    • Select Protocol: Conceptual
  17. Click Next
  18. We have to set the source and target:
    • Specify the elements that the transformation transforms, inside of Java Project, select src folder
    • Specify the model destination project for the transformation output, select UML Project
  19. Click Finish 
  20. Open the transformation overview with the Transformation Configuration Editor
  21. Click on Extension tab to check if the Java to UML transformation extension is checked
  22. Now, in the Main tab, we can run the extension with the following options checked:
    • Generate UML operations for each Java getter/setter method
    • Generate UML a flat UML package for each Java package
    • Generate a debug log
  23. To see the transformation, create a class diagram and add all UML elements transformed 



Now we have created the skeleton of the transformation, I will now extend the rules and extraction.

Easy right? Now the fun begins

See Java to UML transformation extensios - Part II 

(coming soon, you have to be patient)