Seven Stars

enable or disable component

Hi,

 

Is it possible to disable or enable a component during runtime ?

 

I have a similar set of components to be used in two jobs wherein for one of the jobs i have an extra component at the last and rest remains the same.

I was rather thinking of making it in one job wherein according to constraint i can enable or disable the last component.

Please suggest.

 

Here,

Disable -> Deactivate

Enable -> Active

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: enable or disable component

Hello,

Can you use trigger to control your work flow? Here is RunIf trigger which triggers a subjob or component in case the condition defined is met. For further information about Run if, please have a look at document about:https://help.talend.com/reader/fF_f1a23ZlLpfb9XfZUXWA/rpFV93Uc4LKksvXQFtSdWg?section=Raa59470.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
5 REPLIES
Moderator

Re: enable or disable component

Hello,

Can you use trigger to control your work flow? Here is RunIf trigger which triggers a subjob or component in case the condition defined is met. For further information about Run if, please have a look at document about:https://help.talend.com/reader/fF_f1a23ZlLpfb9XfZUXWA/rpFV93Uc4LKksvXQFtSdWg?section=Raa59470.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Employee

Re: enable or disable component

Activate or Deactivate components means the actual code generated is different.  Hence it cannot be done at runtime.  It is a design time only feature.  Use an Run if trigger. 

Seven Stars

Re: enable or disable component

Hi ,

I am not sure the RunIf will work.
here is my job wherein i want to create the output file where no of unique rows is greater than 0.
Application is not allowing to connect the RunIf component in the design, is there any other component to be added in between to make the job run ?

also note: the output files have different headers
Thanks

Employee

Re: enable or disable component

You can check the option "Don't generate empty file" on the tFileOutputDelimited, and it will not generate a file when no unique rows are there.

Seven Stars

Re: enable or disable component

I have checked that option , it doest write the rows but its still writing the header.
I have set condition where the second file has rows greater than zero but when the job is executed the output file has header from first file and the rows from second file

 

also one more point, for both the output files,  name and file location is same just the file content is different;

 

Now i have found a solution, it works but dont know how much feasible is this solution as i am new to talend

I am generating the header differently based on the consraints before writing the data in the file.

now while writing the data i unchecked the include header option and so i am getting the desired result.

 

If there is any other way please let me know.