go to post Tom Philippi · Nov 27, 2017 Okay, I found my error. Somehow my catch-all construction had become empty instead of triggering an Ens.Alert....
go to post Tom Philippi · Nov 27, 2017 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)
go to post Tom Philippi · Nov 27, 2017 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=""Omschrijving""></assign><return>1</return></when><otherwise><assign property="EventDescription" value=""Onbekende event-code""></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.
go to post Tom Philippi · Nov 27, 2017 Ok I have updated my question with the actual code.I figured out how to work with the <return> value, and I think that the assign might work as well, but I just can't get the condition to work. I doesn't seem to trigger on "request.EventCode=2103" even though the BPL processes a message where the request.EventCode=2103.
go to post Tom Philippi · Nov 27, 2017 Yes, I am aware that you can call a Transform and then fill the context in a BPL-process. It is very important trick I think. However, I have the feeling that a business rule will be more manageable than a data transformation assigning values to 150 different codes.
go to post Tom Philippi · Nov 27, 2017 This one is also very useful:Setting Up RESTful Services Ver.02https://learning.intersystems.com/course/view.php?id=776
go to post Tom Philippi · Nov 23, 2017 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>
go to post Tom Philippi · Nov 23, 2017 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.