h1. Preliminary notes
This use case can be reproduced with both Talend Open Studio and Talend Integration Suite.
As the first use case to be read by a beginner, the job creation here is very detailled. However, it is strongly advised to read Talend's documentation first.
Other use cases are less detailled.
h1. Rationale
Execute a Talend job which has no specific interaction with Petals.
The job is exposed as a service into Petals. When this service is called, the job is executed.
The message provides no parameter to the job, and only the job's result is returned.
h1. Creating and exporting the job
The job to be executed performs the following actions:
# 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.
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).
h2. Creating the job
Create a new job called SimpleJob (right-click on Job Designs and Create Job).
Add a tMysqlInput component on the graphical workspace. It will be the start component.
Then, add a tFileOutputDelimited component on the graphical workspace, and link the two components with a main connection.
Your job should look like this:
!SimpleJobAppearance.jpg!
Let's configure the components.
Select the tMySqlInput component, and go into the Component view.
Provide the required information to connect to the database.
Set the request value to
| "select CustomerName, CustomerAddress from customers" |
Make sure to know forget the quotes.
!SimpleJobProperties.jpg!
And click Guess Schema.
The request is parsed, the database is queried about its structure, and the component schema is guessed.
If you click Edit Schema, you can see the component schema, with the column names and types.
!SimpleJobSchema.jpg!
Propagate the schema changes to the tFileOutputDelimited.
And let's now configure this second component. Select it on the graphical workspace and go into the Component view.
Click "..." on the file name row, and select the output location, e.g.
"C:/Documents and Settings/vzurczak/Bureau/output.csv"
We are going to replace this value by a context.
Go into the Contexts view.
Click "+" and give the new context variable the name "outputLocation". Let it be a string.
Go into the "values as tree" tab, and set the default value of this context variable to C:/Documents and Settings/vzurczak/Bureau/output.csv (without the quotes).
!SimpleJobContextes.jpg!
Now, turn back in the Component view and select the tFileOutputDelimited component.
Set the file name value to context.outputLocation and save the job.
When this job is executed, it reads the values in the MySQL table, and writes them into the CSV file whose location is defined by the context variable outputLocation.
h2. Exporting the job
Select the job and right-click it. Select Export to Petals ESB.
Update the target destination.
Let the job be exposed as a singleton. Do not export any context.
You should have the following dialog:
!SimpleJobExport.jpg!
Click Finish.
h1. Deploying and testing in Petals
h2. 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:
h2. Deploying and testing this new service
SoapUI is used for this test...
This use case can be reproduced with both Talend Open Studio and Talend Integration Suite.
As the first use case to be read by a beginner, the job creation here is very detailled. However, it is strongly advised to read Talend's documentation first.
Other use cases are less detailled.
h1. Rationale
Execute a Talend job which has no specific interaction with Petals.
The job is exposed as a service into Petals. When this service is called, the job is executed.
The message provides no parameter to the job, and only the job's result is returned.
h1. Creating and exporting the job
The job to be executed performs the following actions:
# 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.
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).
h2. Creating the job
Create a new job called SimpleJob (right-click on Job Designs and Create Job).
Add a tMysqlInput component on the graphical workspace. It will be the start component.
Then, add a tFileOutputDelimited component on the graphical workspace, and link the two components with a main connection.
Your job should look like this:
!SimpleJobAppearance.jpg!
Let's configure the components.
Select the tMySqlInput component, and go into the Component view.
Provide the required information to connect to the database.
Set the request value to
| "select CustomerName, CustomerAddress from customers" |
Make sure to know forget the quotes.
!SimpleJobProperties.jpg!
And click Guess Schema.
The request is parsed, the database is queried about its structure, and the component schema is guessed.
If you click Edit Schema, you can see the component schema, with the column names and types.
!SimpleJobSchema.jpg!
Propagate the schema changes to the tFileOutputDelimited.
And let's now configure this second component. Select it on the graphical workspace and go into the Component view.
Click "..." on the file name row, and select the output location, e.g.
"C:/Documents and Settings/vzurczak/Bureau/output.csv"
We are going to replace this value by a context.
Go into the Contexts view.
Click "+" and give the new context variable the name "outputLocation". Let it be a string.
Go into the "values as tree" tab, and set the default value of this context variable to C:/Documents and Settings/vzurczak/Bureau/output.csv (without the quotes).
!SimpleJobContextes.jpg!
Now, turn back in the Component view and select the tFileOutputDelimited component.
Set the file name value to context.outputLocation and save the job.
When this job is executed, it reads the values in the MySQL table, and writes them into the CSV file whose location is defined by the context variable outputLocation.
h2. Exporting the job
Select the job and right-click it. Select Export to Petals ESB.
Update the target destination.
Let the job be exposed as a singleton. Do not export any context.
You should have the following dialog:
!SimpleJobExport.jpg!
Click Finish.
h1. Deploying and testing in Petals
h2. 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:
h2. Deploying and testing this new service
SoapUI is used for this test...