Dear Endrju,
thanks for posting the code for the GRAPHREP attribute. From the code, I do believe that Line 7 is the critical one. Actually, when looking at the code, the statement would result in the behaviour as described since the "token" statement would convert the string representation of the interref into a string token/array split by "space" and the combining it with "<" at the beginning and ">" at the end. As a result, the space will also be problematic. Additionally you currently "loose" hyperlink functionality.
The solution I would propose to you is formatting the INTERREF attribute representation in the GRAPHREP. Using the optional "format" paramater, the INTERREF can be customized to a custom representation. Valid format elements are listed below:
1%m the name (basename with version) of the referenced model,
2%M the basename of the referenced model (if versioning is active),
3%v the short version number of the referenced model (if versioning is active),
4%V the long version number of the referenced model (if versioning is active),
5%t the model type name of the referenced model,
6%o the name of the referenced object (just for object references),
7%c the class name of the referenced object (just for object references).
In order to give you some hints on possible implementations, please find below a GRAPHREP implementation that demonstrates how single and multiple INTERREFs could be formatted and represented. I do believe that the your case is covered in line 29-31. In addition also a screenshot from an interref GRAPHREP library, the necessary ABL and ADL to also make use of this library in your environment.
1GRAPHREP
2FILL color:darkred
3ROUNDRECT x:-1cm y:-0.5cm w:2cm h:1cm rx:0.1cm ry:0.1cm
4FONT color:white
5TEXT "SOURCE" w:c h:c
6FONT
7ATTR "Name" x:-1cm y:0.8cm w:l h:c
8FONT h:8pt
9AVAL sir:"Single instance interref"
10AVAL mir:"Multiple instance interref"
11IF (LEN sir)
12
13 # Shows the full interref as a hyperlink
14 TEXT "Full interref as link" x:-1cm y:1.6cm w:l
15 ATTR "Single instance interref" x:3cm y:1.6cm w:l
16
17 # Shows only the modelname of interref as a hyperlink
18 TEXT "Only modelname as link" x:-1cm y:2cm w:l
19 ATTR "Single instance interref" format:"%m" x:3cm y:2cm w:l
20
21 # Shows only the instancename of interref as a hyperlink
22 TEXT "Only instancename as link" x:-1cm y:2.4cm w:l
23 ATTR "Single instance interref" format:"%o" x:3cm y:2.4cm w:l
24
25 # Shows interref as a hyperlink with a different text
26 TEXT "Only instancename as link" x:-1cm y:2.8cm w:l
27 ATTR "Single instance interref" text:"HUGO" x:3cm y:2.8cm w:l
28
29 # Formatted interref
30 TEXT "Formatted interref" x:-1cm y:3.2cm w:l
31 ATTR "Single instance interref" format:"<%o>" x:3cm y:3.2cm w:l
32
33 # Constructed interref representation using aval
34 TEXT "Formatted interref using aval" x:-1cm y:3.6cm w:l
35 AVAL set-format:"%o" singleref:"Single instance interref"
36 SET singleref: (cond(LEN singleref <= 4, singleref, copy(singleref, 0, 4)))
37 ATTR "Single instance interref" text: (singleref) x:3cm y:3.6cm w:l
38
39 # Constructed interref representation using aval
40 TEXT "Formatted interref without link" x:-1cm y:4cm w:l
41 AVAL set-format:"%o" singleref:"Single instance interref"
42 TEXT (singleref) x:3cm y:4cm w:l
43ELSIF (LEN mir)
44
45 # Shows all interrefs
46 TEXT "All interrefs (list)" x:-1cm y:1.6cm w:l
47 ATTRBOX "Multiple instance interref" x:7cm y:1.6cm w:l
48 ATTR "Multiple instance interref" x:3cm y:1.6cm w:l
49
50 # Shows all interrefs with seperator
51 TEXT "All interrefs (seperator)" x:-1cm y: (texty2) w:l
52 ATTR "Multiple instance interref" sep:"," x:3cm y: (texty2) w:l
53
54 # Shows all interrefs with seperator and formatted
55 TEXT "All interrefs (format, seperator)" x:-1cm y: (texty2 + 0.4cm) w:l
56 ATTR "Multiple instance interref" format:"%o" sep:"," x:3cm y: (texty2 + 0.4cm) w:l
57
58 # Constructed format using AVAL (truncated number of characters1.20.8cm) w:l
59 TEXT "All interrefs (format using aval)" x:-1cm y: (texty2 + 0.8cm) w:l
60 AVAL set-format:"%o" set-sep:":" ref:"Multiple instance interref"
61 SET ref: (
62 set(r, ""),
63 fortok(t, ref, ":", (
64 set(r, cond(LEN r, r + ":", "") +
65 cond(LEN t <= 10, t, copy(t, 0, 4)))
66 )),
67 r)
68 ATTR "Multiple instance interref" text: (ref) format:"%o" sep:":" x:3cm y: (texty2 + 0.8cm) w:l
69
70ENDIF
.