Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to control tJava sequence with an IF

Hi,
I'm using TOS DI 6.3.0, and I have this situation:
- I have an object as a context variable. This object has a 'status' variable.
- I use a tJava to instance this object, do some checks that can change the status variable.
- This tJava is connected to a tDie with an IF link (status code ERROR), and connected to another component also with an IF link (status code OK)
- After that, if everithing is OK, I have a tJavaRow that can change (or not) the status variable
So my problem is that my tJava can enter to both IF in a single execution (please see the picture attached). I think it's because the status variable is OK at the first time, but is changed by tJavaRow component. The weird thing is tJavaRow is not executed after tJava.. and aparently the IF sequence is not being respected.
So, how can I force my tJava to be executed completly before the execution of the next component, and also validate my status variable?

Labels (2)
7 Replies
Anonymous
Not applicable
Author

Hi 
How is the condition defined for each runIf lik? Can you show us the expression code?

Regards
Shong
Anonymous
Not applicable
Author

shong wrote:
Hi 
How is the condition defined for each runIf lik? Can you show us the expression code?

Regards
Shong

Hi Shong, thanks for reply.
Here's the conditions:
if (order:1) --> ((routines.Procesos)context.oProceso).statusGlobal != 3
if (order:2) --> ((routines.Procesos)context.oProceso).statusGlobal == 3
statusGlobal is set with "1" by default, but can be changed in the tJava or tJavaRow. 
Anonymous
Not applicable
Author

Any clue?
Anonymous
Not applicable
Author

Hello 
Why do you use both OncomponentError and runIf to trigger the subjob starting from Descarg HTML? I don't understand your business logic well, would you please upload a full image of your job?

Regards
Shong
Anonymous
Not applicable
Author

Hi Shong, 
I'm been working on this Job, so now it's not the same  Smiley Indifferent
The 'issue' stoped when I add more components.
To answer your question, "Descarga HTML" is linked to a tDie with that OnComponentError. The Job start with "Valida Parámetros" component.
Anonymous
Not applicable
Author

The Job start with "Valida Parámetros" component.

As you said, the job starts with tJava component, this component validate the status, the default status is 1, so, it executes the subjobs linked by order1. I don't see a loop component in your job, so the job is always executed one time.
Regards
Shong
Anonymous
Not applicable
Author

Hi Shong, 
Thanks for answering. But I still do not understand why if (order: 1) and if (order: 2) can be false in the same execution (with no loops) if they are exclusive.