Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
stephbzr
Contributor III
Contributor III

Keep the number of lines of an output

Hello, 

I would like to keep in memory (for an UPDATE in a table with the statistics of a file) some data of an output (they are circled below), but I don't know how to proceed from the following components: 

0695b00000UxWtGAAV.png

Do you have an idea ? Thank you.

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hello,

we can get the row number of a component by the below code

globalMap.get("COMPONENTNAME_NB_LINE")

 

so to achieve what you want, you can design the job like

  1. define a context variable (e.g): sf_line_count in the job
  2. add one tJava Component onSubjobOK row to setup the value of context variable by the code like (e.g.)

context.sf_line_count= (Integer)(globalMap.get("tSalesforceInput_1_NB_LINE"));

You can setup multiple context variables and setup the values of them in tJava component as the below

0695b00000UxusvAAB.png

View solution in original post

3 Replies
Anonymous
Not applicable

Hello,

we can get the row number of a component by the below code

globalMap.get("COMPONENTNAME_NB_LINE")

 

so to achieve what you want, you can design the job like

  1. define a context variable (e.g): sf_line_count in the job
  2. add one tJava Component onSubjobOK row to setup the value of context variable by the code like (e.g.)

context.sf_line_count= (Integer)(globalMap.get("tSalesforceInput_1_NB_LINE"));

You can setup multiple context variables and setup the values of them in tJava component as the below

0695b00000UxusvAAB.png

stephbzr
Contributor III
Contributor III
Author

Hello @Aiming Chen​,

 

I didn't know that the global variable NB_LINE can be applied on all components because it doesn't appear below : 

0695b00000UxvJSAAZ.pngThank you for this valuable information, it works very well ! Do you know where I can find other global variables of this type? If there is a list somewhere. 

Anonymous
Not applicable

Hello,

These are referenced within the documentation in connection to components, but there is no complete list of every variable available. This is largely due to the fact that they largely depend upon the job that you have built. An easy way of investigating these for a job is to....

 

  1. Look at the code tab of the design window. You will find many in here. It is always a good idea to take a look here since it gives you a more in-depth understand of how your job will work. With a bit of Java knowledge, this is invaluable.
  2. There is also the "Outline" tab (bottom left usually) which shows you each of the components you are using and each of the relevant global Map variables that can be used there.

Hope it helps.

Best regards

Sabrina