Okay, I got it working. Thankx!
- Log in to post comments
Okay, I got it working. Thankx!
Yes! That's it. It works now!
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")
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.
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 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.
Yes I just found that while you posted :P
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>
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.
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.
I'll contact wrc.
Just figured it out myself; 01/01/1980 is accepted.
I have found the problem.
in the configuration of the adapter I set the server address to http://mandrillapp.com. I changed it to mandrillapp.com (without http://) and it worked!
Thanks! We just needed to install the certificates on the web server and not in InterSystems. Being able to configure SSL / TLS as a server with appropriate clients is somewhat confusing here because that can't be used for the web server and was also not clear from the documentation.
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 )
Ow that's pretty stupid ![]()
Thanks for the quick feedback!
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.
Thanks! It works now!
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")
This one is also very useful:
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.
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)
Okay, I found my error. Somehow my catch-all construction had become empty instead of triggering an Ens.Alert....