« Back

Intermodel references: Space character cuts words

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Intermodel references: Space character cuts words
community graphrep documentation attribute type
Answer
3/27/14 11:43 AM
Hello,

when I try to refer an attribute with the datatype "Intermodel reference" to an object of another model (which uses another modelling language), just the first word of the concrete obejct name (datatype String, Attribute "ClassName") can be seen, if a space character " " is being used. The other words are not printed. As a workaround, we currently use underlines "_", but the usability is affected by that.

Below you can see a visualisation of the issue:


This is the class attribute with the datatype "Intermodel reference" within the administration toolkit:


Below can be seen a concrete object "Cust. Service" which will be referred to in the next step (in the modelling toolkit):

As you can see on the right side here, just the first word "Cust." (and not "Cust. Service") is being displayed:


Are there approaches to fix this problem? Thanks a lot in advance.

Kind regards

Endrju Selimaj


RE: Intermodel references: Space character cuts words
Answer
12/27/13 7:25 AM as a reply to Endrju S. & Sobhi A..
Dear Endrju,

It seems that the problem lies with the graphical representation for the object Complaint Handling Product A.
Could you, please, post here the contents of the GraphRep or at least the line that displays the INTERREF attribute.

Thank you.
Sabin

RE: Intermodel references: Space character cuts words
Answer
1/7/14 4:42 PM as a reply to Sabin Popescu.
Dear Sabin,

thank you for the quick answer.
Complaint Handling Product A is an object of the class BusinessProcessType.
The content of the GraphRep of BusinessProcessType is this:

GRAPHREP STARTS:

_____________________________

 1GRAPHREP
 2BITMAPINFO "db:\\Business_Process_Type.png"
 3BITMAP "db:\\Business_Process_Type.png" x:0cm y:-.4cm w:(bmpwidth / 96 * 2.5cm) h:(bmpheight / 96 * 2.5cm)
 4
 5AVAL r:"role" # role
 6IF (LEN r)
 7  TEXT ("<" +token(r,0," ") + ">") x:1.1cm y:-.8cm w:c:2.8cm h:t
 8ELSE
 9#  TEXT "<Rolle>" x:(bmpwidth/96/2*2.5cm) y:-.8cm w:c:2.8cm h:t
10ENDIF
11
12AVAL id:"ID" # ID
13IF (LEN id)
14  TEXT ("- " + (id) + " -") x:(bmpwidth/96/2*2.5cm) y:.9cm w:c:2.8cm h:t
15  ATTR "Name" x:(bmpwidth/96/2*2.5cm) y:1.3cm w:c:2.8cm h:t
16ELSE
17  ATTR "Name" x:(bmpwidth/96/2*2.5cm) y:.8cm w:c:2.8cm h:t
18ENDIF
19
20AVAL set-default:"St" kn:"Bezeichnung"
21
22IF (kn="St")
23BITMAPINFO "db:\\Business_Process_Type.png"
24BITMAP "db:\\Business_Process_Type.png" x:0cm y:-.4cm w:(bmpwidth / 96 * 4.5cm) h:(bmpheight / 96 * 4.5cm)
25
26ENDIF

________________________

GRAPHREP ENDS

The relevant part starts at line 5.
Thank you in advance, kind regards

Endrju Selimaj

RE: Intermodel references: Space character cuts words
Answer
1/8/14 9:05 AM as a reply to Endrju S. & Sobhi A..
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


.
Attachment

Attachments: INTERREF Representation Library.PNG (107.2k), INTERREF Representation Library.abl (12.4k), INTERREF Representation Library.adl (3.3k)