- Log in to post comments
Unfortunately, you're probably going to have to convert the patterns by hand, and the regex syntax is slightly different from the traditional pattern match syntax, starting with the fact that repetition count comes after the item being matched. For example the pattern 1.6N becomes the regex \d{1,6}.
Fortunately, once you've got your patterns converted to regexes, you can use the regexes from Caché code thanks to the $Locate and $Match functions, as well as the %Regex.Matcher class which provides a richer interface to regex functionality.
- Log in to post comments
The other answers point to some good resources that you should definitely look at. That said, the answer to your question is to build a REST API. You will need to create a new class that is a subclass of the %CSP.REST class. You can then add a UrlMap block that maps URLs to ClassMethods. Here's a simple example of such a dispatch class:
Class REST.Handler Extends %CSP.REST{Parameter UseSession As Integer = 1;/// The UrlMap determines how a Url should map to a HTTP Method and a Target ClassMethod/// indicated by the 'call' attribute. The call attribute is either the name of a method/// or the name of a class and method seperated by a ':'./// parameters within the URL preceeded by a ':' will be extracted from the supplied URL/// and passed as arguments to the named method.XData UrlMap{<Routes><Route Url="/HelloWorld" Method="GET" Call="HelloWorld" /></Routes>}/// A simple test method to ensure that the REST infrastructure is workingClassMethod HelloWorld(){Set obj = { "message": "Hello from REST" }Write obj.%ToJSON()Quit $$$OK}}Finally, you need to create a new web application in the System Management portal and set your class as the Dispatch Class. Once you have the dispatch class and web application set up, you can point your Angular app to the corresponding URL and use it like you would any other REST API.
- Log in to post comments
This is exactly what we do. We have an APP-CODE database, and the CI build process is basically:
This way we can be sure that what is being tested in CI always matches what is in source control.