Mapping-Table: Multiple SRC-Columns, wrong matches (multiple instead of one)

Hello everyone!

I have a mapping table with 3 “Source-Columns” and one Destination-Column. Column A, B, C are source, D is destination.

I use the element www.netiq.com/.../token-map.html with several “token-map-source-col” elements to customize it.

Example of the mapping table (not the whole one)

Bukrs Group Name Active
5555 LEADER Z 1
5555 LEADERSUB Z 1
5555 CORE Z 0
5555 SUB Z 0

Screenshot of the mapping table:

The token-map looks like this:

<do-set-local-variable name="lv.group.create" scope="policy">
				<arg-node-set>
					<token-map default-value="-1" dest="Active" source="Buchungskreis" table="..\..\customer_mapping-tables\mappingTableName" type="AND">
						<token-map-source-col name="Buchungskreis">
							<token-local-variable name="lv.o.bukrs"/>
						</token-map-source-col>
						<token-map-source-col name="GroupType">
							<token-local-variable name="lv.check.groupType"/>
						</token-map-source-col>
						<token-map-source-col name="OrgType">
							<token-local-variable name="lv.group.type"/>
						</token-map-source-col>
					</token-map>
				</arg-node-set>
			</do-set-local-variable>

Example from a trace file:

[12/06/24 15:42:36.715]:NULL_GROUPMANAGEMENT ST:    Applying rule 'create group - SUB'.
[12/06/24 15:42:36.715]:NULL_GROUPMANAGEMENT ST:      Action: do-set-local-variable("lv.check.groupType",scope="policy","SUB").
[12/06/24 15:42:36.715]:NULL_GROUPMANAGEMENT ST:        arg-string("SUB")
[12/06/24 15:42:36.715]:NULL_GROUPMANAGEMENT ST:          token-text("SUB")
[12/06/24 15:42:36.715]:NULL_GROUPMANAGEMENT ST:          Arg Value: "SUB".
[12/06/24 15:42:36.715]:NULL_GROUPMANAGEMENT ST:      Action: do-set-local-variable("lv.group.description",scope="policy","v "+token-local-variable("lv.group.name")).
[12/06/24 15:42:36.716]:NULL_GROUPMANAGEMENT ST:        arg-string("v "+token-local-variable("lv.group.name"))
[12/06/24 15:42:36.716]:NULL_GROUPMANAGEMENT ST:          token-text("v ")
[12/06/24 15:42:36.716]:NULL_GROUPMANAGEMENT ST:          token-local-variable("lv.group.name")
[12/06/24 15:42:36.716]:NULL_GROUPMANAGEMENT ST:            Token Value: "Customerdata".
[12/06/24 15:42:36.717]:NULL_GROUPMANAGEMENT ST:          Arg Value: "v customerdata".
[12/06/24 15:42:36.717]:NULL_GROUPMANAGEMENT ST:      Action: do-set-local-variable("lv.group.create",scope="policy",arg-node-set(token-map("..\..\customerMappingTable\customerMappingTable","Active",default-value="-1",source="Buchungskreis",type="AND",token-map-source-col("Buchun
gskreis",token-local-variable("lv.o.bukrs"))+token-map-source-col("GroupType",token-local-variable("lv.check.groupType"))+token-map-source-col("OrgType",token-local-variable("lv.group.type"))))).
[12/06/24 15:42:36.718]:NULL_GROUPMANAGEMENT ST:        arg-node-set(token-map("..\..\customerMappingTable\customerMappingTable","Active",default-value="-1",source="Buchungskreis",type="AND",token-map-source-col("Buchungskreis",token-local-variable("lv.o.bukrs"))+token-map-source
-col("GroupType",token-local-variable("lv.check.groupType"))+token-map-source-col("OrgType",token-local-variable("lv.group.type"))))
[12/06/24 15:42:36.719]:NULL_GROUPMANAGEMENT ST:          token-map("..\..\customerMappingTable\customerMappingTable","Active",default-value="-1",source="Buchungskreis",type="AND",token-map-source-col("Buchungskreis",token-local-variable("lv.o.bukrs"))+token-map-source-col("Group
Type",token-local-variable("lv.check.groupType"))+token-map-source-col("OrgType",token-local-variable("lv.group.type")))
[12/06/24 15:42:36.719]:NULL_GROUPMANAGEMENT ST:            token-map("..\..\customer_mapping-tables\customerMappingTable","Active",default-value="-1",source="Buchungskreis",type="AND",token-map-source-col("Buchungskreis",token-local-variable("lv.o.bukrs"))+token-map-source-col("Gro
upType",token-local-variable("lv.check.groupType"))+token-map-source-col("OrgType",token-local-variable("lv.group.type")))
[12/06/24 15:42:36.720]:NULL_GROUPMANAGEMENT ST:              token-map-source-col("Buchungskreis",token-local-variable("lv.o.bukrs"))
[12/06/24 15:42:36.721]:NULL_GROUPMANAGEMENT ST:                token-map-source-col("Buchungskreis",token-local-variable("lv.o.bukrs"))
[12/06/24 15:42:36.721]:NULL_GROUPMANAGEMENT ST:                  token-local-variable("lv.o.bukrs")
[12/06/24 15:42:36.721]:NULL_GROUPMANAGEMENT ST:                    Token Value: "5555".
[12/06/24 15:42:36.721]:NULL_GROUPMANAGEMENT ST:                  Arg Value: "5555".
[12/06/24 15:42:36.721]:NULL_GROUPMANAGEMENT ST:                Token Value: "[Buchungskreis, 5555]".
[12/06/24 15:42:36.722]:NULL_GROUPMANAGEMENT ST:              token-map-source-col("GroupType",token-local-variable("lv.check.groupType"))
[12/06/24 15:42:36.722]:NULL_GROUPMANAGEMENT ST:                token-map-source-col("GroupType",token-local-variable("lv.check.groupType"))
[12/06/24 15:42:36.722]:NULL_GROUPMANAGEMENT ST:                  token-local-variable("lv.check.groupType")
[12/06/24 15:42:36.722]:NULL_GROUPMANAGEMENT ST:                    Token Value: "SUB".
[12/06/24 15:42:36.723]:NULL_GROUPMANAGEMENT ST:                  Arg Value: "SUB".
[12/06/24 15:42:36.723]:NULL_GROUPMANAGEMENT ST:                Token Value: "[GroupType, SUB]".
[12/06/24 15:42:36.723]:NULL_GROUPMANAGEMENT ST:              token-map-source-col("OrgType",token-local-variable("lv.group.type"))
[12/06/24 15:42:36.723]:NULL_GROUPMANAGEMENT ST:                token-map-source-col("OrgType",token-local-variable("lv.group.type"))
[12/06/24 15:42:36.723]:NULL_GROUPMANAGEMENT ST:                  token-local-variable("lv.group.type")
[12/06/24 15:42:36.724]:NULL_GROUPMANAGEMENT ST:                    Token Value: "Z".
[12/06/24 15:42:36.724]:NULL_GROUPMANAGEMENT ST:                  Arg Value: "Z".
[12/06/24 15:42:36.724]:NULL_GROUPMANAGEMENT ST:                Token Value: "[OrgType, Z]".
[12/06/24 15:42:36.724]:NULL_GROUPMANAGEMENT ST:              Arg Value: "[Buchungskreis, 5555],[GroupType, SUB],[OrgType, Z]".
[12/06/24 15:42:36.724]:NULL_GROUPMANAGEMENT ST:          Token Value: {"1","0"}.
[12/06/24 15:42:36.725]:NULL_GROUPMANAGEMENT ST:          Arg Value: {"1","0"}.
[12/06/24 15:42:36.725]:NULL_GROUPMANAGEMENT ST:      Action: do-if().
[12/06/24 15:42:36.725]:NULL_GROUPMANAGEMENT ST:        Evaluating conditions.

Example "arg-value" for the search from the logs

Arg Value: "[Bukrs, 5555],[Group, SUB],[Name, Z]".

Result:

Arg Value: {"1","0"}.

Correct result should be only "0"

I defnied the variable as a nodeset, to see if I really get multiple matches and I don't know why I got multiple matches.

I also set the parameter 'type="AND">' on the "token-map" element with no success.

Does anyone has an idea why I got multiple matches? For me it seems likem that the matching in the mapping table is not working correctly.

IDM Version is 4.9

BR

Tobias

Edit: 09.12: Initials Post extended by further useful information.

Parents
  • 0  

    I did a little bit of testing and I can tell, that there is something off with the return-values.I marked the results green (assumption based on the return values)


    If I know change the values  in "active", so that they are more 'unique' - then it seems to work correctly:


    For the moment, I will go with the last approach. At least for the time beeing and probably will also open a ticket.

  • Suggested Answer

    0   in reply to   

    You know, you might be hitting a 'feature' of the Map token most people don't know about!  Only place I ever saw it was in my book, and only because Shon told me about it.

    If you use a simple Src-Dest Map token, and say Src is GroupType=LEADER, you are going to get the first value as a string (I think) and ALL The values as a nodeset.

    This is super useful. 

    But what does that mean when two columns have multiple possible matches in a 2 column select case?  I suspect you are seeing the results.

    You can do this in XPATH if Map is not working, it is just slower.

    load your varibale XML into a nodeset variable called $lv.table

    then XPATH Of:

    $lv.table/mapping-table/row[col[1]=$lv.o.bukrs][col[2]=$lv.check.groupType][col[3]=$lv.group.type]/text()

    That will only work until you reorder the columns  There is a cleverer way to figure out the column names from col-defs but I am lazy and it is early in the morning here.

Reply
  • Suggested Answer

    0   in reply to   

    You know, you might be hitting a 'feature' of the Map token most people don't know about!  Only place I ever saw it was in my book, and only because Shon told me about it.

    If you use a simple Src-Dest Map token, and say Src is GroupType=LEADER, you are going to get the first value as a string (I think) and ALL The values as a nodeset.

    This is super useful. 

    But what does that mean when two columns have multiple possible matches in a 2 column select case?  I suspect you are seeing the results.

    You can do this in XPATH if Map is not working, it is just slower.

    load your varibale XML into a nodeset variable called $lv.table

    then XPATH Of:

    $lv.table/mapping-table/row[col[1]=$lv.o.bukrs][col[2]=$lv.check.groupType][col[3]=$lv.group.type]/text()

    That will only work until you reorder the columns  There is a cleverer way to figure out the column names from col-defs but I am lazy and it is early in the morning here.

Children
  • 0   in reply to   

    What I have observed is that if there are several matches and I also want the results from the several matches, then I would use a nodeset to have all the values here. For a result, I use the classic string.

    Sorry for the possibly stupid question. (I may also not understand the answer of you 100%)
    But I shouldn't even get into the case with “But what does that mean when two columns have multiple possible matches in a 2 column select case?”
    In my 3 column case, this combination is unique in the mapping table, so I should only get one result back either way.
    (either way, a bug ticket will be opened when the time comes)

    Thanks for the info with XPATH and the help with the problem in general! I will definitely make a note of this option with XPATH.