To create an EIP croquis, select *File > New > Petals > Croquis*.
!petals-studio-creating-eip-croquis-1.jpg!
\\
Select the croquis type and choose *EIP chain*.
Type in the file name and the croquis title.
!petals-studio-creating-eip-croquis-2.jpg!
\\
Click *Finish*.
It results in an EIP diagram (a _peip_ file), open in the default editor.
!petals-studio-creating-eip-croquis-3.jpg!
h2. Editing an EIP diagram
The editor is made up of two areas:
* The _drawing area_, which contains the visual representation of the EIP chain elements.
* The _palette_, which contains the elements that can be added on the drawing area.
!petals-studio-creating-eip-croquis-8.jpg!
\\
On the drawing area, you can have two kinds of nodes: EIP nodes and end-point nodes.
EIP nodes define an EIP that will route a Petals message inside the bus to either another EIP or to a Petals service.
End-point nodes represent Petals services.
h2. EIP nodes
An *EIP node* can be selected among the various ones supported by Petals.
A node taken on the palette can either be dragged and dropped on the diagram or simply set by selecting it in the palette and clicking it on the diagram.
!petals-studio-creating-eip-croquis-5.jpg!
\\
Once added on the diagram, an EIP node must be edited. It is achieved through the Eclipse *Properties* view.
There are three different levels of properties.
\\
First, there are the ID properties.
Every EIP node will (unfortuantely) result in a Petals service. Therefore, it must be given an interface name, a service name and an end-point name. A WSDL can also be associated with it.
!petals-studio-creating-eip-croquis-6.jpg!
\\
Then, there is the pattern properties and options.
!petals-studio-creating-eip-croquis-7.jpg!
\\
Eventually, there is the list of outgoing connections.
These connections link the EIP to the services it may invoke (other EIP or Petals services).
!petals-studio-creating-eip-croquis-15.jpg!
h2. End-point nodes
*End-point nodes* represent a Petals service.
One can be created by selecting it in the palette and adding it on the diagram. Its properties then need to be set.
!petals-studio-creating-eip-croquis-9.jpg!
\\
Or you can also drag and drag a service from the [Petals Services view|Getting familiar with the Petals Services view] and drop it on the diagram.
!petals-studio-creating-eip-croquis-4.jpg!
h2. Connections
Connections are links between nodes on the diagram.
They can be created by using the dedicated palette icon or by right-clicking an EIP and selecting *Connect to...*.
A connection always start from an EIP node and may end on an EIP node or an end-point node.
\\
Connections also have properties to edit.
One part of the properties is about the invocation properties.
!petals-studio-creating-eip-croquis-10.jpg!
\\
A second part of the properties is specific to the original pattern.
As an example, a _router_ pattern has a properties tab for the condition.
!petals-studio-creating-eip-croquis-11.jpg!
h1. Exporting an EIP chain
When an EIP chain is finished, it looks like a graph.
!petals-studio-creating-eip-croquis-12.jpg!
\\
Validation is performed in live mode during the edition, so that you instantanetly know if there is an error or a missing property.
Once complete, an EIP chain can be exported as two outputs:
* As a service assembly for Petals ESB (i.e. a ZIP archive that can directly be deployed in Petals).
* As a set of service assembly and service unit projects (e.g. to be built with the Petals Maven plug-in).
\\
The export can be achieved by right-clicking the project in the project explorer and selecting the appropriate menu in *Petals > Export as...*
!petals-studio-creating-eip-croquis-13.jpg!
\\
In the case of a project set, a dialog will show up and ask to select what to create.
!petals-studio-creating-eip-croquis-14.jpg!