|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (19)
View Page HistoryExecute a Talend job into Petals and passing it parameters that are natively supported by the job..
The job is exposed as a service into Petals. When this service is called, the job reads the native options and is executed.
Be careful, this is not the recommended way to pass information to a job. It is presented only to show what can be done.
Be careful, this is not the recommended way to pass information to a job. It is presented only to show what can be done.
The job is exposed as a service into Petals. When this service is called, the job is passed the context value as a native option, before being executed.
{warning}
Be careful, this is not the recommended way to pass information to a job. It is presented only to show what is feasible.
{warning}
Be careful, this is not the recommended way to pass information to a job. It is presented only to show what is feasible.
{warning}
The input message provides the value of a context using the native parameter-passing way of Talend jobs.
# It serializes part of the extracted data as a CSV file on the disk.
This job has one context variable, which indicates the location of the CSV file.
In the scope of this use case, it is assumed there is a database "formationtalend" on the localhost, having a table named customers.
The schema of the customers table includes two columns named "CustomerName" and CustomerAddress, both being of type varchar(255).
The schema of the customers table includes two columns named "CustomerName" and CustomerAddress, both being of type varchar(255).
\\
{info}
In the scope of this use case, it is assumed there is a database *formationtalend* on the localhost, having a table named *customers*.
The schema of the *customers* table includes two columns named *CustomerName* and *CustomerAddress*, both being of type varchar(255).
{info}
{info}
In the scope of this use case, it is assumed there is a database *formationtalend* on the localhost, having a table named *customers*.
The schema of the *customers* table includes two columns named *CustomerName* and *CustomerAddress*, both being of type varchar(255).
{info}
h2. Creating the job
The job creation export is detailled in the use case "A Simple Talend Job".
There is no difference.
h2. Exporting the job
There is no difference.
h1. Deploying and testing in Petals
h2. Looking at the created archive generated WSDL
The created archive is a Petals service assembly.
More details are available in the documentation of the petals-SE-Talend.
More details are available in the documentation of the petals-SE-Talend.
In the created Petals service assembly, the most interesting thing to look at is the WSDL.
Indeed, the WSDL will determine the way the exported service will be called.
Indeed, the WSDL will determine the way the exported service will be called.
What must be taken care of is the jbi.xml and the WSDL files available in the service-unit.
If you open the created archive, it contains another archive. This second archive contains a jbi.xml file.
If you open the created archive, it contains another archive. This second archive contains a jbi.xml file.
\\
The input message's description requires empty parameters.
The input message's description requires empty parameters.
The WSDL file exposes no parameter.
The possible input parameters are:
The possible input parameters are:
{code:lang=xml}
<xs:element name="executeJob" type="tns:executeJob" />
<xs:complexType name="executeJob">
<xs:sequence>
<xs:element minOccurs="0" name="contexts" type="tns:talendContexts" />
<xs:element minOccurs="0" name="in-attachments" type="tns:inAttachments" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="in-data-bean" type="tns:inRow" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="talend-option" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="executeJob" type="tns:executeJob" />
<xs:complexType name="executeJob">
<xs:sequence>
<xs:element minOccurs="0" name="contexts" type="tns:talendContexts" />
<xs:element minOccurs="0" name="in-attachments" type="tns:inAttachments" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="in-data-bean" type="tns:inRow" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="talend-option" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="talendContexts">
<xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:complexType name="inAttachments">
<xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:complexType name="inRow">
<xs:sequence>
</xs:sequence>
</xs:complexType>
{code}
\\
And the output message only includes the job's result.
{code:lang=xml}
<xs:element name="executeJobResponse" type="tns:executeJobResponse" />
<xs:complexType name="executeJobResponse">
<xs:sequence>
<xs:element minOccurs="0" name="talend-job-output" type="tns:talendJobOutput" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="talendJobOutput">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="executionResult" nillable="true" type="ns1:stringArray" />
<xs:element minOccurs="0" name="outAttachment" type="tns:outAttachments" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="outDataBean" nillable="true" type="tns:outRow" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="outAttachments">
<xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:complexType name="outRow">
<xs:sequence>
</xs:sequence>
</xs:complexType>
{code}
<xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:complexType name="inAttachments">
<xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:complexType name="inRow">
<xs:sequence>
</xs:sequence>
</xs:complexType>
{code}
\\
And the output message only includes the job's result.
{code:lang=xml}
<xs:element name="executeJobResponse" type="tns:executeJobResponse" />
<xs:complexType name="executeJobResponse">
<xs:sequence>
<xs:element minOccurs="0" name="talend-job-output" type="tns:talendJobOutput" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="talendJobOutput">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="executionResult" nillable="true" type="ns1:stringArray" />
<xs:element minOccurs="0" name="outAttachment" type="tns:outAttachments" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="outDataBean" nillable="true" type="tns:outRow" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="outAttachments">
<xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:complexType name="outRow">
<xs:sequence>
</xs:sequence>
</xs:complexType>
{code}
h2. Deploying and testing this new service
SoapUI is used for this test...
To test this service, you can use a tool like SoapUI.
This way, you can see what the XML messages look like.
The first thing to do is to create a service-unit for the Petals-BC-SOAP component, that exposes (consumes) our _Talend job as a service_ outside the bus.
This step is not described here. You can take a look at the Petals-BC-SOAP documentation and the Petals Studio documentation.
Just make sure the SOAP configuration uses the InOut MEP.
\\
Now, your input message should be:
{code:lang=xml}
{code}
\\
And the returned message should be:
{code:lang=xml}
{code}
This way, you can see what the XML messages look like.
The first thing to do is to create a service-unit for the Petals-BC-SOAP component, that exposes (consumes) our _Talend job as a service_ outside the bus.
This step is not described here. You can take a look at the Petals-BC-SOAP documentation and the Petals Studio documentation.
Just make sure the SOAP configuration uses the InOut MEP.
\\
Now, your input message should be:
{code:lang=xml}
{code}
\\
And the returned message should be:
{code:lang=xml}
{code}