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.
go to post Tom Philippi · Aug 23, 2017 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>
go to post Tom Philippi · Aug 23, 2017 Jeffrey,Yes I am looking for something along those lines. I'd like to use the a combination of data from the request that started the process and context variables that where filled by earlier calls in the process as input for a data transformation. I do not know how to achieve that.
go to post Tom Philippi · Aug 17, 2017 This was the answer:I resolved this by adding the code to the Business Operation class instead: Set header=##class(SforceService.tns.LoginScopeHeader).%New() Set header.organizationId= "MyOrganizationId" Do ..Adapter.%Client.HeadersOut.SetAt(header, "SforceService.tns.LoginScopeHeader")
go to post Tom Philippi · Aug 17, 2017 Okay, I resolved this by adding the code to the Business Operation class instead: Set header=##class(SforceService.tns.LoginScopeHeader).%New() Set header.organizationId= "MyOrganizationId" Do ..Adapter.%Client.HeadersOut.SetAt(header, "SforceService.tns.LoginScopeHeader")
go to post Tom Philippi · Aug 14, 2017 Thanks for your input. So it is a compilation problem and not an import problem. I tried some of your suggestions and added the (unsuccessful) results to the starting post.
go to post Tom Philippi · May 9, 2017 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 definitionBlue -> Provided via system default settingsBlack -> Provided as production setting (in xml that extends ens.production )