Capture Component Label Format in Origin Field of tLogCatcher instead of component name - talend

I am trying to capture the Label Name of the component in case it fails. When using tLogCatcher it is capturing the failure but printing origin as Component Name example if tRunJob is failing it is printing tRunJob_2.
tRunJob_2 Label Format in View is "ABC_TEST_JOB".
How to capture the Label Format so that in case of debugging I can easily see where that Label Component is considering having 10_ tRunJobs

The label of a component cannot be captured, as it's not in the generated java program, it's just visible in the designer. Maybe you can keep a mapping between component names and their labels in a tFixedFlowInput and use that as a lookup:
tFixedFlowInput (tRunJob1=ABC, tRunJob2=BCD..)
|
|
tLogCatcher----tMap----output

Related

Can I display the current value in a goto or from tag

I have a Simulink Model with with multiple GotoFrom Tags. Instead of their individual name i want to display their current value. In the following picture i would want to substitute A with its respective value.

Display subset of data based on string pattern on template variable dropdown in table panel

Grafana Version: 6.2.5
Elastic search
I have logs data with pattern ERR,INFO,DEBUG
Example “data_ERR_notconnected”, “sys_INFO_connected”, “sys_DEBUG_network”
I am trying to create template variable for ‘marker’ with variable dropdown as ERR,INFO,DEBUG. So when ERR is clicked from dropdown only error based data is displayed in table format panel.
Drop down image
regex used
I am using regex as /.*(ERR|INFO|SH)/ but i dont see any change in response. Basically i am not able to group a values based on string pattern in a template variable? Is there anyway i could group the values based on string pattern? Any idea would be helpful?
Replace your regex with /.*_(ERR|INFO|SH)_.*/
This should give you ERR, INFO, SH as value of the dropdown

How to seperate prefix from a dynamic text before printing in BIRT

The name which i want to print in the report as a dynamic text is in the encrypted format in the DB. I decrypt this name with the help of the following script in onCreate of this dynamic text field.
this.text=Packages.com.erp.util.EncryptUtil.decrypt(name);
Now the problem is, this name comes with the prefix Mr,Ms etc concatenated with the name in some reports which is affecting the name decryption, I want the name alone for decrypt. Separating the prefix and name in query is disturbing the binding and leads to some other errors. So what i want to do is check the name for any space or split so that i can identify after the 1st space whatever coming would be the name and before space would be prefix. Then i want to send that name alone to the decypt method and on returning decrypted name should concatenate with the prefix using some script and print in the dynamic text field. How to achieve this in the BIRT Report Designer Version: 3.7.1.v2
From DataSet Drag and drop the name attribute into the report somewhere and make it invisible. Go to the onRender of that name attribute which available from the script tab in BIRT and paste the following code to separate prefix from name and send the name alone to your method.
name = this.getValue();
var sArr = name.split(" ");
name="";
for(var i=1;i<sArr.length;i++){
if(sArr[i]!=null)
name = name+" "+sArr[i];
}
name = name.replace(/^[ ]+|[ ]+$/g,'')
name=sArr[0]+" "+Packages.com.yourpackagename.yourmethodname(name);
Now drag and drop the dynamic text from the palette to the position where you want see the name. Go to the onCreate of that dynamic text field which available from the script tab and paste the following code to print the result which returned from your method along with the prefix.
this.text=name;

Put File Mask on tFileList Component dynamically

I was wondering if you let me know how I can set file mask for tFilelist component in Talend that it recognize date automatically and it will download only data for desired date?
I have tried some approach and I faced with some errors like "the method add (string) in the type list <String> is not applicable for the arguments (Date)"
There are two ways of doing it.
Create context variable and use this variable in file mask.
Directly use TalendDate.getDate() or any other date function in file mask.
See both of them in component
1st approach,
Create context variable named with dateFilter as string type.
Assign value to context.dateFilter=TalendDate.getDate("yyyy-MM-dd");
Suppose you have file name as "ABC_2015-06-19.txt" then
In tFileList file mask use this variable as follows.
"ABC_"+context.dateFilter+".*"
2nd approach
In tFileList file mask use date function as follows.
"ABC_"+TalendDate.getDate("yyyy-MM-dd")+".*"
these are the two best way, you can make changes in file mask per your file names.

JavaFX error: incompatible types - Object cannot be converted to Node

I have defined 3 labels in a FXML file within a grid pane. I am trying to read the following XML file and display the labels present in the file in a grid pane. The numerical values in the XML file denotes the row & column position.
<data>
<lbl1>0,0</lbl1>
<lbl2>0,1</lbl2>
<lbl3>0,2</lbl3>
</data>
I have added all the elements to the HashMap and then retrieve it to be displayed. Firstly, I added all the three labels one by one as follows:
hm.put("lbl1", eElement.getElementsByTagName("lbl1").item(0).getTextContent());
hm.put("lbl2", eElement.getElementsByTagName("lbl2").item(0).getTextContent());
hm.put("lbl3", eElement.getElementsByTagName("lbl3").item(0).getTextContent());
Then I display them as follows:
grid.add(lbl1, Integer.parseInt(hm.get("lbl1").toString().split(",")[0]),Integer.parseInt(hm.get("lbl1").toString().split(",")[1]));
grid.add(lbl2, Integer.parseInt(hm.get("lbl2").toString().split(",")[0]),Integer.parseInt(hm.get("lbl2").toString().split(",")[1]));
grid.add(lbl3, Integer.parseInt(hm.get("lbl3").toString().split(",")[0]),Integer.parseInt(hm.get("lbl3").toString().split(",")[1]));
The above code works well without any issues and I can see the labels on the grid.
Now, instead of adding the labels one by one, I added all of them in a single statement through a 'for' loop as shown below:
if (!eElement.getTagName().toString().equals("data"))
hm.put(eElement.getTagName(), eElement.getTextContent());
If I try to display the label, for example:
grid.add(hm.get("lbl1"),0,0);
I get an error:incompatible types - Object cannot be converted to Node.
If I try to typecast:
grid.add((javafx.scene.Node) hm.get("lbl1"),0,0);
I get an error:java.lang.ClassCastException: java.lang.String cannot be cast to javafx.scene.Node
If I print the hashmap entries, the following output is shown:
lbl1=0,0, lbl2=0,1, lbl3=0,2
How to fix this error? Is there any other way in which I can add all the elements in a single statement and then display them?
in your imports add:-
import javafx.scene.control.Label;
I suspect that the current import is from awt.
From your sample code, I guess that hm is an instance of Map<String, String>
So, when you call hm.get("lbl1") , you get a String.
You're trying to add this String to a GridPane, but the add() method is expecting a javafx.scene.Node. That's why you get a an error "incompatible types".
Instead, you should add your instances of javafx.scene.control.Label (lbl1, lbl2, lbl3)