WRD schema tag

18 views
Skip to first unread message

Anferney Grotestam

unread,
Sep 8, 2025, 8:59:14 AMSep 8
to General WebHare developers discussion
I have noticed that there has been a change in how wrd tags are being handeled when create wrdschemas.

In the moduledefinition.xml it used to be something like this:
<schema tag="mso:eventschema" autocreate="true" definitionfile="mod::mso/data/events.wrdschema.xml" />
This would, in return, create a wrdschema with the tag "mso:eventschema".

Now since i believe WH 5.7.2, this will now create a wrdschema with the tag "mso:mso:eventschema".
This now causes many of our wrdschemas not to be claimed by a module.

A colleague of mine has WH 5.7.1 and he is not experiencing this issue.

Is there a way that we can set this to the old behavior?
Or is there anything else that we have to do?
Or are we expected to update our modules and rename the wrdschema manually?

Arnold Hendriks

unread,
Sep 8, 2025, 10:17:21 AMSep 8
to General WebHare developers discussion
Our intention was always that you shouldn't prefix the wrdschema in the moduledefinition.xml, but apparently this slipped through the parsing until 5.7.2 then

Did you expect/want this to create mso:mso:eventschema or just mso:eventschema ?  Do you need to use the moduledefinition for module 'A" to create modules in module 'B' ?

How much effort is it to simply drop 'mso:' from here and similar situations? that would immediately resolve it and work over all versions, and is probably less effort than backporting and rolling out fixes, especially as we would otherwise be dropping support for module-prefixing schemas in moduledefintition anyway

(as in moduledefiniton.yml this would simply be:

wrdSchemas:
  eventschema:
    schema: data/events.wrdschema.xml

and we currently don't have support for module: prefixing either. which is probably why the XML version forgot about it too)

Wouter Hendriks

unread,
Sep 8, 2025, 11:27:01 AMSep 8
to General WebHare developers discussion, Arnold Hendriks
Had the same. Afaik you can just remove the "mso:" from the 'tag' attribute and it should work.

Anferney Grotestam

unread,
Sep 9, 2025, 2:41:16 AMSep 9
to General WebHare developers discussion, Wouter Hendriks, Arnold Hendriks
Alright. We'll just remove the prefixes. Thank you.

Op maandag 8 september 2025 om 17:27:01 UTC+2 schreef Wouter Hendriks:

Anferney Grotestam

unread,
Sep 9, 2025, 5:52:48 AMSep 9
to General WebHare developers discussion, Anferney Grotestam, Wouter Hendriks, Arnold Hendriks
i still have some issues with GetSchemaSetting.

I have changed "mycompany_safety_apps:*" to "safety_apps_*" in the moduledefinition.

In HareScript i also refer to the schema settins like using "mycompany:safety_apps_issues.safety_responsible_guid" like so:
STRING safety_responsible_guid := this->wrdschema->GetSchemaSetting("safety_apps_issues.safety_responsible_guid")

when running the code i get this error:
Exception EXCEPTION: Cannot find key MYCOMPANY:SAFETY_APPS_ISSUES.SAFETY_RESPONSIBLE_GUID and no fallback value set.
At mod::wrd/lib/internal/wrdschema.whlib(262,13)

I have also tried getting the schemasetting by using "safety_apps_issues.safety_responsible_guid" as key, but then i get the following error:
Exception EXCEPTION: Illegal key name 'safety_apps_issues.safety_responsible_guid'.
At mod::wrd/lib/internal/wrdschema.whlib(55,11)

How should i go about this now?

Op dinsdag 9 september 2025 om 08:41:16 UTC+2 schreef Anferney Grotestam:

Arnold Hendriks

unread,
Sep 9, 2025, 6:23:28 AMSep 9
to General WebHare developers discussion
You shouldn't remove the prefixes for the schema settings - so different modules can have their schema settings separated. 

(although error is simply because you never did a *SetSchemaSetting* with that key)

Also: we're working on deprecating 'wrd schema settings' (and will not be adding typescript APIs to access them) so if you're at least on WH5.8+ (current beta. this all might work in earlier versions too) I would recommend:

  <extend tag="wrd_settings">
    <attributes>
      <domain tag="mycompany$safety_responsible" domain="wrd_person" /> 
    </attributes>
  </extend>

and using GetWRDSetting, GetWRDSettings, SetWRDSetting, SetWRDSettings from mod::wrd/lib/api.whlib to manipulate these

Using the wrdSettings type (And the single wrd settings entity) generally works better for storing settings, as you get access to all WRD types, can set unsafetocopy="true" on API keys, the WRD browser can view/edit these entities... 

(we 'discovered' schemas settings (which we based on the registry) have no real advantages over actual wrd fields/settings)

Using '$' as a schema separator when adding fields to 'someone else's' type is a new feature  (and HareScript has been modified to accept '$" in variable/cell names to allow this) and is less ambiguous than using underscores.

No rush to update existing applications yet but you should do this for new code. Schema settings aren't going away yet - we still need to build an alternative for WRD sequence numbers
Reply all
Reply to author
Forward
0 new messages