Friday, December 12, 2014

JAVA INSTALLATION / SETUP

Java SE Acronyms: 
 JRE(Java Runtime Environment)
      .required for end users
      .JVM (Java Virtual Machine)
      .runtime libraries
JDK(Java Devlopers Kit)
      .compiler and other developer tools
      .includes JRE

Obtaining and Installing the JDK:
 .Downlod JDK&Documentation
    http://www.oracle.com/technetwork/java/javase/downloads/index.html
 .Install JDK

JDK Configuaration:
  PATH ( Environment Variable)- need to set  path
  rt.jar ( runtime java archive file)-used for java compilation
  Version- switching to another version
   command tools- javac,java,javaw etc..




































Thursday, December 11, 2014

INTRODUCTION TO JAVA


What is JAVA?1. Java is a simple and yet powerful object oriented programming language.
2. Java originated at Sun Microsystems, Inc. in 1991.
3. It was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank,and Mike Sheridan at Sun Microsystems, Inc.
4. It was developed to provide a platform-independent programming language.
5. Java is general purpose programming language we can develop any kind of application.

What is NOT java?
Java is not an HTML and JavaScript.

Java versions and History of java :

1. JDK Alpha and Beta (1995).
2. JDK 1.0 (Jan 23, 1996).
3. JDK 1.1 (Feb 19, 1997).
4. J2SE 1.2 (Dec 8, 1998).
5. J2SE 1.3 (May 8, 2000).
6. J2SE 1.4 ( Feb 6, 2002).
7. J2SE 5.0 ( Sep 30,2004).
8. Java SE 6 (Dec 11, 2006).
9. Java SE 7 (July 28, 2011).
10. Java SE8 (Mar 18, 2014).

The flavors of java are:
Java Standra Edition : Core Language;  compiler,tools and runtimes; basic applications & applets.
Java Enterprise Edition: Enterprise level applications;CORBA;RMI;EJB;Web development( servlets,JSP);Windows messaging;XML.
Java Micro Edition:For devices constraind by memory and/or power( phones,fridz,oven,toaster etc..)

Advantages or Benfits or Features or Key Factors or Capabilities or Design goals of java : 
Since Java is an object oriented programming language it has following features:


1. Simple: Java is a simple language and easy to understand. It contains features of C & C++. It is free from concepts like pointers and does not use headerfiles and preprocessors. Does not support Multiple Inheritance.

2. ObjectOriented: Java supports the basic notions of OOMethodology(Object-Oriented Methodology) in which data is treated as Objects and java code is in modular object oriented units called Classes.
· Encapsulation
· Data Abstarction
· Inheritance
· Polymorphism
· Persistence
These features improve the Reusability of code and Dynamic & Extensability of code.

3. Portable (Platform-Independent): JAVA is called as a platform independent programming language. If you have written some code in JAVA ,then after compilation Byte code will be creted then you can run that code on any platform( Different OS & Processors) .Java works on “Write Once Run Anywhere”.

4. Distributed: Byte code transfer from one machine to another machine and then excutes. Ja va specially designed for internet users which uses the remote computer to execute their programs on local machine after transferring the program from remote computers or either from internet through HTTP or FTP protocols. Java work on variety of plateforms.It provides support for
· Networking :via socket Programming.
· Internet :The widely used protocol such as HTTP and FTP are developed in Java
· Remote Objects : Internet programmers can call functions on above protocols and can get access the files from any remote machine on the internet rather than writing codes on their local system.

5. Interpreted: Javais both compiled and interpreted. The Java Compiler generates bytecode for a JVM(JavaVirtualMachine).A Java Interpreter is needed to execute the bytecode.

6.Robust: It provides Exception Handling, Errorhandling, Memory protection and management.It also provides Extensive compile-time checking. It first checks the reliability of the code before execution. Java puts a lot of emphasis on early checking for possible errors, as java compilers are able to detect many problems prior to execution.


7.Secure: The Java language has built-in capabilities to ensure that violations of security do not occur. Java uses the public key encryption system to allow the java applications to transmit over the internet in the secure encrypted form.
· No memory pointers
· Array index limit checking.
After compilation Java source file is converted into .class file which has binary form which is not a native form of Java.This file is not human readable form,so it becomes more secure.


8. Architectural Neutral: Java sorce code compiled to bytecode which is independent and neutral but can be easily translated into a specificb machine by JVM for that machine. Bytecode can run on anyplatform(with the help of JVM). “Write once run anywhere”.

9. Reusable: With the help of Inheritance we reuse the code i.e all predefined and built in functions of java and classes.

10. Dynamic: Java is both dynamic and extensible. Java classes are stored in separate files and are loded into the java interpreter only when needed. A program dynamically extend itself by loding the classes to expand its functionality.

11. HighPerformance: Java language supports manyhigh-performance features such as multithreading, just-in-timecompiling , and nativecodeusage. Java 1.2 new release of JIT (Just-in-time ) compiler converts the bytecode into native machine instructions on the fly.

12. Multithreading: concept allows the java programming language to do more than one task in a program.Thus Java provides high performance.

13. Automatic Memory Management: Garbage is an object ,that is in a dead state. Automatic memory management, also known as automatic garbage collection.This concept of garbage collection is a approach of allowing the language implementation to keep track of used and unused memory.Here now use is free from the burden of freeing the memory.Garbage collection occurs when one of the following occurs:

· passing null reference
· assign reference of one to another.
· using anonymous object



Example-











In this figure there are two heaps, the first heap contains a=5 & b=7 & the second heap contains a=3 & b=4.In heap2 a reference variable is assigned to that is S1, but in heap1 no reference variable is assigned to those objects. So this object becomes garbage collected.

     Because of Java's robustness, ease of use, cross-platform capabilities and security features, it has become a language of choice for providing worldwide Internet solutions.





















































Saturday, October 25, 2014

Information Gathered from Sources like Trackitt, Murthy and Others places online

http://www.trackitt.com/usa-discussion-forums/h1b/1184157703/new-h1b-using-old-expired-petition

You have a choice. 

a) Apply outside the cap for the remainder of your 6 year limit. You appear to have used just under 3 years already. 

b) Since you have been outside the US for at least a year, you can apply for a new 6 year period, but that will be under the FY2014 cap, which opens in April 2013 for a start date of October 2013. 

This is covered in the USCIS Micael Aytes Memo dated December 5, 2006http://www.uscis.gov/USCIS/Laws/Memoranda/Stati... 



There have been instances where an alien who was previously admitted to the United States in H-1B status, but did not exhaust his or her entire period of admission, seeks readmission to the United States in H-1B status for the "remainder" of his or her initial six-year period of maximum admission, rather than seeking a new six-year period of admission. Pending the AC21 regulations, USCIS for now will allow an alien in the situation described above to elect either 

(1) to be re-admitted for the "remainder" of the initial six-year admission period without being subject to the H-1B cap if previously counted or 

(2) seek to be admitted as a "new" H-1B alien subject to the H-1B cap.

======================
http://www.trackitt.com/usa-discussion-forums/h1b/1455265885/labor-perm-initiated-if-i-don-t-get-h1b-extension-in-time
=======================

Labor/PERM initiated: If I don't get H1B extension in time?

Q) I am working for a global management consulting company and I am in the 6th year of my H1B. My H1B expires in April 2015. My company has just initiated my green card process (obviously its late). The labor/PERM application will be filed by September 2014. 

I am afraid that I may not get a H1B extension, before my H1B expires in April 2015. If I do not get an extension in time then my understanding is: I will have to leave the US in April 2015 and work from a company office outside of the US. In this case: 
(1) When will I be able to re-enter the US? 
(2) Can I re-enter as soon as my labor and I-140 gets approved? 
(3) On what Visa will I re-enter the US? Can I re-enter on L1 visa? 
(4) If I have to re-enter on H1B, then do I have to go through the cap and wait till October 2015 to re-enter? or can I re-enter immediately after Labor & I-140 is approved? 
(5) Will I being outside of the US affect/halt/delay my green card processing? 


Please let me know if you need any additional information on my case. 

Appreciate your advice/help on this matter. Thanks a lot in advance.

A ) You can re-enter US after your I 140 is approved and then employer can file an H1b petition which is cap exempt based in approved I140. There will be no delay in GC as long as the employer is willing to hire you. If you are in US, you can apply for I485 when your date becomes current. Or apply for consular processing if you are outside US.
===

A) 1. After your I-140 is approved, your employer has to apply for H1 extension (cap exempted). You need to get the H1 visa to re-enter US. 
2. No, you cannot re-enter as soon as your I-140 gets approved since you do not have a valid visa. 
3. As stated above in answer 1, your employer can apply for H1 extension based on your I-140 approval since H1 is a dual-intent visa (meaning you can enter with an immigration intent too). I think you can re-enter on L1 visa too, because it would not be related with your GC application process. 
4. If you to re-enter on H1B, as mentioned earlier you need to get the H1 extension stamped and enter with valid visa. You cannot re-enter just on the basis of I-140 approval. 
5. GC is for future job and it is not affected while you are being outside the US.
===

Thanks freedomoflife. 

Just a quick followup question. 

Q) You mentioned in Answer #1 that the H1 extension is cap exempted but what will happen in following scenario: 

My current H1B is expiring in April 2015. If I get Labor/PERM and I-140 approval after my H1B expiry (say in June 2015) and I have left the US in April 2015 (because my H1 expired) and I am working from my company's office outside of the US. Can my company file a cap exempted H1 in June 2015 and bring me back to US immediately? or do I need to file a fresh H1, go through the cap and come back only after Oct 2015?
My thoughts - Lets assume you are going of US by April 2014 but your PERM is still pending. In that case, you will have to wait for either a). PERM/I140 approval for your company to file H1 extension. or b) 365 days PERM pending, for which lets say your company is filing PERM in Sept2014 and still in pending state as of Sept2015, then on the basis of PERM pending for more than 365 days, your company can file for H1 extension - whichever of "a" or "b" is earlier. 
In both cases, you are eligible for extension "not subject to cap". All above mentioned points applies if you are still employed with your current company. So just keep your fingers crossed.

A) Also, for your question: Yes, your employer can file H1 (not subject to cap) immediately after your I-140 approval and get you back in US after the stamping. You do not need to go through a fresh H1 (under cap).

Just a clarification: 

This follow-up question is regarding the point (b) in the post above by "justdoitnow". If my case gets an audit, can I still re-enter US in Sept 2015 on the basis that PERM decision is pending for 365 days since priority date.

to bhagwaro:



yes, you can reenter with a valid H1 extension based on the PERM pending for more than 365 days. you can't just reenter just because your PERM has been pending for that long--you need the H1 extension

==========

H1B stamping without Client Letter

Q)I working as contractor hourly basis at client side, I am planing to visit MUMBAI consulate for VISA Stamping. 

My employer ( who takes care of my salary and VISA stuff along with Green Card, I do have approved I-140 and 1 years H1B exten-All approved.) 
My Vendor ( Who has contract with client and my employer, I am working contractor from my vendor to a client location directly ) 
My Client ( XXXXX is not ready to provide client letter -It is Client’s corporate policy to not sign employment letters for non-employees. That has been the case for several years.) 

My Current manager (Vendor) who has signed contract with my client is saying following. 

Here is what he is planing do in place of the letter: 
- He will write a letter explaining your employment for Vendor @ Client 
- He will provide the original SOW 
- He will provide the original Purchase Order 
- You’ll need to take photo copies of the front and back of your Client badge 
- You’ll need to take photos of your work space at Client 
- You’ll need to print copies of all timecards up until the day you leave 
- A screenshot of yourself in the Client online directory 
- Print out of correspondence with your Client email address included, ideally regarding project 

Please guide me whether I should plan for India trip on the above documents ? is it sufficient to avoid 221(g) or any blockage.

===

OP says he can not get client letter so no point saying you "have" to get it. 

Get a letter from manager that company can not provide as it is not their policy. Or they can provide if requested by consulate. Please make sure your manager provides his name, designation, complete contact information. 
Please prepare a list of contacts of your manager, colleagues and your employer. phone numbers e-mails etc. Also org chart of your team in client company. 
get a picture of yourself in front of office building or your name in office directory (web). This may not be allowed at some client sites. 
Print time sheets if you fill them at client site. Make sure your complete name gets displayed. Carry your badge to interview if possible and allowed. 
You need to justify why you can not provide client letter. At the same time provide proofs that you work there. 

In my case I had a client letter but that was written badly. So I got 221g. luckily resolved in 10 days. I also had all supporting docs but visa officer wouldn't let me give them to him. So be prepared. since no client letter make sure you have a copy of LCA indicating location of work, wage etc. VO will most likely ask for it. 

all the best!

===

H1-B Extension Denied after RFE, I-94 Expired, New LCA

Hello Everyone, 

Any insights on my case would be really helpful. My I-94 expried on Sept 30, 2014. My Consulting company filed for my H1B Extension on Sept 7th 2014, got RFE on Oct 7th and it got denied on Oct 20th, 2014 after RFE submission. During this process, my contract ended with client and I was out of job. 

What are my options to stay in status? If i get a new job, can my employer file for a new LCA when I am still out of status? My husband in on OPT, can I transfer to F2 dependent as well if I can't file for a new LCA? 

Any information will be very helpful. Thank You!
A) Once denied, your out of status starts, the soon you file H1, the better. Mostly you get approved H1B with consulor processing, it can avoid if you applied in lesser time to consider by USCIS. You can not be on F2 as your spouse already in EAD, it means no dependency for that. Hope for best
======





My H1B got over last monday (Oct 13th, 2014). My wife is on H1B though and had filed for a CoS (Change of Status) through her employer 10 days before my end date. They failed to file it on time and are now saying they cannot as I am no more on a valid status. They are asking me to go back to India. 

My question is - 
1) How many days do we have to file for CoS even after my H1B has got over? (She intends to push her employer in case there is time) 
2) Can she file for CoS on her own or through a lawyer? 
3) What is the best option left for me? (Going back to India is the last thing i want to do) 

A) Yes, You can file today online on your own. dont wait for too long. It is very easy process. i have done it couple of years back 

https://elis.uscis.dhs.gov/cislogin/CISControlle...=


Wednesday, July 23, 2014

INVESTMENT ON GOLD

                                                             GOLD INVESTMENT



Gold

Gold is one of the chemical elements. Gold's chemical symbol is Au and its atomic number is 79. Its chief characteristics are that it is inert and malleable. Inert means gold does not interact with other chemicals or compounds. Gold doesn't tarnish and even the strongest acids have no effect. Thus, gold lasts forever - and stays shiny the whole time!

Gold Coins



Gold Biscuits


Gold has many industrial uses, but its main historical uses have been for jewellery and money - both are a store of value. Gold has been used as a store of value for at least 5000 years. Gold is measured and prices are quoted in Troy Ounces and Grams. As an example of gold's ability to store value, 2000 years ago one ounce of gold would buy a fine man's outfit. Today one ounce of gold will still buy a good quality man's wool suit with enough left over to buy a few shirts, a tie, some underwear, socks, a pair of shoes and a belt!

Gold has been called a "barometer of fear." When people are anxious about the economy - they turn to gold and bid the price up. The two main things that make people anxious are deflation and inflation. Most think that deflation is "falling prices" and inflation is "rising prices." Actually, rising and falling prices are symptoms. The root causes are decreases (deflating) or increasing (inflating) of the money supply. Gold has the remarkable ability to store value in both deflationary and inflationary times.

The correct way to think about owning gold is as insurance. Gold is a store of value virtually independent of economic conditions. Unlike shares of a company or government bonds - gold will always retain value. Gold's most important use is insurance against the paper (fiat) currency of the country you live in. Almost every country has had at least one major "currency crisis" over the last one hundred years. Those that had some of their wealth in gold survived. Unfortunately many people saw their saving become worthless - sometimes in a matter of days.

So, think of gold as insurance. Do not think of gold as a way to "make money." Do not try and "time the market." It is better to buy gold in small amounts regularly, every month for example, over a period of time.The percentage of your total wealth devoted to gold is a personal decision and depends on your particular situation. A conservative goal would be ten percent. In times of uncertainty the percentage should be much higher.

Do not worry about selling gold when that time comes. Gold is recognized and valued everywhere in the world. It is easier to sell gold than to buy gold! Of course gold can be used in barter or trade as it has for thousands of years.

To summarize, gold is an insurance policy against economic uncertainty. Gold can protect against both deflation and inflation. Everyone should store some of their wealth in gold if at all possible.


   













Tuesday, July 22, 2014

Breast Cacer Awareness ------------ HELPING WOMEN NOW

                           BREAST CANCER AWARENESS



                                                               
Pink Ribbon



What is breast cancer?

Breast cancer is a malignant tumor that starts in the cells of the breast. A malignant tumor is a group of cancer cells that can grow into (invade) surrounding tissues or spread (metastasize) to distant areas of the body. The disease occurs almost entirely in women, but men can get it, too.
The normal breast
To understand breast cancer, it helps to have some basic knowledge about the normal structure of the breasts, shown in the diagram below.
The female breast is made up mainly of lobules (milk-producing glands), ducts (tiny tubes that carry the milk from the lobules to the nipple), and stroma (fatty tissue and connective tissue surrounding the ducts and lobules, blood vessels, and lymphatic vessels).
Most breast cancers begin in the cells that line the ducts (ductal cancers). Some begin in the cells that line the lobules (lobular cancers), while a small number start in other tissues.
Benign breast lumps
Most breast lumps are not cancerous (benign). Still, some may need to be biopsied (sampled and viewed under a microscope) to prove they are not cancer.

Fibrosis and cysts

Most lumps turn out to be caused by fibrosis and/or cysts, benign changes in the breast tissue that happen in many women at some time in their lives. (This is sometimes called fibrocystic changes and used to be called fibrocystic disease.) Fibrosis is the formation of scar-like (fibrous) tissue, and cysts are fluid-filled sacs. These conditions are most often diagnosed by a doctor based on symptoms, such as breast lumps, swelling, and tenderness or pain. These symptoms tend to be worse just before a woman's menstrual period is about to begin. Her breasts may feel lumpy and, sometimes, she may notice a clear or slightly cloudy nipple discharge.

Fibroadenomas and intraductal papillomas

Benign breast tumors such as fibroadenomas or intraductal papillomas are abnormal growths, but they are not cancerous and do not spread outside the breast to other organs. They are not life threatening. Still, some benign breast conditions are important because women with these conditions have a higher risk of developing breast cancer.

Symptoms of Breast Cancer

Initially, breast cancer may not cause any symptoms. A lump may be too small for you to feel or to cause any unusual changes you can notice on your own. Often, an abnormal area turns up on a screening mammogram (X-ray of the breast), which leads to further testing.
In some cases, however, the first sign of breast cancer is a new lump or mass in the breast that you or your doctor can feel. A lump that is painless, hard, and has uneven edges is more likely to be cancer. But sometimes cancers can be tender, soft, and rounded. So it's important to have anything unusual checked by your doctor.
According to the American Cancer Society, any of the following unusual changes in the breast can be a symptom of breast cancer:
  • swelling of all or part of the breast
  • skin irritation or dimpling
  • breast pain
  • nipple pain or the nipple turning inward
  • redness, scaliness, or thickening of the nipple or breast skin
  • a nipple discharge other than breast milk
  • a lump in the underarm area
These changes also can be signs of less serious conditions that are not cancerous, such as an infection or a cyst. It’s important to get any breast changes checked out promptly by a doctor.

                                                           I hope it will help you

PRANAYAMAM



                                                  Health is Wealth

Tuesday, April 29, 2014

Improve Performance of WebSphere Operational Decision Management (WODM) modules

Improve Performance of WebSphere Operational Decision Management (WODM) modules Technote (FAQ) Question How do I improve the performance of WebSphere Operational Decision Management modules? Answer WebSphere Operational Decision Management has various modules whose performance can be improved. The following documents specify how to improve the performance when working with each module: • Improve Performance of Rule DesignerImprove Performance of Decision CenterDesign Events for performance in Event DesignerImprove Performance of rule execution and Rule Execution ServerImprove Performance of Decision Validation Services and Decision Warehouse Related information Clustering JRules

How to check for null values in ruleset to prevent NullPointerExceptions during the rule execution?

Question How to check for null values in ruleset to prevent NullPointerExceptions during the rule execution? Cause Checking for null values and initializing them is a necessary step in the implementation of a ruleset, because input objects might be null or contain null values. For any Java application, rules developers must implement checks for null values on the objects used in the application (within rules in the case of JRules) to avoid potential NullPointerExceptions (NPEs) such as the following: Exception in thread "main" An exception IlrUserRuntimeException has been thrown: Target method: public int java.lang.String.indexOf(java.lang.String) at condition part of rule 'test.myRule' at call to 'main#myTask rule task body' at call to 'main flow task body' at call to 'execute' Target exception stack trace: java.lang.NullPointerException: null object when invoking public int java.lang.String.indexOf(java.lang.String) at ilog.rules.inset.IlrExecMethodValue.getValue(Unknown Source) at ilog.rules.inset.IlrExecBinaryTest.evaluate(Unknown Source) at ilog.rules.engine.o.evaluate(Unknown Source) at ilog.rules.engine.IlrDiscMem.if(Unknown Source) at ilog.rules.engine.IlrSingleDiscMem.k(Unknown Source) at ilog.rules.engine.IlrCustomDiscMem.f(Unknown Source) at ilog.rules.engine.IlrAlphaMem.new(Unknown Source) at ilog.rules.engine.IlrRuleMem.T(Unknown Source) at ilog.rules.engine.IlrAgenda.a(Unknown Source) at ilog.rules.engine.IlrEngine.fireAgendaRules(Unknown Source) at ilog.rules.inset.IlrExecRuleTask.a(Unknown Source) at ilog.rules.inset.IlrExecRuleTask.execute(Unknown Source) at ilog.rules.inset.IlrExecTask.run(Unknown Source) at ilog.rules.engine.IlrTaskEngine.execute(Unknown Source) at ilog.rules.inset.IlrExecTaskInstance.execute(Unknown Source) at ilog.rules.engine.IlrTaskEngine.executeItem(Unknown Source) at ilog.rules.engine.IlrTaskEngine.executeSubFlow(Unknown Source) at ilog.rules.inset.IlrExecFlowTask.execute(Unknown Source) at ilog.rules.inset.IlrExecTask.run(Unknown Source) at ilog.rules.engine.IlrTaskEngine.execute(Unknown Source) at ilog.rules.inset.IlrExecTaskInstance.execute(Unknown Source) at ilog.rules.engine.IlrTaskEngine.executeItem(Unknown Source) at ilog.rules.engine.IlrTaskEngine.if(Unknown Source) at ilog.rules.engine.IlrTaskEngine.a(Unknown Source) at ilog.rules.engine.IlrContext.a(Unknown Source) at ilog.rules.engine.IlrContext.execute(Unknown Source) at ilog.rules.studio.launching.main.IlrMain.main(IlrMain.java:184)


 Objects used in the rules are either input parameter objects or objects that have been inserted in the working memory. The rule developer must check that none of the input parameters are null, unless they are of a Java primitive type.

 Indeed, if a parameter 'customer', verbalized as 'the customer' and of type test.Customer, is null and a rule author writes the following condition:

 if the age of the customer is more than 21

 It translates in IRL (ILOG Rules Language) into the following statement, and produces an NPE on 'customer.age' because 'customer' is null: evaluate (customer.age > 21);

On the other hand, null objects are not inserted in the working memory, so they will never be bound in the rules. Therefore, the rule developer does not have to check if the working memory objects themselves are null. Whether the object used in a rule is a parameter or a working memory object, the rule developer must check for nulls on its attributes and method return values of the following types:

• Java wrapper types (i.e. java.lang.Integer, java.lang.BigDecimal...)
• java.lang.String
• Custom types

 Only values of Java primitive types such as int and float cannot be null and therefore do not need to be checked. Note that even if an attribute is found on the right-hand side of a comparison, it might generate an NPE if it is null. This can be due to the automatic unboxing of Java wrapper types, see the documentation for JRules 7.1 at Rule Studio > Optimizing execution > Run-time efficiency > Autoboxing. For example, the following condition: if the age of the customer is less than the age limit of the exam Is translated as follows in IRL: evaluate (person.age > exam.ageLimit.intValue()); Where 'ageLimit' is a java.lang.Integer implicitly unboxed to its Java primitive type 'int' to allow the comparison to 'age' which is of type 'int'. This is the same mechanism used in Java 5 when comparing a primitive type and its wrapper type. Answer The check for null values can be performed before any rule is executed or while the rules are being executed. In any case, because the notion of null value is a technical concept, the task of checking for nulls must remain in the hands of the rule application developer. It should not be the responsibility of rule authors when they are writing rules, as they are likely to be business analysts for whom the notion of null values is abstract. Therefore, the check performed during the rule execution must be done implicitly: rule authors write the phrases that make sense to them from a business point of view and have checks for nulls performed in the background at execution time. "is null"/"is not null" operators are available in BAL rules, but are not valid or available for all types. Again, business users might not know programming concepts such as null values and the order of test evaluations to use them. In addition, rule authors would not be able to fully rely on the order in which the conditions are written in an 'and' clause, to know the order in which they will be executed. That is explained in this other technote. They could not be sure that the check for null values is executed before other tests that can potentially generate NPEs. To check for nulls in the ruleset, before the rules are executed, you do the following: • use the initial actions of the ruleflow. To check for nulls while the rules are being executed, you can do the following: • use testers on BOM objects, • override operators, • override BOM getters & methods. The choice of a solution will depend on the application and its requirements. Overriding operators might be less time consuming because it applies to both ruleset parameters and working memory objects. The other methods might be more tedious if the Business Object Model (BOM) contains numerous and complex classes. On the other hand, the method of overriding operators to consider a condition 'false' if any of the data is null, only prevents potential NPE in the condition. However, it does not prevent getting NPEs in the action part of the rule ('then' or 'else'). The use of the initial actions, if you choose to continue the execution, does not cover the case when values become null during the rule execution, either through some rule actions or an external application. Most methods offer the possibility to set the null value to a default non-null value and go on with the execution or evaluation, while other possibilities are to choose not to execute the ruleset (initial actions), not to use the object in rules (tester), or have the condition return false (overriding operators), whenever a value is null. : 1. Using the initial actions 2. Using testers on BOM classes 3. Overriding operators 4. Overriding BOM getters & methods To see the sample projects, extract the content of the attached zip file in one folder and import all projects in a new workspace. Refer to the readme.txt inside each project for instructions on how to test the scenario that illustrates the approach to test for null values. -------------------- 1. The initial actions of the ruleflow are edited in the start node. The test is written in IRL code, either directly in the Initial Actions or in one or more ruleset functions called there. The test goes through the ruleset input parameters (using getParameterValue(...)) and/or the objects present in working memory (usinggetObjects(...)). See the IlrContext API documentation for information on those two methods. See the JRules 7.1 documentation at Rule Studio > Orchestrating ruleset execution > Working with ruleflows > Adding initial actions and Rule Studio > Creating rule projects > Creating a function on how to set initial actions and use a function to write the IRL code. This method allows to check if any attribute or method return value is null, or if the parameters themselves are null, in order to initialize the attributes and parameters, or choose not to execute rules by exiting the ruleflow. The last option is the most reliable option to prevent any NPE, because the fact that a method returns null can not be altered at that point. In any case, this method cannot prevent the fact that values may become null later during the rule execution, either through some rule actions or an external application. The project "initial-action-approach" in the attached zip archive illustrates this approach. 2. In this approach, the rule developer adds a tester to the BOM class to perform the check for null values in order to ensure that only objects without null attributes nor methods returning a null value are bound in the rules. Whenever an object is bound in a rule and that the corresponding BOM class has a tester, the latter is analyzed to determine if the object instance is eligible. In this case, it depends on whether or not it contains null values. The tester function returns 'true' if the instance is eligible to be bound to a rule instance, and 'false' otherwise. If the tester returns 'false', the object is not bound in a rule instance. This prevents a potential NPE during the execution. For example if the BOM contains a test.Customer class with one attribute, 'name', of type java.lang.String, the following tester should be added to the test.Customer BOM class: return this.name != null; In the case of attributes, you could alternatively choose to initialize nulls to default values based on your own criteria and have the tester return 'true'. For more information on testers, see section Rule Studio > Creating rule projects > Defining how business elements map to the XOM > Mapping classes > Adding tests to filter out class instances of the JRules 7.1 documentation. This method handles objects inserted in the working memory. If your ruleset also has parameters of a BOM type, you could choose to insert those into the working memory in the initial actions of the ruleflow. You must then not verbalize these parameters so that your rules only bind them from the working memory using automatic variables (see section Rule Studio > Writing rules > Automatic variables of the JRules 7.1 documentation). This allows to use the tester of the corresponding BOM classes to check for null values on those parameters as well. The project "tester-approach" in the attached zip archive illustrates this approach. 3. Here, the rule developer overrides basic operators on numbers and strings by creating static virtual BOM methods (for example on an utility class ) with the corresponding parameters and give them the verbalization of those operators. For example, to override the "is less than" operator for numbers, the BOM method would look as follows: sample.NumberUtility.isLessThan (java.lang.Number, java.lang.Number) This method woud be verbalized as follows: {0} is less than {1} The verbalization is key to allow the new BOM method to be called in place of the default operator in the IRL code, without rule authors having to change the way that they write the rule. For example, the following condition: the age of the customer is less than the age limit of the exam would be translated as follows in IRL: evaluate (sample.NumberUtility.isLessThan(person.age , exam.ageLimit)); instead of evaluate (person.age > exam.ageLimit.intValue()); This gives the possibility to test if the values evaluated are null, with the following BOM to XOM code for the method sample.NumberUtility.isLessThan(...): if(number1 != null && number2 != null){ return number1.doubleValue() < number2.doubleValue(); } return false; To know more about the BOM to XOM mapping, see the documentation at Rule Studio > Creating rule projects > BOM and XOM for JRules 7.1. See the section Rule Studio > Creating rule projects > Defining a vocabulary > Editing and creating phrases > Editing a phrase of the JRules 7.1. documentation for how to modify the method verbalization. This method requires to override all operators of Numbers to check for null values on both sides of the operation, because of the possibility of auto-unboxing, and all operators of String (except "is null"/"is not null" or "is one of"/"is not one of") to check for null values on the left hand side of the comparison. The project "operator-overriding-approach" in the attached zip archive illustrates this approach. 4. The rule developer overrides getters and methods of the BOM by writing BOM to XOM (B2X) code to test the value before returning it to the rule execution. For example if the BOM contains a test.Customer class with one attribute, 'name', of type java.lang.String, the following B2X code for the getter could be: if (this.name!=null) return this.name; else return ""; Every time the attribute is read, whether it is on a parameter or on a working memory object, and whether it is in the condition part, action part or another part of the rule, a null value is replaced with "" to avoid any NPE. To know more about the BOM to XOM mapping, see the documentation at Rule Studio > Creating rule projects > BOM and XOM for JRules 7.1. This method requires to write B2X code for all verbalized BOM getters (plus corresponding getters) and methods returning a value. The only possibility here is to return a default non-null value if a null value is found.