How to skip run time error in tibco? - tibco

I am new to tibco and I am working on tibco BW 5.X versions.
I have a scenario where I am working on multiple records coming in from a schema and I have to write a text file with only specific values out of those records.
Ex :
if this is the input:
<param>1</param>
<param>2</param>
<param>1</param>
<param>1</param>
I only have to write the param having values 1 and have to generate error for param having values 2 but after generating error the iteration that is currently going on should continue and must not stop.
I would be grateful if someone can help

I assume in case of the value "2" you want to invoke the "Generate Error" Activity to throw an error up to a calling process or client that some entry was not correct, right?
So if you want to make sure to process the whole list you should not throw the error in the loop group on the list as it will exit.
You can either:
Use 2 seperated lists
map the entries with value "1" into a good list that enter the loop and entries with value "2" into a bad list, that will if filled let you then invoke the "Generate Error" activity after the loop processing.
Append the entries with value "2" in your loop
Thereby after processing the loop you have these entries and if the list contains entries invoke the "Generate Error" activity.
Hope that helps
Cheers Seb
P.s.: if you upload your process it would be more clear to show ;)

You could create a output schema which contains only param1 values and use a mapper activity to perform corresponding transformation and xpath functions for filtering. If you try to implement this solution you can eliminate the chance of param2 values creeping into your output.

Related

How to check if excel sheets exists in Kettle ETL?

I'm looping a directory and load all excel files where sheet name is like "Data".
If no sheet is named like "Data", I'm expecting the transformation to abort or throw an error. I have tried to use "switch-case", set default step to "Abort" if the sheet name does not equal to "Data", but this does not work. The work flow would go to both "Abort" and "Data" direction.
So how I achieve this? Just like doing an if else in Kettle? In SSIS, I can manage to use the variable to determine the work direction, but it seems that I could not use variable in Kettle.
I've figured out a solution.
USING Simple Evaluation to check for a variable value.
SET this variable value within the job:
Get sheet name from Microsoft Excel Input
Output this variable at the end of the job using [Set Variable], give it a dummy variable value
Check this variable at the parent transformation, if it equals to specific value, then continue the work flow, else abort
You can't set and read Variables in the same transformation.
In your case, get count of "Data sheets" by "group by" step and next simply call Abort in case of count=0.

Logging and asserting the number of previously-unknown DOM elements

I'ts my first tme using Cypress and I almost finalized my first test. But to do so I need to assert against a unknown number. Let me explain:
When the test starts, a random number of elements is generated and I shouldn't have control on such a number (is a requirement). So, I'm trying to get such number in this way:
var previousElems = cy.get('.list-group-item').its('length');
I'm not really sure if I'm getting the right data, since I can not log it (the "cypress console" shows me "[Object]" when I print it). But let's say such line returns (5) to exemplify.
During the test, I simulate a user creating extra elements (2) and removing an (1) element. Let's say the user just creates one single extra element.
So, at the end os the test, I need to check if the number of eements with the same class are equals to (5+2-1) = (6) elements. I'm doing it in this way:
cy.get('.list-group-item').its('length').should('eq', (previousTasks + 1));
But I get the following message:
CypressError: Timed out retrying: expected 10 to equal '[object Object]1'
So, how can I log and assert this?
Thanks in advance,
PD: I also tryed:
var previousTasks = (Cypress.$("ul").children)? Cypress.$("ul").children.length : 0;
But it always returns a fixed number (2), even if I put a wait before to make sure all the items are fully loaded.
I also tryed the same with childNodes but it always return 0.
Your problem stems from the fact that Cypress test code is run all at once before the test starts. Commands are queued to be run later, and so storing variables as in your example will not work. This is why you keep getting objects instead of numbers; the object you're getting is called a chainer, and is used to allow you to chain commands off other commands, like so: cy.get('#someSelector').should('...');
Cypress has a way to get around this though; if you need to operate on some data directly, you can provide a lambda function using .then() that will be run in order with the rest of your commands. Here's a basic example that should work in your scenario:
cy.get('.list-group-item').its('length').then(previousCount => {
// Add two elements and remove one...
cy.get('.list-group-item').its('.length').should('eq', previousCount + 1);
});
If you haven't already, I strongly suggest reading the fantastic introduction to Cypress in the docs. This page on variables and aliases should also be useful in this case.

Display error if tFilterRow results == 0

I have a job in which I use a rowFilter based on a condition. It works. But, what I want to do more is to display an error or stop the job if the number of filtered rows is 0. How can I achieve that?
This is my job:
Does anyone could help me?
Thank you in advance!
You need to use "RunIf" trigger and put the condition that you want here so that the job process would determine it's running course based on it.
On your case it would be something like -
((Integer)globalMap.get("tFilterRow_1_NB_LINE_OK"))>0
tFilterRow_1_NB_LINE_OK is a global variable part of the tFilterRow component which says "Number of lines matching the filter".
If you want to catch the error and print out the details you could connect the "RunIf" to tDie component and then use tLogCatcher component to catch the error - make sure that you have selected the "Catch tDie" option.

What means "Name=SWEIPS" Parametr in Siebel

Writing script in LR for Siebel Open UI. All my requests contains this parameter, with different values. What does it mean?
Examples (from different requests):
"Name=SWEIPS", Value = #0'0'1'0'GetProfileAttr'3'attrName'SBRF Position Id'"
"Name=SWEIPS", Value = #0'0''0'3'1-SQE21A, 1-SQL21E, 1SQE31"
And so on.
Can I simple delete it?
Can I simply delete it? - No, you’re not supposed to delete it.
Compare SWEIPS value by recording twice or trice with different data sets, check is there any date/time values in SWEIPS. If there is nothing to correlate leave as it is, no need to delete.
Ensure to correlate values like SWET,ROWID,SWECount,SWEC and so on.

Mapping Drives based on Group Membership

I am trying to map drives based on groups. I am using the 'Hey Scripting Guy Article' to do so. I am getting an error on one of my groups when I start my 'For Each' loop stating 'Object is not a Collection'. I know this is because when the group in question is 'NoAccess' it returns a string instead of an array. I am not sure how to cleanly get around this.
There are three groups, 'Card Dept', 'Cardsource' and 'NoAccess' -- NoAccess is the troublemaker. There are 2 users who are members of this group.
I dont want to start doing if statements before my select case call because if I ever need to add another group, I will have to determine if it will return an array or string, and then add another layer of If statements to determine how to map the drive. If I MUST do that, then I must, but I was hoping for a cleaner way to map drives based on groups. Below is a pastebin to the relevant code.
http://pastebin.com/cazSPjjD
Try doing error capture: invoking "On Error Resume next" late in the code and catching the errors immediately after the offending statement.

Resources