Four Stars

Dynamic Creation of Objects

Hello everybody

I'm working on a project of multi-model framework creation

and i need to know if it is possible how to create or to add an object to  my job (ex: tlogrow or tinputdelimitedfile) without drag and drop

I mean with java code using tjavarow

please help

thank you very much

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Seven Stars TRF
Seven Stars

Re: Dynamic Creation of Objects

Here is an example

test.PNG

tFifixedFlowInput with its schema to get the current filepath

test.PNG

 

What else?

 


TRF
13 REPLIES
Seven Stars TRF
Seven Stars

Re: Dynamic Creation of Objects

I don't think so (in fact I'm quite sure you cannot).
When you drag&drop components you "generate" Java source code which is compiled later when you build the job (or run in the studio).
How do you expect to change the byte code at run time?


TRF
Four Stars

Re: Dynamic Creation of Objects

Hi TRF

thank you very much for your response

i will try to find another process to do my task

Five Stars

Re: Dynamic Creation of Objects

You could have your two components and filter the input to one or the other using a Context variable

 

Four Stars

Re: Dynamic Creation of Objects

The problem is that i dont have a fixed number of inputfiles 

it will be changing from day to another that's why i want to find to add components in a dynamic way

Five Stars

Re: Dynamic Creation of Objects

Then  you should consider tFileList

Four Stars

Re: Dynamic Creation of Objects

the problem is that all i know about filelist can only work with a fixed number of created file 

here i want to create a list  with a non fixed number of file the time of receiving the data flow and than make the mapping

i mean i want to create a job that for example :

at 9:30 it can create ten file and receive the data flow

at 11:30 , it can create 20 file

Four Stars

Re: Dynamic Creation of Objects

 the required number of file will be fixed with from admin interface

Seven Stars TRF
Seven Stars

Re: Dynamic Creation of Objects

tFileList is the solution for iterating over a list of files with give filename mask(s).

If you want to break the process after a number of iterations (varying for each run), you must use tFileList to get the full list of filenames corresponding to the mask.

After that, iterate (tLoop) to proceed with each file n times where n can be fixed for each run using a context variable (with a different value at each time if you want).

 

Not sure that's what you are looking for as your use case come one piece at a time and is not very clear.

 

 


TRF
Four Stars

Re: Dynamic Creation of Objects

HI TRF

what i want if it exists a way to change the the number of file to be createfd with a tfilelist manually with java code ,

Four Stars

Re: Dynamic Creation of Objects

if not , i will be so grateful to help me giving a similar process 

Seven Stars TRF
Seven Stars

Re: Dynamic Creation of Objects

that's what I suggest in my last post. you cannot decide the number of files in tFileList. tFileList give you the full list (push it in a tHashOutput for example) then with tLoop, or better with tSampleRow, get the desired number of files.

TRF
Four Stars

Re: Dynamic Creation of Objects

then i'm going to try that

and i will be more grateful if you give me an example for that

thank you TRF

Seven Stars TRF
Seven Stars

Re: Dynamic Creation of Objects

Here is an example

test.PNG

tFifixedFlowInput with its schema to get the current filepath

test.PNG

 

What else?

 


TRF