View Source

{section}
{column}

h1. Definition

When you want to create a service-unit for Petals with the studio, you have to create a service-unit project.
A service-unit project contains a JBI descriptor and other resources, that depend on the target component.
A service-unit project (also called _SU project_) contains meta-data (such as the name of the target component, its version...).
A SU project can be referenced by a Service-Assembly project (_SA project_).

Here is the typical structure of a SU project.

{noformat}
src
main
java
jbi
jbi.xml
Other resources (e.g. *.jar, *.wsdl)
pom.xml
{noformat}

SU projects are associated with a builder in charge of validating the jbi.xml file and the coherence of the associated resources.

{column}
{column:width=350px}
{panel:title=Table of contents}{toc}{panel}
{column}
{section}

h1. Creation

The creation of a SU project can be achieved by different means:
* By creating a _Petals service (provider)_ (*File > New > Petals > Petals Service Provider*).
* By creating a _Petals service consumer_ (*File > New > Petals > Petals Service Consumer*).
* By exporting a _croquis_ into Petals projects.
* By importing an existing Service Assembly.

The creation is detailed more precisely in various tutorials of the studio.


h1. {anchor:Export} Export for Petals

If your SU project is referenced by a SA project, you should [export the SA project|Working with Service Assembly projects#Export] instead.
Indeed, in this case, the service-unit export will be done through the export of the SA project.

{tip}
SU and SA projects are compatible with the Petals Maven plug-in.
The packaging can be done with both the Studio and Maven.
{tip}

h2. {anchor:FastExport} Fast export

The fast export is a shortcut to create a service assembly from a SU project in few seconds.
The created service assembly is saved at the root of the SU project.

To export a SU project quickly, right-click it and select *Petals > Fast Export for Petals*.

!PetalsStudio_ExportSu_6.jpg!


h2. Complete export

The complete export provides numerous options to export one or several SU projects at once.
Select *File > Export > Petals > Service-Unit*.

!PetalsStudio_ExportSu_1.jpg!

\\
A wizard starts.
The top part lists all the SU projects contained in the workspace. Select the ones you want to export and the export mode.

!PetalsStudio_ExportSu_2.jpg!

h3. Distinct export, in a same directory

Every selected SU project will be exported, each one in its own service assembly.
All the service assemblies are placed in a same directory. The directory location must be specified.

!PetalsStudio_ExportSu_3.jpg!

h3. Distinct export, in the project directories

Every selected SU project will be exported, each one in its own service assembly.
Each created service assembly is placed in the SU project. This is equivalent to making a [Fast export|#FastExport] on every selected SU project.

!PetalsStudio_ExportSu_4.jpg!

h3. All-in-one export...

All the selected SU projects will be exported together in a single service assembly.
The created service assembly will be saved at the specified location.

!PetalsStudio_ExportSu_5.jpg!