Integration Studio: Can Extension entities be created inside the eSpace?

Integration Studio: Can Extension entities be created inside the eSpace?

  
Hi, thanks for making this forum such a friendly and helpful environment.

There's probably something I'm missing, so I have this question:
How can I define a set of Entities that are managed (i.e. table creation and publishing) in an Extension, but are not necessarily in an external database schema?

I would like the Entity definitions in an Extension, but the tables themselves published with the eSpace. I'd like to define them using the OutSystems tools, not by reverse-engineering them from an existing database. Can that be done?

This is what I've tried to do (using OutSystems Express Edition v4.1.3.43):
Using the Integration Studio, I defined some Entities in an Extension, manually using Right-Click->"Add Entity".
In the Extension code, I have functions which use the Record Structures of those Entities.
In my eSpace, using the Service Studio, I added a reference to the extension and can use the Entity Record Structures, and the functions.
I had hoped the 1-Click Publish would create the tables for the Extension Entities, but this did not happen :-(
The message I get when I execute the solution is: <quote>
Invalid object name 'TC_PF_ProjectFile'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
... etc. </quote>
("TC_PF_ProjectFile" is the "Physical Table Name" I'd like the table to have)

Is the only way to have the Studio manage my Entities to define the entities in Service Studio instead, where they will be saved, and then to define parallel Structures that I use to pass records to and from functions in the extension?

I like the fact that my Entities can evolve more easily if the OutSystems platform manages them for me, rather than me managing them myself in an external database. However, it seems extra work to define the Entities in the Service Studio, and then again define identical Structures in the Integration Studio, so I feel I must be missing some trick :-)

Thanks for reading this, I hope I was clear enough! Please let me know if I wasn't.

Ashir
Hi Ashir,

Could you please help me understand why entities defined Service Studio don't work for you?
Regards,
Mário
Hi, Mario

Thank you for responding.

I need to perform Create/Retrieve/Update/Delete on entities defined in the eSpace (using the Service Studio).
I'd prefer not to define these entities in a separate database and then integrate them using Integration Studio.

What is the best way to achieve that?
Regards,
Ashir
Hi Ashir,

In Service Studio you can create your entities and perform Create/Retrieve/Update/Delete operations without the need to use Integration Studio.

Integration Studio may be used to import tables from external databases into your application (eSpace). Once imported, in Service Studio you will also be able to to perform Create/Retrieve/Update/Delete operations.

Did you have the chance to take the Tutorial? It's a great way for you to start. It's available at http://www.outsystems.com/Tutorial/.
Regards,
Mário
Hi again, Mário

I should give more detail to make my situation clearer:

We have a project/eSpace, which needs to obtain data from an Excel spreadsheet.

The built-in Excel functionality is not enough, as the spreadsheet, which is obtained from an external third party and cannot be modified by us, is formatted in a way that is not usable via dataset adapters. I've written and tested some separate C# code that achieves what we want outside of the OutSystems eSpace.

It was easy integrate this functionality by means of an extension.

Now ideally, I want to store the parsed data in entities defined in the eSpace. I realise that one way to do this is to pass the data as "out" parameters in Structures & Record Lists, then to update the database inside the eSpace. (This is currently how we are doing it.)

Further, we would like the extension to read the eSpace entities, as we need it to perform validation of the data in the spreadsheet against data in the solution database. This is the hard part, do you have any suggestions in this regard? Should I let my C# code "look inside" the eSpace tables in the OutSystems database?

The tutorial is excellent, thanks for it! But it unfortunately does not answer this (above) question for me :-(
Thanks,
Ashir
Hi Ashir,

To store your extension's data in Service Studio entities, you should use Service Studio as it supports you with simple queries, entity actions and all related db features:
1. Import your data from excel (using your extension)
2. Perform spreadsheet validation (within service studio)
3. Store data (within service studio)

I believe this approach would be the best to keep a clean and simple architecture.

Additionally and FYI, record lists are passed by reference, which means that you don't need to have an input and output parameter, if your input parameter is a record list.

Was this helpful?
Regards,
Mário
Yes, you have been helpful! Thank you. You correctly understood my requirements.
The method you outlined is our current approach, you have helped verify that I am not way off track.

I'm not sure how the passing-by-reference helps me, I've had to use "out" parameters (C#) anyway to create the data structures containing the record lists.

Thanks for your input!