Trying to figure out if this query is possible :
BO Employee references BO Organization (owned by, no multiple) and BO Person (owned by, no multiple)
The query should find all person NOT employed in a given Organization.
What troubles me is that Person (in Mysql table) doesn't have any reference (column) to Employee although in BO Person the Employee reference attribute is defined !
Is there something wrong. (V3-build 1036)
Complex query
Hi Tom,
BO Organization owns Employee, multiple allowed
BO Person owns Employee, multiple allowed
BO Employee is owned by Organization, no multiple
and is owned by Person, no multiple.
The query should find all the persons that are not employees of a given organization.
I tried:
FIND Person WHERE (NOT( EXISTS Employee WHERE (Person IN Employee.Person AND Employee.Organization=ThisOrganization)))
but obviously this is not correct (no record found).
Thanks for your help,
Ernest
BO Organization owns Employee, multiple allowed
BO Person owns Employee, multiple allowed
BO Employee is owned by Organization, no multiple
and is owned by Person, no multiple.
The query should find all the persons that are not employees of a given organization.
I tried:
FIND Person WHERE (NOT( EXISTS Employee WHERE (Person IN Employee.Person AND Employee.Organization=ThisOrganization)))
but obviously this is not correct (no record found).
Thanks for your help,
Ernest
Ernest,
Now I'm really confused:
How can that be? Once a BO like Employee is indicated to be owned by another BO, AwareIM will only allow you to make it a Peer to another BO.
Tom
Now I'm really confused:
You have that Employee is owned by both Organization and Person BOs.BO Organization owns Employee, multiple allowed
BO Person owns Employee, multiple allowed
BO Employee is owned by Organization, no multiple
and is owned by Person, no multiple.
How can that be? Once a BO like Employee is indicated to be owned by another BO, AwareIM will only allow you to make it a Peer to another BO.
Tom
Well, it doesn't seem to be controlled in the Config tool. And I have several other BO's that have multiple BO owners.
I don't know if it is only a semantic problem or if it does really pose a problem as far as DB integrity or AwareIM functions are concerned.
Considering an employee is owned by an organization, would mean if that gets "deleted" the employee instance will be deleted as well.
Whereas, the person owning the employee would not get deleted. The more so as, that person can be employed by another organization.
Does it make sense ?
I don't know if it is only a semantic problem or if it does really pose a problem as far as DB integrity or AwareIM functions are concerned.
Considering an employee is owned by an organization, would mean if that gets "deleted" the employee instance will be deleted as well.
Whereas, the person owning the employee would not get deleted. The more so as, that person can be employed by another organization.
Does it make sense ?
Ernest,
I wonder if this limitation from Appendix B applies to your situation (#16 in the 3.0 User Guide and #14 in the 4.0 User Guide)
I wonder if this limitation from Appendix B applies to your situation (#16 in the 3.0 User Guide and #14 in the 4.0 User Guide)
Tom16. Negated IN expression is not supported in queries. For example, the following expression is not supported:
FIND Event WHERE NOT(LoggedInMember IN Event.Participants)
In many cases the negated IN expression can be replaced by using the equivalent COUNT or EXISTS expression, for example:
FIND Event WHERE COUNT Member WHERE(Member IN Event.Participants AND Member=LoggedInMember) = 0
Ernest,
I'm still confused about:
Tom
I'm still confused about:
If a Person creates and owns an instance of Employee, do you have an attribute in that Employee instance that would tell you the Organization of the Employee?BO Organization owns Employee, multiple allowed
BO Person owns Employee, multiple allowed
BO Employee is owned by Organization, no multiple
and is owned by Person, no multiple.
Tom
Hi Tom,
As quoted, BO Employee is owned by Organization, no multiple, so there is an attribute.
The process to create an Employee from a Person would require that you select an Organization. But at the moment, I have a process to create an Employee as Operation invoked from Organization form.
Precisely in that process, a rule asks 'Do you want tro create a new Person ?'
- NO should present the results of a query with all persons NOT employed within ThisOrganization...
Ernest
As quoted, BO Employee is owned by Organization, no multiple, so there is an attribute.
The process to create an Employee from a Person would require that you select an Organization. But at the moment, I have a process to create an Employee as Operation invoked from Organization form.
Precisely in that process, a rule asks 'Do you want tro create a new Person ?'
- NO should present the results of a query with all persons NOT employed within ThisOrganization...
Ernest
Ernest,
Have you tried this:
In this example Employee.OrganizationName is a shortcut to Organization.Name
greg
Have you tried this:
Code: Select all
FIND Person WHERE EXISTS Employee WHERE (Employee IN Person.Employee AND NOT(Employee.OrganizationName CONTAINS ?'Organization'))
greg