Pentaho PDI - Not setting constant - pentaho

I can't for the life of me figure out why my transform which I have setting a 'constant' value is not setting it? Anywhere I can look for details?
Here's the add header - constant step
So WHY do I not get my test value in the output??
I even tried 'set field value to constant' step which takes the one row coming from my filer step and sets it to a constant value which also produces nothing! IDK whats going on here!

Thanks for the suggestions… I actually figured this out it has to do with the fact that the text output steps have a setting to not create when the transformation first starts I had to check that box…

Related

Pentaho/PDI: Increment a value automatically by one if a load-job (within a metajob) fails

in PDI I've got the following structure
0_Metajob
1_Load_1
1_Load_2
1_SimpleEvaluation
1_Mail
As of now
1_Load_1 and 1_Load_2 are independent of each other. The second one will run, irrespective of the success of the first one. That is okay, I want it that way!
Issue
I want to have a counter that is incremented by one every time one of the single loads fails, i.e. in my example the counter can take the values 0, 1 or 2.
What do I need it for? Customer will receive a mail at the end of the metajob. The aforementioned value determines the subject of the mail, i.e. 0=everything fine, 1=so-so, 2=load totally failed!
Why not mailing within every single the Load-Job? I do that but without attaching the log-file because it is usually non-finished. Therefore the log-file is mailed with the mail that is sent when the Metajob is finished.
Tried
"Set a variable". Thought I can simply increment it with adding a one in the value field, i.e. "${VariableName}+1". Of course, this step is implementened within a fail path of each Load-Job.
However, it didn't work.
Would anyone mind helping me? I would appreciate that!
Set Variable doesn't do calculations, you'll need a Javascript step for that.
Fortunately, variables can be also be set within the Javascript step. This bit of code should go into each of the steps you put in place of the Set Variable steps:
var i = parseInt(parent_job.getVariable("Counter"),0);
i = i + 1;
parent_job.setVariable("Counter",i);
true;
This bit of code gets the variable "Counter" from the parent job and converts it to int, since all Pentaho variables are strings. Then it increments it and sets the job variable again. The "true" at the end is to ensure that the javascript step reports success to the main job.
IMPORTANT: This works roughly as you would expect in a Job. It will NOT in a transformation!

Using Value obtained with Get Value

I am very new to using Robot Framework, and I am using the RIDE development environment. I am trying to obtain a value from an element on a website, and then set a variable with that value. The keyword Get Value only accepts one argument from what I can see, and I cannot find any documentation explaining how to do this. This question is similar to another SO question but I am unclear on how to assign this data to a variable.
Any help is greatly appreciated!
--edit--
here is the element that i am trying to obtain data from:
<div class="highlight-box animate ng-binding" animate-change="master.user.balance.toFixed(2)" id="header-balance">
0.00
</div>
I tried setting the variable like this:
#{balance} get value header-balance
as suggested, and it didnt throw any errors, but then when I tried to use the variable with an input text:
input text Textbox-1 #{balance}
it threw an error saying that input text requires two arguments. I took this to mean that the variable did not contain anything, regardless of being set in the last line.
To set a variable with the value obtained, just add the variable name as first element in your statement. Something like:
${variable} = Get Value id=my_element

Any idea about this weird type error in Pentaho Data Integration?

I have this :
Insertion des données dans table some_table.0 - SOME_AUTO_GENERATED_DB_KEY Integer : There was a data type error: the data type of java.lang.Boolean object [true] does not correspond to value meta [Integer]
What boolean??? Where do you see a boolean? I have added a trace writing to the step just before this failing inserting step, and I see a perfectly fine integer as value of SOME_AUTO_GENERATED_DB_KEY .
How can this be possible? I am very new to Kettle, if you have any idea or tips it would be awesome.
Here a screenshot of the transformation :
Just before the failed insert, you have a filter that splits the stream. On one half of the stream, it looks like you have an Add Constant step. If I'm reading this right, then the two inputs to the Insert step don't have the same fields in the same order. A few steps earlier, there is a similar splitting of the paths that goes off to the right, which could have the same effect.
Whenever you remerge streams like this without being very careful, strange errors like this can pop up. Pentaho usually tries to warn you when you create the hop to remerge the streams, but there are ways to miss that warning.
Suggestion: For each time the stream remerges, right-click on each of the two previous steps, and have it show you the output fields. Compare the two lists side-by-side to verify they are the same. If not, then you will have to add or remove fields as appropriate to make them the same on both sides.

Orbeon repeats do not support initial values after first iteration

Using Orbeon to create a form, in a repeat I ran into an issue with setting Initial values. After the first iteration, the default value does not work. After some research, I found this to be a common issue, but no resolution. Need an expression that would keep track of each node that is set and account for any values that are changed from their initial value.
Thanks!
You could try using a Calculated Value (rather than an Initial Value) which sets the default value if the element is blank, but leaves it alone if it has been completed.
Ie, try something like:
if (. = '') then 'default value' else .

Adobe Livecycle: how to get the value of process data

I have a process data defined in Adobe livecycle, addField as a string. I am passing the value of this variable as an input when i invoke a process. Further i want to compare the value of this process data if it is true or false. I am trying to use the following expression:
string(/process_data/#addField)=string("true")
but i am not getting the value out of the expression. Is the above expression true? If not what is used to get the value of the process data?
I believe your XPath expression is wrong. I just did a quick mock-up in workbench and I got the correct response. Here are the details of what I did:
Created an input string variable i workbench called addField.
Created a two step process. The first step has two routes going out to two different set values.
On one of the routes, I added the following condition:
/process_data/#addField = "true"
Turned on recording, and invoked the process.
In the input parameters screen in workbench, I added the following text: true
In the recording, I can see the expression evaluating correctly and going to the correct set value.
Do let me know if you have any other questions.
Thanks,
Armaghan.