View Source

{section}
{column}

h1. Introduction

A SCA application run in Petals can be easily created with Petals Studio.
There are three creation patterns proposed in the studio. This is what this page illustrates.
{column}
{column:width=350px}
{panel:title=Table of contents}{toc}{panel}
{column}
{section}

h1. Getting started

In the menu, select *File > New > Service Unit Project*.
If you do not see it, go into *File > New > Other...* Then, select *Service Unit Project* under the *Petals* category.

!petals-studio-create-sca-0.jpg!

\\
A wizard opens up, showing three drop-down lists.
In the *Use Case* list, select *Use a Petals technical service*.
In the *Petals Component* list, select *SCA // petals-se-sca*.
In the *Component Version* list, select the version of the Petals-SE-SCA that you are using in Petals.

!petals-studio-create-sca-1.jpg!

\\
In the scope of this page, we will use the version 1.1 of the component.
Click *Next*. The next page gives you the choice between 3 creation ways.

h1. Creating an empty SCA application

Give the composite a name and complete its target namespace.
By selecting *Create an empty SCA application*, the resulting project will only contain an empty composite.
You will have to complete everything.

!petals-studio-create-sca-2.jpg!

\\
Clicking *Next* leads you to the project page, which expects the project name and location.
By default, the project name is generated from the composite name.

!petals-studio-create-sca-5.jpg!

\\
Click *Finish* to complete the wizard.
It results in the creation of a Petals SCA project...

!petals-studio-create-sca-10.jpg!

\\
... with an empty composite.

!petals-studio-create-sca-11.jpg!

h1. Implementing a Petals service with SCA

Give the composite a name and complete its target namespace.
By selecting *Implement a native Petals service with SCA*, the resulting project will contain a basic SCA application, with a component, a promoted service, an interface on the service and a component implementation. Both (and only) the Java interface and the Java implementation will need to be completed. The composite does not require any change.

!petals-studio-create-sca-3.jpg!

\\
Clicking *Next* leads you to the project page, which expects the project name and location.
By default, the project name is generated from the composite name.

!petals-studio-create-sca-5.jpg!

\\
Click *Finish* to complete the wizard.
It results in the creation of a Petals SCA project...

!petals-studio-create-sca-12.jpg!

\\
... with an almost complete SCA application.

!petals-studio-create-sca-13.jpg!

h1. Orchestrating Petals services with SCA

Give the composite a name and complete its target namespace.
By selecting *Build a composition of Petals services*, the resulting project will contain a basic SCA application, with a component, a promoted service, an interface on the service, a component implementation and references to Petals services. These references will already be usable, meaning the data-binding between the service's WSDL definition and Java is already done. Both (and only) the Java interface and the Java implementation will need to be completed. The composite does not require any change.

!petals-studio-create-sca-4.jpg!

\\
Clicking *Next* leads you to the project page, which expects the project name and location.
By default, the project name is generated from the composite name.

!petals-studio-create-sca-5.jpg!

\\
Click *Next* to select the Petals services the SCA application may invoke.
The selection is achieved by clicking *Add*. A selection dialog shows up, providing filtering assistance.
When you have selected your service, click *OK*. And repeat the operation until you have all the services you want to invoke.
Note that it is also possible to create SCA references that taget Petals services later on (during the edition).

!petals-studio-create-sca-6.jpg!

!petals-studio-create-sca-7.jpg!

\\
Click *Finish* to complete the wizard.
It results in the creation of a Petals SCA project...

!petals-studio-create-sca-8.jpg!

\\
... with an almost complete SCA application.

!petals-studio-create-sca-9.jpg!