NB

Hello Community

I want to upload a text file on our ARIS Document Storage (ADS) through ARIS Scripting. We have a requirement to reuse that particular text file and add more data inside it. I am facing difficulty in

  1. Getting the text document from ADS
  2. Can we actually update documents through ARIS Scripting in ADS ?
  3. How to use ADS in ARIS Scripting ?
  4. Does ADS requires API’s to get and upload documents.

If you have documentation for ADS and how to use it with ARIS Scripting, fell free to provide links for the same.

Thanks in advance.

by Kay Fischbach
Posted on Wed, 05/19/2021 - 08:45

1. Getting the text document from ADS

Load the ADS Report component with

Context.getComponent("ADS")

as it's described here http://myaris10now.softwareag.com/abs/help/en/script/ba/index.htm#report_OBJECTS_ADSReportComponent.htm.

With that component it's up to you to somehow get access to an ADSDocument (http://myaris10now.softwareag.com/abs/help/en/script/ba/index.htm#report_OBJECTS_ADSDocument.htm). You can do that either with a hyperlink or by navigating through the document repository groups. All that matters is that you get your ADSDocument.

Next comes turning the InputStream that you get from the ADSDocument.getDocumentContent() method into a Byte Array. You want a Byte Array so that you can turn the document content easily into an ArisScript OutputObject and append stuff to it. Turning the InputStream into a ByteArray can be quite complicated.

If your ARIS Server has the Google Guava library (with server access you can look into \server\bin\work\work_abs_*\tools\lib for a file called guava-*.jar) you can use Packages.com.google.common.io.ByteStreams.toByteArray(yourInputStreamHere) to use the library method for turning an InputStream into a Byte Array.

You can then give this byte array alongside a file name to the ARIS standard method Context.getOutputObject to create an OutputObject with it. Write stuff to that OutputObject (I'm assuming you're familiar with the standard ARIS Script methods) and then write the output document to the output location (with the .WriteReport() method).

Sending the updated document content back to the ADS is much easier. The ARIS method Context.getFile can be used to get a Byte Array from your freshly written output file. Use the Byte Array to construct a new Packages.java.io.ByteArrayInputStream which can be used as a third parameter of the the ADSRepository.updateDocumentContent method to update your document content. You can probably figure out what the other parmeters are supposed to be.

2. Can we actually update documents through ARIS Scripting in ADS ?

Yes

3. How to use ADS in ARIS Scripting ?

See 1.

4. Does ADS requires API’s to get and upload documents

Well, the standard ARIS report components are enough. If your question is whether you have to use the REST API then "No" is the answer. You only have to use the REST API when you have a non ARIS application that produces content that is supposed to be stored in the ADS.

 

1
by Rogerio Souza
Posted on Wed, 11/10/2021 - 04:04

Thank you for your answer... this help so much!

1

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock