Import Item tagged with 1 added

4.06K viewsDataLink
0

I have attached a model of a single matrix with a datalink and a text file to illustrate the problem encountered.
The text file has one line of data which the item matches with the matrix. However, when I do a datalink/update, the item is added to the matrix as a “new” item with a 1 tagged behind (ie Staffa 1). Why does this happen? What should I do so that the data (ie 5) is updated to the existing matrix of the existing item using datalink from a text file? Thanks.

0

[font=Arial:6ethes2y][size=84:6ethes2y]Yes, the original name is a property of the item and QAPI can access node properties. [/size:6ethes2y][/font:6ethes2y]

[font=Arial:6ethes2y][size=84:6ethes2y][b:6ethes2y][color=#7f0055:6ethes2y]public[/color:6ethes2y][/b:6ethes2y][b:6ethes2y][color=#7f0055:6ethes2y] void[/color:6ethes2y][/b:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y] performAction(QActionContext context, QActionEvent event)[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y] [font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y]{
[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=#3f7f5f:6ethes2y] // Get the desired node. In test12345.model it's the only[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=#3f7f5f:6ethes2y]
// item on the “type” category.
[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y] Model model = context.getModel();[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y]
MatrixView matrix = model.getMatrixAt(0);
[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y] Node category = matrix.getCategory([/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=#2a00ff:6ethes2y]”type”[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y]);[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y]
Node item = category.getChildAt(0);[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y]

[b:6ethes2y][color=#7f0055:6ethes2y]final[/color:6ethes2y][/b:6ethes2y][/size:6ethes2y][/font:6ethes2y] [font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y] String key = [/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=#2a00ff:6ethes2y]”com.quantrix.dataimport.ImportName”[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y];
[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y]System.[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][i:6ethes2y][color=#0000c0:6ethes2y]out[/color:6ethes2y][/i:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y].println([/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=#2a00ff:6ethes2y]”Original name: “[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y] + item.getProperty(key)); [/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=#3f7f5f:6ethes2y]//”Headcount”[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y]
[font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y]item.setProperty(key, [/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=#2a00ff:6ethes2y]”Staffa”[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y]);
[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y][color=black:6ethes2y]}

[/color:6ethes2y][/size:6ethes2y][/font:6ethes2y][font=Arial:6ethes2y][size=84:6ethes2y]You will need at least version 3.1.006 of Quantrix Modeler for this to work. Before that version, there was a bug that would cause[color=black:6ethes2y] item.getProperty[/color:6ethes2y]() to return null for this particular property.

[/size:6ethes2y][/font:6ethes2y]

You are viewing 1 out of 5 answers, click here to view all answers.