“A little conflict can create a lot of activity.” –Richie Norton
The conflict we’re addressing today is that more and more systems, especially modern SaaS systems, are moving to different authorization protocols.
- Authorization Micro Services: “I need to generate a token automatically and pass that token into all of my subsequent RESTful web service calls. It’s not necessarily a proper protocol, but that’s how you work with our APIs.”
- Data Abstraction: We use this in SBM as TS-IDS. The item identifier that might come back from a web service call may not actually be the human-readable identifier for an item ID. We have internal identifiers that come back, and the actual values are stored in a different table.
- Lack of Data Consistency: Depending on the system that you’re querying, you might get back an all-lowercase new value, a camel-case new value, or all caps. Every system stores these items a little differently.
And there are several other conflicts or challenges that we have with external systems when we bring all of these together. So how do we handle these types of challenges?
We can do direct database reporting: Within SBM, we provide several different methods of reporting against systems:
- With the Data Service, we can actually connect directly to a database and add a web services layer on top of these databases that may not actually have web services exposed.
- We can do the same thing with Advanced Reporting—we actually pull these and you’re able to use our reporting engine to get back the actual data with a SQL query.
- We can also use ModScript and RESTful Web Services. This is an interesting option, because most people don’t think about the ModScript engine in terms of being able to actually query other systems and use it to report all of that data coming back. How can we actually do that?
Let’s start by diving into what ModScript is. ModScript was first introduced in SBM 11.2 or 11.3. With every SBM release, we’ve been improving ModScript and adding more features and functionality.
ModScript has contextual awareness, so it knows things like whether you’re trying to execute the script in the context of a transition, if you’re directly invoking the script, or if it’s being invoked by a URL. Since we can invoke these scripts via a URL , we can return back HTML, but we can also return back JSON—and JSON is the de facto standard for web service calls when you’re using the REST protocol.
There are several uses for Modscript:
- We can do server-side integrations and processing data
- We can utilize external DLLs
- We can perform database-level integrations with SBM
- We can execute external Command Line commands
This works when we use ModScript as a proxy, so everything is as-a-service. As shown in the diagram below, ModScript can be invoked by an SBM URL. The script then executes, and that script is written so that we request the authorization token. The destination system would then send back our authorization token, and we would perform the RESTful web service call to retrieve the dataset with that token in place in the payload. The destination system would send back the dataset that we need, and our script would process that data. Finally, ModScript returns the data to the user.
When we say “The script processes the data,” this processing can happen a few different ways. If the service sends back everything exactly the way we need it and we just need to be able to handle that authorization – great! In some cases, we may want to format the data, or we have any of those data consistency issues that we mentioned above. For example, you might want to change a lowercase “low priority” field title to a camel case to match your other data. Or you may want to trim off some system value that’s appended to the end. In our demo, we go through how we would do that within the ModScript itself.
Check out our webinar recording for Reporting with Complex Systems here, which includes a great demo of ModScript used as a proxy integrated with Micro Focus Service Management Automation X (SMA-X). We’ll generate an authentication token and normalize some data being returned to what we would see out of SBM. We’ll also show you how we return JSON from an already existing report.
See our Discovering SBM page for all of our webinars covering a range of SBM features and functionality. And, as always, we want to hear from you! Tell us what you want to hear more about or anything you’d like to see addressed in an upcoming session.