Kettle in circulation

He said cycle, certainly no stranger to the small partners, is to repeat do one thing; and the kettle is in general circulation occurs in the job, because the job is executed in serial;

kettle cycle, there are two, one is through the js script, the other is returned by traversing each row in the previous step.


Here is what I wrote pseudo-code, I will use the Kettle to implement this code:

array = ['sys1','sys2','sys3','sys4']

variable in Array for:
     IF variable == 'SYS1':
         Print ( '% S is called'% (variable,))
        
     elif variable == 'SYS2':
         Print ( '% S is called'% (variable,))
    
     elif == variable 'SYS3':
         Print ( '% S is called'% (variable,))
    
     elif variable == 'SYS4':
         Print ( '% S is called'% (variable,))
    
     the else:
         Print ( 'not transfer')


Code loop variable is variable, with a complete traversal for an array, then the end of the cycle.

Loop in a set determination condition, a branch which determines the array elements belong.

If all the judgment conditions are not met, then print "is not called"


1. Kettle job description

schedule_job.kjb: loop variables related to the operating cycle and the body, also called inlet, to be understood that main

get_data_from_datagrid.ktr: generating an array, i.e. cycling conditions.

cycle_body_job.kjb: cycling, arrays, there are few data, the loop is executed several times.


FIG 2 is a configuration schedule_job lower, its role is to connect the loop condition and the loop, so the two additional job steps comprising

image


Next, I will start each step in the setting method, and finally how schedule_job is set;

If you expand that file, write the file name directly, if you expand that step, then put the file name - step name.

For example, expanded file get_data_from_datagrid.ktr

       Expand step get_data_from_datagrid-Data Grid


3. get_data_from_datagrid.ktr 展开

image


Only two steps, is a data grid, used to generate the array, a further step is Copy rows to result, is used to copy the data to return results may be returned to the caller. The caller is outside schedule_job.ktr.


4. get_data_from_datagrid-Data Grid 展开

image

Fill in the fields of information in the Meta tab, type the field name is a string SYSTEMNAME

image

In the Value Data tab of fill in the fields, just like the process to fill in the data as excel.


5. cycle_body_job.kjb Expand

image


Double-click the blank space, open the "Parameters" tab, enter the variable name SYSTEMNAME inside. This variable with the previous steps field names the same.

image


6. cycle_body_job-is_sys1 expansion

Other conditions are similar judgment, not start one by one.

image


7. schedule_job setting method

image


勾选“Execute every input row”

image


image

Guess you like

Origin www.cnblogs.com/fooobabar/p/10987554.html