I figured out there is a function called SendFormDataURL where you can include the tURL as the first parameter:

set tURL = ..Adapter.URL_"login/login"

set httpRequest = ##class(%Net.HttpRequest).%New()
    set httpRequest.ContentType="application/json"
    do ..ObjectToJSONStream(pRequest,.jsonStream,"aeliw")
    set httpRequest.EntityBody = jsonStream
    
    set tSC = ..Adapter.SendFormDataURL(tURL,.tHttpResponse,"POST",httpRequest)
    

Ok, I figured it out. Turns out I had to set the context of the business rule to BusinessProces.Context (and context with a capital C). The business rule then detected all my context variables when filling out the rules. Importantly I found that if you return a string value you must include "" and when you return a boolean you must use 0 or 1 (true or false doesn't work). Here is the code i used:

<ruleDefinition alias="" context="CareHome.NewEventRouter.Context" production="">
<ruleSet name="" effectiveBegin="" effectiveEnd="">
<rule name="Assess Event Code" disabled="false">
<when condition="EventCode=2103">
<assign property="EventDescription" value="&quot;Omschrijving&quot;"></assign>
<return>1</return>
</when>
<otherwise>
<assign property="EventDescription" value="&quot;Onbekende event-code&quot;"></assign>
<return>1</return>
</otherwise>
</rule>
</ruleSet>
</ruleDefinition>

When calling the rule from the business process I used:

<rule name='Fire Rule' rule='CareHome.DetermineEventFollowUp'  resultLocation='context.CreateCase' ruleContext='context' xpos='200' ypos='350' >
</rule>

Important here is that if you include a resultLocation, you must give a return value in the business rule otherwise the value context.CreateCase is cleared (it had a default value of 0). Also, notice that the resultLocation is not required. An alternative implementation is to leave it empty and use assign in the business rule for both EventDescription and CreateCase.

Ok I updated the apache.conf and it seems to work now. This is what I ended up with:

<Directory "/home/ubuntu/intersystems/fcoffice/csp/healthshare/fcoffice/rest">
    CSP On
        SetHandler csp-handler-sa
</Directory>
<Directory "/home/ubuntu/intersystems/fcoffice/csp">
    CSPFileTypes csp cls
    AllowOverride None
    Options MultiViews FollowSymLinks ExecCGI
    Require all granted
    <FilesMatch "\.(log|ini|pid|exe)$">
        Require all denied
    </FilesMatch>
</Directory>

I found this in the apache2.conf

<Directory "/home/ubuntu/intersystems/fcoffice/csp">
    CSPFileTypes csp cls zen cxw
    AllowOverride None
    Options MultiViews FollowSymLinks ExecCGI
    Require all granted
    <FilesMatch "\.(log|ini|pid|exe)$">
        Require all denied
    </FilesMatch>
</Directory>

I presume I somehow need to add url's here. How? I can't find any suggestions/examples in the documentation.

Well yes that works! I can refer to a context.MyString in any Data Transformation and when I use that Data Transformation in a business process that has a context.MyString defined it 'magically' works. I must say that I find this very unintuitive because when you test the data transformation using the test-button in the data transformation it actually errors because it doesn't know the context:

ERROR <Ens>ErrException: <UNDEFINED>zTransform+84^Calarm.Transformation.CreateCreateAccountRequest.1 *context -- logged as '-' number - @' Set zVALz=context.MyString, zVALz=$S($IsObject(zVALz):zVALz.%ConstructClone(), 1:zVALz)'

I got that error when trying to use the following input message with and without the context element:

<test>
  <context>
    <MyString>123</MyString>
  </context>
  <UserRegistrationRequest>
      <Customer>
          <Initials>P.</Initials>
          <Gender>M</Gender>
          <DateOfBirth>1983-01-01</DateOfBirth>
      </Customer>
  </UserRegistrationRequest>
</test>

I got it to work. Clearing the values from the production didn't work because an empty string was left behind in the production file. So I went to studio and deleted the parameter settings there.

When I then viewed the production (and reloading it) via the management portal the settings specified in the system default settings then turned green. Apparently there is some color coding going on:

Setting name:

Green -> provided via class definition

Blue -> Provided via system default settings

Black -> Provided as production setting (in xml that extends ens.production )