How to use a service in another module


I want to try to make a 4 layer website.

So I made a rijksmuseaumGalleryLibrary  which is a service as library layer. 

But when I made a Core layer which uses to make the json call and filter out the data I want I need to tell the Core layer that it has to use the library layer. But when I do add depencies the library layer is not found. 

is there a way I can make this work or did I begin this wrong ? 

Thanks, Still confused how things must be working in the 4 layer.

Right now I have in the Library and the core function the call to the api.

I thought in the library I need the put the call to the api and use the outcome of that in the core library so I can filter out the data that I need. 

I have included the package at this moment. 

Hi, do orchestration:

# put db external in a separate module

# put common function in a separate module, say it all consume web services

# put all functions that consumes that common function in separate module, say it functions that consumes the external web services, bpt, and web services as  producers those consumed by external.

# put all UI screens on separate modules

Thats it

# make sure not to create cyclic dependencies

yep., I try to make that work but got confused during the way..

I hope that someone is looking at my code and helps me to make the first call work. 

Hi Roelof,

I don't get what the issue you are having, then again, I don;t understand your code as well.

Your GetFirstData is indeed public but it does not return any data. it simply calls the webservice.

You have to add an output-parameter to that action and provide data to that output-parameter otherwise you are not getting anything.

oke, and then I can use the GetFirstData output parameter to fill in a stuct or a record with the data I need and put that data in another output parameter that the display module uses to display things. 

1) Am I on the right track that both modules are in fact service modules or do I need that the core module is another module sort for example a blank web module. 

2) the output parameter of GetFirstData needs should then be a list of Paintings so I need to make a record or a struct that holds all the properties of the recived json ? 

# create web service by test  example and outsystems will do the rest - create outsystems structures, deserialize json to that structure - if you have copied the sample request and the sample response.

# put that producer web service in a blank core module to be consumed by external

# then refactor - once functionality achieved, deep think on maintaianability, performance, etc -  it based on your project needs

Hey Roelof,

That's up to you to decide. You have to think upfront how do you want to access the data and why.

There are more ways to rome than we think.

You have to think what you want to achieve and why. This will decide how your application is going to look like and how the architecture will be.

I would advise against service modules if you don't know what the impact is.