Search TWGer

Tuesday, August 4, 2009

JBPM 4.0 configuration for Eclipse workspace


During my JBPM exploration, I have encountered lot of difficulties in finding correct configuration information. Configuration issues makes you spend/waste more time which you could use more effectively to understand JBPM API. Here I am providing simple steps to configure your eclipse and run simple JBPM flow.

1. Download JBPM bundle from http://www.jboss.org/jbossjbpm/jbpm_downloads/

2. Extract the zip file to folder C:\JBPM-4.0 (I am assuming this as JBPM home directory you may name different)

3. To configure or work with JBPM it is necessary to have database and schema created for JBPM. Assuming you have database (any) installed (here I am considering mySQL database)

4. Create database jbpm4 in mySQL

5. Modify file C:\JBPM-4.0 \db\jdbc\mysql.properties so that it contains your database properties as below

jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/jbpm4
jdbc.username=root
jdbc.password=admin123

6. Launch the following command:

C:\JBPM-4.0\db>ant -Ddatabase=mysql create.jbpm.schema

This should create JBPM tables in your database. And to add some sample data to the tables run following command

C:\JBPM-4.0\db>ant -Ddatabase=mysql load.example.identities

Those not having ant installed or not familiar with. Follow steps below.

a. Download latest version of ant from http://ant.apache.org/ .
b. Add bin directory of you ant installation to your path
c. Set the ANT_HOME environment variable to the directory where you installed Ant.
d. Optionally, set the JAVA_HOME environment variable. This should be set to the directory where your JDK is installed.
e. Type C:/>ant –version to verify the installation

Now you have to configure the location of your JBOSS server.

7. Download JBOSS version 5.0.0.GA stable version from http://www.jboss.org/jbossas/downloads/

8. Extract bundle, it should create JBOSS-5.0.0.GA

9. Modify build.xml file in jboss directory of JBPM home. Change jboss.home and jobss.version property as

property name="jboss.version" value="5.0.0.GA"
property name="jboss.home" value="C:\jboss-5.0.0.GA"



10. Run following command on your command prompt

C:\JBPM-4.0 \jboss>ant -Ddatabase=mysql install.jbpm.into.jboss

above should create a "jbpm" folder in your JBoss deploy directory


Now we are ready to move to IDE to try out some sample application using Eclipse platform.

If your eclipse does not have JBPM graphical designer following are the steps.

a. Start your eclipse, go to Help--> Software Updates -- > Available Software Tab -- > Click Add Site -- > In Add Site dialog box Click Archive
b. Select JBPM-4.0\gpd\jbpm-gpd-site.zip and click Open then OK.
c. Check newly added archive and click “Install” button.
d. Restart your eclipse IDE.

Above steps will install JBPM Graphic Designer plugin in your eclipse IDE. This did not work very well for me. I was getting out of memory error during the process in my Gynemade eclipse. You may want to close and start your eclipse with following command might help.

eclipse -vmargs -Xmx1024M

Create New Project in your eclipse IDE. Press Cntl + N or File -- > New …



Click Next -- > specify JBPM home directory and provide some meaningful name for the JBPM runtime -- > Click Next -- > OK


You will see Project created in your workspace as


-->
You will see multiple packages created in your workspace such as src/main/java, src/main/config, jpdl etc. I do not need to explain what is that for package name of the packages tells what is what.

Now lets create new New jpdl file.





Double click test.jpd.xml and create your first process using component tools on the left side of the graphical editor.



Click Source tab to view or modify xml for the test.jpdl.xml file. Add class name and method name for the Java task we defined in the graphical editor. You can also specify class attribute in the property pane of the IDE.

(Click on image for clear view of the text)



Also, create class Test.java in package com.test



--> Create another class name JBPMTest.java to test the process flow we have designed above in the same package com.test


Before you go further make sure you have your jbpm.cfg.xml and jbpm.hibernate.cfg.xml file in your bin directory



For now keep your jbpm.cfg.xml to the minimum as...



-->
And your jbpm.hibernate.cfg.xml file having entry for your mysql database details as



Run JBPMTest as a java application. You should see your first JBPM flow working in the console as below. Of course to understand JBPM more you need to read JBPM API documentation here … http://docs.jboss.org/jbpm/v4.0/javadocs/index.html?org/jbpm/api/IdentityService.html



Cheers!!!

Thursday, February 12, 2009

Introduction to Enterprise Architectures and Frameworks


-->
This article provides a brief and high-level introduction to some of the key concepts behind enterprise architecture and introduction to popular architectures. There are many different definitions available for the term enterprise architecture. Confusion also arises from the evolving nature of the term “Enterprise”, in this article I will try to simplify the meaning of confusing concepts of enterprise IT architectures and frameworks.
Enterprise?
A common definition of "enterprise" in this context is any collection of organizations that has a common set of interests or a single bottom line. Considering that, an enterprise can be a whole corporation, a division, department, or multiple branches of organization locateid at different locations linked together by common ownership or interest. Scope of the term enterprise widen frequently as it includes partners, venders and its customers. This type of enterprise usually falls under umbrella “Extended enterprise” where goal is to incorporate all the links with mutual interests.
Enterprise Architecture
Enterprise architecture has become a key component of the information technology governance process in many organizations. The Enterprise architecture (EA) describes how the elements of an organization fit together – the business process, organizations responsible for them, information technology capabilities and infrastructure.
The definition of an architecture used in ANSI/IEEE Std 1471-2000 is -
"The fundamental organization of a system, embodied in its components, their relationships to each other and the environment, and the principles governing its design and evolution."

Enterprise architecture is a formal description of an information system, organized in a way that supports reasoning about the structural properties of the system. It defines the components or building blocks that make up the overall information system, and provides a plan from which products can be procured, and systems developed, that will work together to implement the overall system. It thus enables you to manage your overall IT investment in a way that meets the needs of your business.
Good enterprise architecture enables corporate to achieve the right balance between IT efficiency and business innovation. It allows individual business units to innovate safely in their pursuit of competitive advantage. At the same time, it assures the needs of the organization for an integrated IT strategy, permitting the closest possible synergy across the extended enterprise.
Why Architecture?

The fundamental reason for budding an enterprise architecture is to support the business by providing the technological and process structure for an IT strategy.
Good enterprise architecture can yield following important benefits to the enterprise.
    • Lower software development efforts, and maintenance costs
    • IT applications portability
    • Enhanced interoperability and network management
    • Improved security for enterprise applications
    • Easier upgrade and exchange of system components
    • Reduced complexity in IT infrastructure
    • Maximum return on investment in existing IT infrastructure
    • The flexibility to interface with vendors and customers
Layers of Enterprise Architecture

Contemporary federal guidance suggests thinking about “layers” of the enterprise architecture
  • Business processes and activities
  • Applications such as custom or off-the-shelf software tools
  • Data that must be collected, organized, safeguarded, and distributed
  • Technology such as computer system and telephone networks
Figure 1.1 – Layers of Enterprise Architecture



Elements of Enterprise Architecture
Enterprise architecture primarily includes following elements
· a baseline architecture
· a target architecture
· a sequencing plan
A baseline architecture as a set or architecture depicts the existing enterprise, the current business practice, and the technical infrastructure. It is usually an architecture currently followed by theenterprise. In case of new enterprise it has to be formally designed to show the existing infrastructure including business domain and technical capabilities.
The target architecture the set of products that portray the future or end-state enterprise, generally captured in the organization’s strategic thinking and plans. It is commonly referred to as the ‘To-Be’ architecture. They are the graphics, models, and/or narrative that depict the enterprise environment and design. The sequencing plan is the documentation provided describing the transition from the current baseline architecture to the target architecture. It usually contains inter-related activities and changes that will evolve the enterprise.
Figure 1.2 – Elements of Enterprise Architecture

Framework
An architecture framework is a means which can be used for developing a wide range of different architecture designs. It should describe a scheme for designing an application in terms of a set of building blocks, and for showing how the building blocks work together. It should also include a list of recommended standards and design patterns that can be used to implement the fundamentals of the business process.An enterprise architecture framework identifies and organizes the different type of information into a logical structure, and explains the relationships among the information types and sources. The categorization of information leverage thinking about the architecture and how components fits together. Framework also helps identifying business entities needed to describe enterprise architecture and linkages between them.
There are numerous frameworks available to ensure enterprise architecture design, few of them summarized below.
Zachman framework
Originally conceived by John Zachman at IBM in the 1980s, the Framework is often referenced as a standard approach for expressing the basic elements of enterprise architecture. Zachman framework is organized as schema of six columns and five rows. The columns are based on the six interrogatives what, how, where, who, when, and why leading to column titles of data, function, network, people, time, and motivation. The five rows represent the views of users of the EA - the planner, owner, designer, builder, and subcontractor (Figure 1.3)

Guide to the (Evolving) Enterprise Architecture Body of Knowledge-EABOK
-->
Federal Enterprise Architecture Framework (FEAF)

The 1999 Federal CIO Council-sponsored Federal Enterprise Architecture Framework (FEAF) defined eight framework components: architecture drivers, strategic direction, current architecture, target architecture, transitional processes, architectural segments, architectural models, and standards. The strategic direction guides the development of the agency target architecture and includes the agency vision, principles, and goals and objectives. The architectural models define the business, data, applications, and technology architectures. The models are strongly based on the Zachman EA Framework and Zachman provided description of what should be in the models for the FEAF publication.
DoD Architecture Framework (DODAF)
The Department of Defence Architecture Framework (DODAF) was originally developed as the Command, Control, Communications, Computers, Intelligence, Surveillance, and Reconnaissance architecture framework.
The DODAF ‘defines a common approach for DoD architecture descriptions can be compared and related across organizational boundaries, including Joint and multinational boundaries. The DODAF defines a common approach for DoD architecture description development, presentation, and integration. The framework is intended to ensure that
The Open Group Architectural Framework (TOGAF)
The TOGAF was developed by consensus among members of The Open Group. TOGAF 8 Enterprise Edition provides an Architecture Development Method (ADM) as part of a framework for developing an enterprise architecture.
As described on the TOGAF web site there are four main parts to the TOGAF document.
PART I - Introduction … provides a high-level introduction to some of the key concepts behind enterprise architecture and in particular the TOGAF approach.
PART II - Architecture Development Method is the core of TOGAF. It describes the TOGAF Architecture Development Method - a step-by-step approach to developing an enterprise architecture.
PART III - Enterprise Continuum describes the TOGAF Enterprise Continuum, a virtual repository of architecture assets, which includes the TOGAF Foundation Architecture, and the Integrated Information Infrastructure Reference Model.
PART IV - Resources comprises the TOGAF Resource Base - a set of tools and techniques available for use in applying Guide to the (Evolving) Enterprise Architecture Body of Knowledge-EABOK
-->TOGAF and the TOGAF ADM


References -
http://www.mitre.org/
http://www.opengroup.org
Guide to the (Evolving) Enterprise Architecture Body of Knowledge-EABOK
-->