Skip to main content

entity-parameter: search for solution/ideas

  • July 1, 2021
  • 3 replies
  • 0 views

Ingo Stiller
Forum|alt.badge.img+3

Hi Freaks

Im just writing two programs.
One used as an interface where a user can retrieve a entity (Table of persons).
Then he/she can sort and check all or a few of them to "work" with.
The worker/background-programm is the second one to which I pass the entity by an entity-parameter.
Works perfect but ...

But I want to pass the "check" status to the background programm, I run into a "trouble"
I define a non database field (with this extra inf) in the entity to hold such information.
And this non-database is not passed between the components
Have a look into the documentation and yes only database fields (or the UF10 is_external=True) are passed between component.

So any idea how to pass such information from one component to another?
Okay, I could pass a UIL (UnifAce Item List) in paralell to the entity, but this is not a "good programming" to have parts of the same record (=entity) in different variables
Defining a field as "database" only for purpose of passing parameters ruines my database.
If just passing the person-IDs plus the extras infos I have to reread all person in the background programm.
Using of handles to get information from the user interface is also not a good programming.

The interface between the programms should be as small as possible

Any other ideas beside the solution to change the programmin language ... 🙂

Ingo







3 replies

David Akerman

Hi Freaks

Im just writing two programs.
One used as an interface where a user can retrieve a entity (Table of persons).
Then he/she can sort and check all or a few of them to "work" with.
The worker/background-programm is the second one to which I pass the entity by an entity-parameter.
Works perfect but ...

But I want to pass the "check" status to the background programm, I run into a "trouble"
I define a non database field (with this extra inf) in the entity to hold such information.
And this non-database is not passed between the components
Have a look into the documentation and yes only database fields (or the UF10 is_external=True) are passed between component.

So any idea how to pass such information from one component to another?
Okay, I could pass a UIL (UnifAce Item List) in paralell to the entity, but this is not a "good programming" to have parts of the same record (=entity) in different variables
Defining a field as "database" only for purpose of passing parameters ruines my database.
If just passing the person-IDs plus the extras infos I have to reread all person in the background programm.
Using of handles to get information from the user interface is also not a good programming.

The interface between the programms should be as small as possible

Any other ideas beside the solution to change the programmin language ... 🙂

Ingo







Hi Ingo,

You could try using componentToStruct optionally specifying an entity name, then use structToComponent if the structure matches in the receiving component (you may need to use /reconnecttags if you want status information). If you pass a struct param it will be passed by reference (improving performance), although you will then need to locate both components on the same physical server or use StructToJson to convert to a string and pass by value and decode it with jsonToStruct.


Iain Sharp
Forum|alt.badge.img+5
  • Inspiring
  • July 1, 2021

Hi Ingo,

You could try using componentToStruct optionally specifying an entity name, then use structToComponent if the structure matches in the receiving component (you may need to use /reconnecttags if you want status information). If you pass a struct param it will be passed by reference (improving performance), although you will then need to locate both components on the same physical server or use StructToJson to convert to a string and pass by value and decode it with jsonToStruct.

Or you can specify ByValue in the parameters, which does not require the components to be on the same machine. 

componentToStruct also takes an entity name, so you don't have to pass all the formatting/display entities on your form to your service. 

I have further written a 'simple(ish)' proc which can do the same as the mapping used to do in xmlload and xmlsave, so you can have diffferent component subtypes between them. However, it does start to get complex there, and there are issues with the reconnect function and down then up entity paths. I don't know if the 'entity' parameter passes child entities (we never used it). So that might not be an issue. 



Ingo Stiller
Forum|alt.badge.img+3
  • Author
  • Participating Frequently
  • July 2, 2021

Hi Freaks

Im just writing two programs.
One used as an interface where a user can retrieve a entity (Table of persons).
Then he/she can sort and check all or a few of them to "work" with.
The worker/background-programm is the second one to which I pass the entity by an entity-parameter.
Works perfect but ...

But I want to pass the "check" status to the background programm, I run into a "trouble"
I define a non database field (with this extra inf) in the entity to hold such information.
And this non-database is not passed between the components
Have a look into the documentation and yes only database fields (or the UF10 is_external=True) are passed between component.

So any idea how to pass such information from one component to another?
Okay, I could pass a UIL (UnifAce Item List) in paralell to the entity, but this is not a "good programming" to have parts of the same record (=entity) in different variables
Defining a field as "database" only for purpose of passing parameters ruines my database.
If just passing the person-IDs plus the extras infos I have to reread all person in the background programm.
Using of handles to get information from the user interface is also not a good programming.

The interface between the programms should be as small as possible

Any other ideas beside the solution to change the programmin language ... 🙂

Ingo







Hi David, Hi Iain
ThanX for your ideas
Didn't thought about structs 🙂

In the meanwhile I did it by a call back via an occurence handle.
Seems to me the simpelst way, as I already do have global includes for OPER, ECOP und EOOP triggers
The only operation missing was a "SET_FIELD_VALUE" in EOOP, ("GET_FIELD_VALUE" already was defined)

I pass the instancename of the surface component to the background one.
For each row in the entity
 a: call an component operation to obtain the current occurence handle
 b: call GET_FIELD_VALUE
 c: modifiy the field (an UIL)
 d: call SET_FIELD_VALUE

@Uniface: What about an entity parameter including NonDB*) fields?
*) Which are defined in the model so both components should know them

Ingo