Preliminary notes
This use case can only be reproduced with Talend Integration Suite.
People using Talend Open Studio can find an alternative in the use cases "Data Flow - From a job to Petals using attachments" and "Data Flow - From a job to Petals using a tBufferOutput".
Rationale
Execute a Talend job into Petals and passing it a context as a parameter described in the service's WSDL interface.
The resulting file will be returned as an attachement
The job is exposed as a service into Petals. When this service is called, the parameter is passed to the job, which is then executed.
The file created by this job is then returned as an attchment.
The input message provides the value of of the context which is exposed as a parameter in the service's interface.
Only the job's result is expected in the response.
Creating and exporting the job
The job to be executed performs the following actions:
- The job is passed the value of the context variable.
- The job connects to a database.
- It retrieves the content of a table.
- It serializes part of the extracted data as a CSV file on the disk.
- Once the execution terminated, the created file is attached to the returned message.
This job has one context variable, which indicates the location of the CSV file.
This location will be read by the Petals-SE-Talend component once the execution is terminated. The file will then be attached to the returned message.
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).
Creating the job
The job creation is detailled in the use case "A Simple Talend Job".
There is no difference.
Exporting the job
Deploying and testing in Petals
Looking at the created archive
The created archive is a Petals service assembly.
More details are available in the documentation of the petals-SE-Talend.
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.
The WSDL file exposes no parameter.
The possible input parameters are:
Deploying and testing this new service
SoapUI is used for this test...