Saturday, May 24, 2008

BPM Value Objects - Weblogic

Three BPM packages like com.bea.wlpi.common, com.bea.wlpi.common.security, and com.bea.eci.repository.helper—provide classes, or value objects, for obtaining object data at both definition and run time. For more information about each of these packages, see BPM API.

Each value object shares the following characteristics:
Maintains various BPM server-side objects, including session EJBs (for example, templates, template definitions, and business calendars) and entity EJBs that are used internally. Also allows you to obtain data values from these objects.

Is represented by an individual Java class, the members of which are collectively referred to as values

Is serializable: can be exchanged between client and server overrides the equals() method for testing two objects of the same type for equality, as follows: public boolean equals(Object obj)

Implements the java.lang.comparable interface for comparing two objects of the same type, as follows: public int compareTo(Object obj)

When part of a homogeneous list, a class can be searched and sorted using the following methods:

java.util.Collection.contains(Object o)

java.util.List.indexOf(Object o)

java.util.Collections.sort(List list)

java.util.Collections.sort(List list, Comparator c)


If the natural ordering of an object (as implemented by the boolean compareTo(Object o) method) is based on the same field used by the boolean equals(Object o) method, the following method

int java.util.Collections.binarySearch(List list, Object o)

can be used for rapidly searching a list that was sorted earlier, using the java.util.Collections.sort(List list) method.

Implement the com.bea.wlpi.common.Publishable interface, if the import and export of the object data is supported.

Note: If the importing and exporting of data is supported, the object also implements the com.bea.wlpi.common.Publishable interface. For more information, see Publishing Workflow Objects.

The following table lists the value objects that can be used to access object data.


Value Object To access

com.bea.wlpi.common.BusinessCalendarInfo Business calendar data

com.bea.wlpi.common.EventKeyInfo Event key data

com.bea.wlpi.common.InstanceInfo Workflow instance data

com.bea.wlpi.common.OrganizationInfo Organization data

com.bea.wlpi.common.security.PermissionInfo Permission data

com.bea.wlpi.common.RepositoryFolderHelperInfo XML repository folder data

com.bea.eci.repository.helper.RepositoryFolderInfo XML repository folder data

com.bea.wlpi.common.RerouteInfo Task rerouting data

com.bea.wlpi.common.RoleInfo Role data

com.bea.wlpi.common.RolePermissionInfo Role permission data

com.bea.wlpi.common.TaskInfo Workflow task data

com.bea.wlpi.common.TemplateDefinitionInfo Template definition data

com.bea.wlpi.common.TemplateInfo Template data

com.bea.wlpi.common.UserInfo User data

com.bea.wlpi.common.security.UserPermissionInfo User permission data

com.bea.wlpi.common.VariableInfo Variable data

com.bea.wlpi.common.VersionInfo Version number data

com.bea.wlpi.common.XMLEntityHelperInfo XML repository entity data

com.bea.eci.repository.helper.XMLEntityInfo XML repository entity data


How Creating Value Objects :

To create a value object, use the associated constructor. Each of the BPM value objects described in the table Value Objects, provides one or more constructors for creating object data. The constructors for creating value objects are described in Value Object Summary.

For example, the following code creates an OrganizationInfo object, sets the organization ID to ORG1, and assigns the resulting object to organization.

OrganizationInfo organization = new OrganizationInfo("ORG1");

Tuesday, May 20, 2008

log4j in weblogic 9.2

WebLogic 9.2 and the application's need for log4j-1.2.8.jar file to implement the logger option.The following procedures are give the step by step guidelines to implement the Log4J logger in weblogic 9.2 portal server.

1. Go to folder.
2. Copy the log4j Configuration in to domain folder.
3. In the startWebLogic.cmd that is run when starting the WebLogic Server, the following lines are in the file:

set JAVA_OPTIONS=%JAVA_OPTIONS% -Dlog4j.ignoreTCL=true
-Dlog4j.configuratorClass=com.foo.core.log.ReloadingDOMConfigurator
-Dlog4j.configuration=file://%DOMAIN_HOME%/log4jConfig.xml
set SAVE_JAVA_OPTIONS=

set CLASSPATH=%SAVE_CLASSPATH%;%DOMAIN_HOME%\lib\mylog4j.jar

The mylog4j.jar and the log4j-1.2.8.jar are located in the \lib. WebLogic puts log4j.jar in the classpath before my jars when the server starts.

Open the setDomainEnv.cmd script,located in the BIN directory of your created domain directory. Find the following line in the setDomainEnv.cmd script:
if NOT "%LOG4J_CONFIG_FILE%"=="" (
Add the following two lines immediately before the line specified in the preceding step:
set LOG4J_CONFIG_FILE=%DOMAIN_HOME%\log4jConfig.xmlfor %%i in ("%LOG4J_CONFIG_FILE%") do set LOG4J_CONFIG_FILE=%%~fsiSave the file and exit your text editor. Finally run the setDomainEnv.cmd and startWebLogic.cmd ,the logger will work effectivly....

Wednesday, April 23, 2008

BEA Domain Model - Service-Oriented Architecture (SOA)

Service-Oriented Architecture is an IT strategy that organizes the discrete functions contained in enterprise applications into interoperable, standards-based services that can be combined and reused quickly to meet business needs.

By organizing enterprise IT around services instead of around applications, SOA provides key benefits:

• Improves productivity, agility and speed for both Business and IT
• Allows IT to deliver services faster and align closer with business
• Allows the business to respond quicker and deliver optimal user experience.

BEA’s Domain Model for SOA encapsulates these practices within six domains, each of which must be considered equally to provide a focused framework for a Service-Oriented Architecture.

The six domains, while distinct, are interrelated and interdependent. Executing on each domain with equal focus is fundamental to the success of an enterprise-wide SOA initiative.

The Six Domains—Responding to Challenges Each of the six domains addresses a challenge to successfully delivering a Service-Oriented Architecture.

1. Business Strategy and Process:
Challenge: Providing IT implementations that support the business and its changing needs.
Response: Provide an environment that links the management and measurement of IT with the business strategy and empowers both to work together for continual process improvement.

2. Architecture:
Challenge: Nearly all enterprises fund and build IT by projects in lines of business, leaving enterprise-wide
processes and integration to be considered as afterthoughts and creating barriers to change.
Response: An IT environment based on standards, distribution, loose coupling and business process representation that is designed to respond to change and integrate functionality at an enterprise level.

3. Building Blocks:
Challenge: Lack of consistency and repeatability in IT implementation hinders most enterprises in achieving their goals with respect to IT budgets and agility.
Response: A common, standards-based foundation on which to deliver IT provides a basis to achieve consistency and maximizes the ability to repeat successes through reuse of implementations and core infrastructure.

4. Projects and Applications:
Challenge: IT is traditionally developed by projects within lines of business creating situations where excessive capital is spent duplicating functionality and the integrity of enterprise processes is compromised.
Response: Catalog, categorize, and re-factor functionality offered by the systems and applications in the enterprise to standardize the manner in which that functionality is offered while driving out redundancy and promoting consistency in business execution.

5. Organization and Governance:
Challenge: The organic growth of enterprises through the creation of individual solutions for new requirements yields IT architectures that are difficult and costly to change.
Response: An organizational structure and mandate to govern and standardize the delivery of IT to assure IT business needs and maximizes the use of developed functionality.

6. Costs and Benefits:
Challenge: The cost of IT for the benefit received is a constant source of friction between IT organizations and the business they support.
Response: Plan and execute IT implementations to create early and sustainable value that leverages existing investments in IT while accommodating change and growth.

Friday, April 18, 2008

Message Catalogs

A message catalog is an XML file that contains a collection of text messages. Usually, an application uses one message catalog to contain a set of messages in a default language and optional, additional catalogs to contain messages in other languages.

To create and edit a properly formatted message catalog, use the WebLogic Message Editor utility, which is a graphical user interface (GUI) that is installed with WebLogic Server. To create corresponding messages in local languages, use the Message Localizer, which is also a GUI that WebLogic Server installs.

To access the Message Editor, do the following from a WebLogic Server host:

1. Set the Environment Variables .

WL_HOME\server\bin\setWLSEnv.cmd
2. Run the following command to open the editor
java weblogic.MsgEditor

After that you can create/edit/delete the mesage catalog using this editor.

Wednesday, March 19, 2008

Insurance Domain - Part 2

In this part ,we are going to discuss about the insurance techinical terms.

Insurance :

In law and economics, is a form of risk management primarily used to hedge against the risk of a contingent loss. Insurance is defined as the equitable transfer of the risk of a loss, from one entity to another, in exchange for a premium.

In Simple word,Insurance is nothing but "Transferring Risk from Individual/Group to Insurance Corparate"

Insurance rate :
It's a factor used to determine the amount, called the premium, to be charged for a certain amount of insurance coverage.

Proposer :

Who raise the request to give the Insurance policy is called proposer.

Insurer :

Whos risk is tranfer from him to Insurance company is called insurer.

Proposal :

This is information collected ,for use in reporting to the Insurance Company.

It's a request from proposer to give the insurance policy.

A formal description of the creation, modification or termination of a contract is also called "Proposal". A proposal may serve as the blueprint for a future agreement and may be accepted or rejected by the entity or entities that receive it.

Policy :

Agreement/Contract with the Individual/Group and Insurance Company.This agreenment contains the rules and regulation about the risks.

This policy gives to Insurer,when the proposal process has completed.

Premium :

The periodic payment made on an insurance policy. also called premium.

Nominee :

Whose get the benifits after the death of Insurer/Life Assurer is called nominee.

Frequency :

Frequency is a measure of the number of occurrences of a repeating event per unit time.For ex : Yearly,Half Yearly,Monthly...

Term :

Refers to the maturity or length of time until final repayment on a loan, bond, sale or other contractual obligation.

Beneficiary :

The Beneficiary is the person named by the policy Owner in the Policy/Contract .(or in a Change of Beneficiary form).He can receive benefits upon the death of the insured or the plan participant.

Wednesday, March 12, 2008

Setting Environment Variables

An instruction stored in the MS-DOS environment that controls, for example, how to display the DOS prompt, where to store any temporary files, and the path of directories that DOS searches to find commands. The PATH, COMSPEC, PROMPT, and SET commands in the AUTOEXEC.BAT file all define environment variables.

Environment variables are strings that contain information such as drive, path, or file name. They control the behavior of various programs. For example, the TEMP environment variable specifies the location in which programs place temporary files.

In Windows 95/98/ME, append these lines to the end of your c:\autoexec.bat using notepad, and then reboot your computer:
1. set Temp=%USERPROFILE%\Local Settings\Temp

set TMP=%USERPROFILE%\Local~1\Temp
(Syntax : set variableName=variableValue)

In Windows NT/2000/XP, follow the following steps:
1. Open Control Panel
2. Click the System icon and the window pops up
3. Go to the Advanced pane

4. Click the Environment Variables button

5. There are two seperated windows showing two sets of environment variables. Select the "new" button for the upper window to create a new environment variable.Select the "Edit" button for the upper window to edit an existing environment variable. Probably you need to create the "Temp" and "TEMP" variable, and edit the "PATH" variable.


6. For Example the value of "TEMP" will be %USERPROFILE%\Local Settings\Temp
7. The value of "TMP" will be %USERPROFILE%\Local~1 \Temp.
8. You should add these values to the beginning of your "PATH" variable. If you want to specify any path of the software ,you can set using the path vairable.

For Ex :

set path=C:\Program Files\Java\jdk1.5.0_07;C:\bea\jdk142_05;

The above path specify the path od Java Software.

common predefined environment variables :

Sunday, November 18, 2007

Servlet Interview Questions

Q: Explain the life cycle methods of a Servlet.

A: The javax.servlet.Servlet interface defines the three methods known as life-cycle method.
public void init(ServletConfig config) throws ServletException
public void service( ServletRequest req, ServletResponse res) throws ServletException, IOException
public void destroy()
First the servlet is constructed, then initialized wih the init() method.
Any request from client are handled initially by the service() method before delegating to the doXxx() methods in the case of HttpServlet.

The servlet is removed from service, destroyed with the destroy() methid, then garbaged collected and finalized.


Q: What is the difference between the getRequestDispatcher(String path) method of javax.servlet.ServletRequest interface and javax.servlet.ServletContext interface?

A: The getRequestDispatcher(String path) method of javax.servlet.ServletRequest interface accepts parameter the path to the resource to be included or forwarded to, which can be relative to the request of the calling servlet. If the path begins with a "/" it is interpreted as relative to the current context root.

The getRequestDispatcher(String path) method of javax.servlet.ServletContext interface cannot accepts relative paths. All path must sart with a "/" and are interpreted as relative to curent context root.


Q: Explain the directory structure of a web application.

A: The directory structure of a web application consists of two parts.
A private directory called WEB-INF
A public resource directory which contains public resource folder.

WEB-INF folder consists of
1. web.xml
2. classes directory
3. lib directory


Q: What are the common mechanisms used for session tracking?

A: Cookies
SSL sessions
URL- rewriting

Q: Explain ServletContext.

A: ServletContext interface is a window for a servlet to view it's environment. A servlet can use this interface to get information such as initialization parameters for the web applicationor servlet container's version. Every web application has one and only one ServletContext and is accessible to all active resource of that application.


Q: What is preinitialization of a servlet?

A: A container doesnot initialize the servlets ass soon as it starts up, it initializes a servlet when it receives a request for that servlet first time. This is called lazy loading. The servlet specification defines the element, which can be specified in the deployment descriptor to make the servlet container load and initialize the servlet as soon as it starts up. The process of loading a servlet before any request comes in is called preloading or preinitializing a servlet.


Q: What is the difference between Difference between doGet() and doPost()?

A: A doGet() method is limited with 2k of data to be sent, and doPost() method doesn't have this limitation. A request string for doGet() looks like the following:
http://www.allapplabs.com/svt1?p1=v1&p2=v2&...&pN=vN
doPost() method call doesn't need a long text tail after a servlet name in a request. All parameters are stored in a request itself, not in a request string, and it's impossible to guess the data transmitted to a servlet only looking at a request string.


Q: What is the difference between HttpServlet and GenericServlet?

A: A GenericServlet has a service() method aimed to handle requests. HttpServlet extends GenericServlet and adds support for doGet(), doPost(), doHead() methods (HTTP 1.0) plus doPut(), doOptions(), doDelete(), doTrace() methods (HTTP 1.1).
Both these classes are abstract.

Q: What is the difference between ServletContext and ServletConfig?

A: ServletContext: Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file.The ServletContext object is contained within the ServletConfig object, which the Web server provides the servlet when the servlet is initialized

ServletConfig: The object created after a servlet is instantiated and its default constructor is read. It is created to pass initialization information to the servlet.

What is a servlet?

Servlets are modules that extend request/response-oriented servers,such as Java-enabled web servers. For example, a servlet might be responsible for taking data in an HTML order-entry form and applying the business logic used to update a company’s order database. Servlets are to servers what applets are to browsers. Unlike applets, however, servlets have no graphical user interface.

Whats the advantages using servlets over using CGI?

Servlets provide a way to generate dynamic documents that is both easier to write and faster to run. Servlets also address the problem of doing server-side programming with platform-specific APIs: they are developed with the Java Servlet API, a standard Java extension.

What are the general advantages and selling points of Servlets?
A servlet can handle multiple requests concurrently, and synchronize requests. This allows servlets to support systems such as online
real-time conferencing. Servlets can forward requests to other servers and servlets. Thus servlets can be used to balance load among several servers that mirror the same content, and to partition a single logical service over several servers, according to task type or organizational boundaries.

Which package provides interfaces and classes for writing servlets?
javax

What’s the Servlet Interface?

The central abstraction in the Servlet API is the Servlet interface. All servlets implement this interface, either directly or, more
commonly, by extending a class that implements it such as HttpServlet.Servlets > Generic Servlet > HttpServlet > MyServlet.

The Servlet interface declares, but does not implement, methods that manage the servlet and its communications with clients. Servlet writers provide some or all of these methods when developing a servlet.

When a servlet accepts a call from a client, it receives two objects. What are they?
ServletRequest (which encapsulates the communication from the client to the server) and ServletResponse (which encapsulates the communication from the servlet back to the client). ServletRequest and ServletResponse are interfaces defined inside javax.servlet package.

What information does ServletRequest allow access to?
Information such as the names of the parameters passed in by the client, the protocol (scheme) being used by the client, and the names
of the remote host that made the request and the server that received it. Also the input stream, as ServletInputStream.Servlets use the input stream to get data from clients that use application protocols such as the HTTP POST and GET methods.

What type of constraints can ServletResponse interface set on the client?
It can set the content length and MIME type of the reply. It also provides an output stream, ServletOutputStream and a Writer through
which the servlet can send the reply data.

Explain servlet lifecycle?
Each servlet has the same life cycle: first, the server loads and initializes the servlet (init()), then the servlet handles zero or more client requests (service()), after that the server removes the servlet (destroy()). Worth noting that the last step on some servers is done when they shut down.
How does HTTP Servlet handle client requests?
An HTTP Servlet handles client requests through its service method. The service method supports standard HTTP client requests by dispatching each request to a method designed to handle that request.

when a Servlet doesnt need to call the super.init(ServletConfig) in its init() method
When the servlet directly implements the javax.servlet.Servlet Interface

What is preinitialization of a servlet?

A container doesnot initialize the servlets ass soon as it starts up, it initializes a servlet when it receives a request for that servlet first time. This is called lazy loading. The servlet specification defines the element, which can be specified in the deployment descriptor to make the servlet container load and initialize the servlet as soon as it starts up. The process of loading a servlet before any request comes in is called preloading or preinitializing a servlet.