A Simple Talend Job - Getting the Result File as an Attachment

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (8)

View Page History
!PetalsContextOut.jpg!

\\
Click the *Export mode* column, and select *Parameter* in the combo box. Click *OK*.
The link label should be updated and indicate the number of exported contexts.
*/
public static void main( String args[] ) throws Exception {

URL wsdlURL = GeneratedCSVService.WSDL_LOCATION;
if( args.length > 0 ) {
wsdlURL = new URL( args[ 0 ]);
}

} catch( MalformedURLException e ) {
e.printStackTrace();
GeneratedCSVService ss = new GeneratedCSVService( wsdlURL, SERVICE_NAME );
GeneratedCSVServicePortType port = ss.getGeneratedCSVEndpoint();

// Activate the MTOM mode
((SOAPBinding) ((BindingProvider) port).getBinding()).setMTOMEnabled( true );
try {
org.ow2.petals.talend.TalendJobOutput result = port
.executeJob(
contexts,
inAttachments,
{noformat}
Invoking executeJob...
Job's result =
Row 0: 0 ;
OK.
{noformat}

If the job execution fails, the 0 is replaced by another integer, e.g. 1.
One failure reason can be, as an example, that the database is not started.

To determine the act cause of a problem, you would have to use logging features available in the Talend palet.
However, let's make it clear, the job's logs are managed independently of Petals and its monitoring capabilities.
{noformat}
{noformat}