FlatFiles

What is FlatFile?
 A simple text file having data in text format(non formatted text) is called flatfile , flatfiles are used since the advent of computers in business and still they are used widely.

Two Types of flatfiles we can use in webMethods,
 1. With No record identifier.
2. With record identifier.

1.With No record identifier

 How many different types of flatfiles are there based on record parsing methods?

 Flatfiles can be broadly classified into three different types based on the type of their record parsing methods , these three types are :-
 1)Delimited FlatFile
2)Fixed length FlatFile
3)Variable length FlatFile

 Again Flatfiles can be divided into two different types based on the type of field extractors , these are :-
1)Fixed length
2)Nth field
 In Fixed length extractor type each field is defined by its starting index and end index , in this case the length of the field will be constant for every record.

 In Nth field extractor the field is extracted by the position of the field , such as 0,1,2 . the position starts from 0. This is the most widely used extractor type for the flatfiles because it does not limit the size of the field as in the case of Fixed length extractor.

 Delimited FlatFile :- In these kind of FlatFiles , the records are separated by some kind of delimiters such as newline,pipe(|),tab etc. The field extractor can be any of the two i.e fixed length or Nth field extractor.

 Now we can see Delimited FlatFile with the following screen shots,


 First create a text file with the data like below,
Data in the Text file will be like this,


Before going to create flatfile just look out the definitions of FF dictionary and FF Schema

 Flatfile dictionary:- Flatfile dictionaries are created as namespace elements in the Integration Server and contain definitions of records, composites, and fields. When you change a definition in a flatfile dictionary that is referenced in multiple flatfile schemas, the element definition is updated automatically in all of the flatfile schemas.

 Flatfile Schema:- To communicate using flatfiles, we have to create a flatfile schema that contains a particular flatfile’s structural information, including how to identify records and separate those records into fields.

 Create flatfile dictionary

Right click on folder select new and select Flat File Dictionary


Give name to the dictionary and click finish

Now create a Field definition as per the text file in my assumption i created like this

Right click on field definition and click on new


give name of the first field in my case that is EmpNo like wise create EmpName and salary


we have a composite fields in our text file i.e., Address and it has 2 sub fields(area and city)
So we have to create composite field definition and sub fields for this

right click on composite definition and click on new


Give name to the field and click finish


Now create the sub fields for area and city

Right click on Address and click new



In this select field definition

Give Extractor type as Nth field because here there is no fixed positions in the text file and give names as according to text file data in my case area:city

positions are starts from 0,1,2... and click finish

Now create Record definition meaning you have to give one name to the text file data like in database table name


 for example: employeedetails

And then click on EmployeeDetails then click on new we can see below screen



Already we created the field definition so click on field reference and click next

Select the dictionary which already created and click next


Select the field name which already created in field definition, those will appear in the screen only when you save the dictionary and click next

Give Extractor type as Nth field and positions are starts from '0' and in my case position '0' is EmpNo and '1' is EmpName and so on 

Then click finish

Like field reference select composite reference also which already created in composite definition and click next. 


select address and click next 

give position (continue positions from field reference already i gave 0,1,2 so now giving 3)  and click finish. so the flatfile dictionary is created successfully.


 Now lets see how to create schema

right click on flatfile folder and the click on new flatfile schema and give name then click finish


Select delimiter(most of the cases we use delimiters only) and give the fields as per text document
Record :- Record is seperated by ';' type ';' otherwise if you don't give any record ended then simply give new line.
Field:- Field is ended with ','
subfield:-  is given as ':'
Quoted Release Character :- Quoted release character is used to keep the section of a flat file as it is mentioned in the flat file , any delimiters included within the quoted release character will not be counted.



Then click on FlatFile Structure tab and go to properties browse on set



 And select dictionary then click on next and then finish and save.

and then finish and save.
 Up to above steps flatfile schema is completed successfully.

Now create one flow service and invoke wmpublic----> pub ---> file ----> getfile service



then goto pipeline double click on filename and give fullpath of the file location including name as mentioned above screen shot.

And then click OK.


Again double click on loadAs and select as bytes then click OK

invoke one more service to convert flatfile to document it is located in wmFlatFile ---> pub---->flatFile---->convertToValues service


Then go to pipe line and double click on ffSchema and give full location of ffschema which we created in designer. for eg: Practice.flatfiles:empFFSchema then click ok and then ok.


Now goto pipeline and map bytes to ffdata 

Now run the service like below
Right click and click run as and click run flow service  and one more screen will appears as there is no input like that just click ok.


Now you will get result like below


Will continue record with ID also later....

Get Day in words from a particular date

Take 2 strings, input as 'Date' and output as 'Day'



public static final void GetDayfromDate(IData pipeline) throws ServiceException {
IDataCursor pipelineCursor = pipeline.getCursor();
String dat = IDataUtil.getString(pipelineCursor, "Date");
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
try {
Date dt1 = format.parse(dat);
DateFormat format2=new SimpleDateFormat("EEEE");
 String finalDay=format2.format(dt1);
 IDataUtil.put(pipelineCursor, "day", finalDay);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}


input:---     22/04/2011
outpu:----   Friday

How to give Naming Conventions in webMethods Deployer?

Lots of people knows how to deploy but people don't know what are names we have to give for SET, BUILD, MAP and DEPLOY. Most of the people will give default names like myDeploymentSet1, myBuild1, myDeploymentMap1 and myDeployment1 but these are wrong.


I will explain you how to give names in a wmDeployer.

Project Name: Give the meaningful name which contain Serial number with project name and date.

Deployment Set: Simply name the Deployment Set according to the type of deployment it contains, e.g. IS or MWS. 

Build: A meaningful name would contain a version number for the build. Just see the previous versions of build can exist or not. A new version number is only needed, if you plan to revert to an older version later. If you only have minor changes to deploy, you can simply re-build the existing version.

Deployment Map: You can define mappings for different target servers or groups. Therefore, the target’s name should be contained in the map’s name.

Deployment Candidate: A Deployment Candidate is simply the combination of a Build and a Deployment Map. This should be reflected in the candidate’s name so you can quickly deploy a specific build to a specific target.

Let me Know if anything Wrong... :)

Usage of Copper have more health benefits

Health Benefits of Copper
The health benefits of copper include proper growth of the body, efficient utilization of iron, proper enzymatic reactions, as well as improved health of connective tissues, hair, and eyes. Copper is also integral for preventing premature aging and increasing energy production. Apart from these, regulated heart rhythm, balanced thyroid glands, reduced symptoms of arthritis, quick wound healing, increased red blood cell formation, and reduced cholesterol are other health benefits of copper.
The health benefits of copper are crucial for an overall healthy existence, as this mineral enables normal metabolic process in association with amino acids and vitamins. Copper cannot be produced within the body and therefore needs to be added from external food sources. Copper is the third most prevalent mineral in the body and it is mostly carried by the blood plasma protein, Ceruloplasmin. In order to enjoy the health benefits of copper, it must be included in the daily diet, as it is used up in daily bodily processes.
Symptoms of Copper Deficiency
A deficiency of copper can have the following symptoms in human beings:
Anemia
Low body temperature
Brittle bones
Osteoporosis
Dilated veins
Low white blood cell count
Uneven heartbeat
Elevated cholesterol levels
Low resistance to infections
Birth defects
Low skin pigmentation
Thyroid disorders

Some of the other symptoms include lethargy, paleness, sores, edema, stunted growth, hair loss, anorexia, diarrhea, bleeding under the skin and dermatitis. In infant boys, inherited copper deficiency of the rare Menkes’ syndrome can happen, where natural absorption of copper becomes impossible. Early medical intervention is essential in such cases.

Important Sources of Copper:

Copper is present in various food sources including liver, meat, seafood, beans, whole grains, soy flour, wheat bran, almonds, avocados, barley, garlic, nuts, oats, blackstrap molasses, beets and lentils. Copper also enters the human body through drinking water in copper pipes and by using copper cookware. Oysters are the richest sources of copper in nature. Copper content is lost because of prolonged storage in tin cans and in foods that are high in acid content.

Health benefits of Copper:

Copper plays many important roles in maintaining a healthy body and some of its benefits include:

Arthritis: The health benefits of copper relate to its anti-inflammatory actions that assist in reducing the symptoms of arthritis. The consumer market is also flooded with copper bracelets as well as other accessories for curing this condition. Copper can also work as a home remedy for arthritis; store water in a copper container overnight to accumulates copper traces. These are beneficial in strengthening the muscular system, so drink the water when you wake in the morning. You will feel energized and active for the day, because your metabolism will have a good source of copper for its daily processes.

Proper Growth: Copper is essential for normal growth and health. Thus, it is very important to include this mineral in balanced levels in your regular diets. It is also helpful in the protection of the skeletal, nervous and cardiovascular systems. If you suffer from a copper deficiency, the normal and healthy growth of organs and tissues, as well as their proper oxygenation from an ample red blood cell concentration, would be impossible. Copper deficiencies are seen in many third world countries, and are reflected in the number of birth and growth defects in children of those nations.

Pigmentation of Hair and Eyes: Copper is a vital component of the natural dark pigment, melanin, which imparts coloration to the skin, hair, and eyes. Melanin can be produced by melanocytes only in the presence of the cuproenzyme called tyrosinase, which is derived from copper. Intake of copper supplements also helps in protecting against graying of the hair, so while it is often overlooked as an antioxidant mineral, it does protect the integrity of those cells and keeps you looking young! It also maintains the color of your eyes, and is essential, along with zinc, to keep your eyes beautifully colored into your old age.

Beef3Connective Tissues: Copper is an important nutrient that plays a significant role in the synthesis of hemoglobin, myelin, body pigment melanin and collagen. It helps to protect the myelin sheath surrounding the nerves, and it is also actively involved in the production of elastin, an element of connective tissue that keeps the skin flexible. This also keeps your skin from looking older, by keeping it flexible and less prone to sagging and wrinkles.

Brain Stimulation: Copper is widely known as a brain stimulant, which is why food with a high copper content is often classified as “Brain Food”. However, copper content in the diet has to be in correct proportions, because too much copper is also not healthy for the brain. Copper has a control function to play in the brain, so the amount of copper supplementation has to be balanced. Copper has been associated directly with higher thought processes, particularly in relation to the impact of its transporter protein, Atp7a. Studies have shown a direct link between copper content within the brain and creative or out of the box thinking, showing that copper enables neural pathways to develop in unique ways.

Enzymatic Reactions: Copper is either an element or a cofactor in as many as 50 different enzymes that take part in various biological reactions within the body. These enzymes can function properly only in the presence of copper. Without the enzymatic reactions in our various organ systems, our entire metabolism would slow down and the intricate network of reactions and metabolic pathways would cease to function in harmony. This is specifically important in certain brain pathways, particularly those involving dopamine and galactose.

Utilization of Iron and Sugar: Copper helps in the absorption of iron from the intestinal tract and in the release from its primary storage sites like the liver. It also helps in the utilization of sugar in the body. By helping in the absorption of iron from food and other supplemental sources, copper guarantees a healthy red blood cell count and proper oxygenation of different organ systems. Without a proper supply of iron, people suffer from anemia, also known as iron deficiency, which can be a very dangerous condition resulting in fatigue, muscle ache, digestive problems, and general weakness.

copperinfographicHelps Prevent Premature Aging: Copper is a strong antioxidant, which works in the presence of the antioxidant enzyme superoxide dismutase to safeguard the cell membranes from free radicals. Superoxide dismutase is one of the strongest antioxidants that work within the body in the fight against free radicals. Free radicals attack many different organ systems, but are specifically well-studied in terms of their effect on aging, including wrinkles, age spots, susceptibility to various types of cancer, macular degeneration, and kidney malfunctions. Having enough copper in your daily diet can keep you looking younger for longer!

Increases Energy Production: Copper is essential for the synthesis of adenosine triphosphate, which is an energy storehouse of the human body. The cuproenzyme, cytochrome c oxidase, affects intracellular energy production. It acts as a catalyst in the reduction of molecular oxygen to water, during which the enzyme produces an electrical gradient used by the mitochondria to synthesize the vital energy-storing molecule, ATP. Therefore, when we have enough copper in our bodies, we will have enough functional and accessible energy to get through the day without feeling lethargic or tired.
Bactericidal Properties: Studies have shown that copper can destroy or inhibit the growth of bacterial strains such as E Coli. It also boosts the immune system and prevents excess energy from being expended fighting off the infections.

Thyroid Glands: Copper plays an important role in ensuring the proper function of the thyroid gland. However, excess copper is also a major cause of thyroid malfunction, so you need a very balanced level of copper in the blood, or else hormonal activity will be imbalanced, and you can develop symptoms of either hypothyroidism or hyperthyroidism.

Red Blood Cell Formation: Copper is essential in the production of red blood cells, hemoglobin, and bone matter. This is because copper is partially responsible for the efficient uptake of iron from food sources.

Immunity: Copper is a vital part of the healing process and ensures better wound healing. Copper acts as an extremely good immunity builder, and it also works as a cure for anemia, which will allow your body to both defend itself better and heal itself faster. Copper is a co-factor in various enzymatic processes that result in endothelial growth, or the healing process of tissue.

Reduces Cholesterol: Research studies have shown that copper can reduce the levels of “bad” cholesterol (LDL cholesterol) and help to increase beneficial cholesterol (HDL cholesterol). This lowers the chances of cardiovascular diseases like atherosclerosis, heart attacks, and strokes.

WSDL File Elements Description

The following table describes the basic elements in a WSDL document.

Element
Description
<definitions>
Contains the elements that describe a Web service.
<types>




Contains the type definitions that describe the data that is received and sent by the Web service. The <types> element can reference entire XML Schemas and can contain simple type definitions, complex type definitions, and element declarations. The type definitions and element declarations help define the input and output parameters for the Web service. WSDL uses XML Schema as its native type system.
<message>





Specifies the data that is received and sent by the Web service. A <message> element describes a set of input parameters or a set of output parameters. Each <message> element can contain one or more <part> elements. A <part> element associates a piece of data with a name and a type definition or element declaration. The type definition or element declaration referenced by the <part> element can be defined, declared, or referenced in the <types> element.
<operation>




Specifies the messages that are received and sent by the Web service. Within the <operation> element, the <input> element identifies the message whose parts specify the input parameters to the Web service while the <output> element identifies the message whose parts specify the output parameters of the Web service. Essentially, the operation specifies the signature for the Web service. An <operation> element is declared within a <portType> element.
<portType>

Defines a named set of operations. The <portType> element associates a port type name with a set of operations. A <portType> element can contain multiple operations.
<binding>



Specifies the protocol and message format to use to access the operations in a port type. Each <binding> element can specify only one protocol for a port type; however, a WSDL document can define more than one binding for a single port type. A WSDL document should include one <binding> element for each protocol that it supports.
<port>



Associates a binding with a network address. Together, the binding and network address specify how to invoke a Web service. Each port can specify only one network address for a binding; however, multiple ports can be defined for a single Web service. Port elements are defined within the <service> element.
<service>

Groups ports that can be used to call Web services. A <service> element can contain many ports.