cancel
Showing results for 
Search instead for 
Did you mean: 

Cross-MTA Dependency & Destinations

Steven_UM
Contributor

Hi,

I have 2 MTA applications ( in the same org and space ) - one hosting a number of API/ODATA services and another hosting a number of UI5 apps.

Within the UI5 apps I want to define model destinations which reference the API services from the other MTA.

Hence I followed the principle of 'Cross-MTA Dependency' using 'Resource Type “mta-provided”' as explained in the SAP help.

Now in essence this works fine but I am having an issue to pass along the 'url' of the service into the destination.

As per normal destination definition - a url needs to be provided:

So I am guessing that the URL parameter is not 'transferred' between the MTA's as I am getting the error during deployment:

Failed to resolve reference for provided property: 22058223-a79f-45aa-8407-5304bfeb2989-ta8xo1ynf0zp1qba-<xxxx>#services-api#url

If I include the API services within the same MTA then this works fine.

If I 'hard-code' the urls in the consumer mta.yaml then my applications work fine as well.

I have the following definitions in the mta.yaml files:


Provider

modules:
  - name: bc-services-core-api
    type: nodejs
    path: services_api
    provides:
      - name: bc-services-api
        public: true
        properties:
          url: '${default-url}'

Consumer

modules:
  - name: app
    type: html5
    path: app
    requires:
      - name: bc-services-api
        group: destinations
        properties:
          name: services-api
          url: '~{url}'
          forwardAuthToken: true

resources:
  - name: bc-services-api
    type: mta-provided
    parameters:
      mta-id: BC_<XXXX>
      mta-provides-dependency: bc-services-api
      mta-version: '>=0.0.1'

In the SAP help there is small topic about properties which talks about 'cross-reference' of properties and putting a 'requires' under the resources ... but whatever I try I am not able to save the MTA.YAML file then ...

Anyone any suggestions on how to resolve this ? Or am I missing or declared something wrong in the yaml file ?

Also note I am trying this currently out on an HANA Express SPS3 system ( latest patches ) but this needs to run in the cloudfoundry platform eventually ( hopefully there are no differences ).

Thanks,

Steven

0 Kudos

Hi Steven,

I hope you coped with the XSA as well.
If you have other issues related to MTA deployment, please tell.

Best Regards,
Boyan

abdel_dadouche
Active Contributor

Thanks for sharing this question, it helped me a lot to find that it was possible. I used it in HANA 1.0 SPS12 with XSA!

Hi abdelhalim.dadouche,

Could you please let me know how you integrate with UI5 with the APIs?

Do you set the route in xs-app.json?

Regards,

Tri

abdel_dadouche
Active Contributor

Hi trimle ,

Yes exactly that, I used the xs-app.json and implemented pattern that would match my external url.

My use case was fairly simple: I need to "host" the SAPUI5 libraries locally on a HANA 1.0 SPS 12 instance while using developing with XSA with the constraint that the server and client have no internet access.

Accepted Solutions (0)

Answers (1)

Answers (1)

Dimitar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sven,

Your code snippets seem to be properly modeled for the task. Have you double-checked if the 'mta-provided' parameter values are correct? This can be easily done, as at least on cf, when deploying the provider MTA in the progress messages similar rows are printed:

> Publishing publicly provided dependency "<mta-id>:<dependency name>"...

The <mta-id> value and <dependency name> value should be used for the mta-id and mta-provides-dependency parameters of the mta-provided resource.

By the way, there is another way to consume such cross-mta provided configurations - via a 'configuration' resource, which has certain benefits over 'mta-provided'. Below should be a working modelling for your case. Once you get this tested, remember to add additional filters to the configuration resources (e.g. org/space of dependency origin) to prevent side effects in production - e.g. of deployments of other mtas in different spaces .

resources:
- name: bc-services-api
  type: configuration
  parameters:
    provider-nid: mta
    provider-id: <your-mta-ID>:bc-services-api
modules:
  - name: app
    ...
    requires:
      - name: bc-services-api
        properties:
          url: '~{url}'

Please reply if the resolution is still failing.

Dimitar

Steven_UM
Contributor
0 Kudos

Thanks Dimitar ... works like a charm - well at least in the cloud.

Didn't try it yet on HANA XSA - what I did notice there though is that by doing 'xs mtas' that my MTA was not listed there .... bit weird but maybe as I directly choose the 'run option' it is not actually registering as being 'deployed' ?