Using a Structure from .NET DLL

Using a Structure from .NET DLL

  
Hello all,

I need to know if can I use an structure from .NET DLL.

The purpose is Integration Studio transform that object in a Record with a specific structure in OutSystems.

Otherwise I will use this structure to populate an array list in the .NET DLL. Then I will transform this structure in a record list with the Outsystems Structure.

Can I do this???
Hi Nuno,

You will not be able to import a structure from a .Net DLL and expose it directly as an extension structure. This feature will only expose Actions based on the .Net assembly signature.Read the article Import Actions from .Net Assembly in the Service Studio Online Help to understand exactly how the Import Actions from .Net Assemby functionality works.

The way to do it is the one you suggested - create an extension structure and in you extension C# implementation convert from the .Net structure to the Extension structure. You can add the .Net DLL to the  references of the extension implementation in Visual Studio to use the data types defined there.

Best Regards,

Daniel Lourenço
OutSystems

"The way to do it is the one you suggested - create an extension structure and in you extension C# implementation convert from the .Net structure to the Extension structure. You can add the .Net DLL to the references of the extension implementation in Visual Studio to use the data types defined there."

Hi Daniel,

In first instance I have resolved the problem with the Array List, but now I need to use just the structure.

I'm not understant what are you tell me about "how to do this".

Do you has an example?


Hi Nuno,

What i mean is that you will have to do the following:
  1. Create a structure in you extension (eg. MyStructure with Field1, Field2, etc.)
  2. In the extension action definition MyAction , return a record list of MyStructure (eg. MyStructureOutputList)
  3. In the C# implementation of MyAction get the list of your .Net Assembly functionality, iterate that list and, for each record, populat a record of MyStructure and add it to the MyStructureOutputList

An example would be somthing like what I show below:



Best Regards,

Daniel Lourenço
OutSystems
Hi Daniel,

Thanks in advance.

I due this but I got an huge error:
"
Método não encontrado: 'System.Collections.ArrayList KeyvalueMotorPriAP._Default.TesteEnvioParamteros(System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.DateTime, System.String, System.String)'.
Stack:

em ssProALVTemplate.RssExtensionaaaaaaaaaa.MssDefaultTesteEnvioParamteros(HeContext heContext, Object inParamThis__Default, String inParamsEmpresa, String inParamsUser, String inParamsPwd, String inParamsInstancia, String inParamsTipoEntidade, String inParamsEntidade, String inParamsProcessoExecucao, DateTime inParamdDataDocumento, String inParamsSerieDocumento, String inParamsTipoDocumento, RecordList& outParamReturn_ArrayList)
em ssProALVTemplate.Actions.ActionDefaultTesteEnvioParamteros(HeContext heContext, Object inParamThis__Default, String inParamsEmpresa, String inParamsUser, String inParamsPwd, String inParamsInstancia, String inParamsTipoEntidade, String inParamsEntidade, String inParamsProcessoExecucao, DateTime inParamdDataDocumento, String inParamsSerieDocumento, String inParamsTipoDocumento, RLArrayListOutRecordList& outParamReturn_ArrayList)
em ssProALVTemplate.Flows.FlowPedidosPagamento.ScrnPagamento_Lista.CommandTeste_Submit(HeContext heContext)
-Env-
eSpaceVer: 147 (Id=186, PubId=170, CompiledWith=5.0.2.6)
RequestUrl: http://localhost/ProALVTemplate/Pagamento_Lista.aspx
AppDomain: /LM/W3SVC/1/Root/ProALVTemplate-162-129145930223239984
FilePath: C:\Programas\OutSystems\Platform Server\running\ProALVTemplate.988731401\Pagamento_Lista.aspx
Locale: pt-PT
DateFormat: yyyy-MM-dd
PID: 3628 ('aspnet_wp', Started='29-03-2010 8:38:34', Priv=222Mb, Virt=630Mb)
TID: 5
.NET: 2.0.50727.3607
"

Do you has this problem???

I have attached me code.

Here is the Extension

Hi Daniel,

I have resolved the problem in part.

I can read the content of the array list when there are composed by primary variables as strings.

But i want to use an struture as a entiry row in the array list. Bw multiple tests I thing this is not possible?

Has you done something similar?

Best regards.
Hi Nuno,

I did not clearly understand your question. To convert your DLL_Structure to an OutSystems structure, you will always have to do it by copying the DLL structure fields to OutSystems fields (integer, text, etc.). You could pass an array list to an OutSystems structure as an Object, but you normally only use this data type in advanced situations where an object needs to be created with a constructor with specific business logic and then has to maintain state over its lifetime.

Did this answer your question? If you give me a specific example of what you are trying to do, I can try to give a more specific answer.

Best Regards,

Daniel Lourenço
OutSystems
Hi Nuno,

I re-read you question and now understood what you mean - you want to populate a list of records where one of the field in those records is a List itself.

The solution for this is similar to the one I presented above - you simply have to populate the "inner list" in each record just as you did with the outer list.

See below.



Regards,

Daniel Lourenço
OutSystems