Organization

Organization is a definition of SimDM user group and/or data owning organization. User group could be assigned with default access role to manage access rights of persons included to the group/organization (but personal access type has higher priority if assigned).

organization_list_types

returns list of types acceptable for organizations in target PBS

QUERY_FUNCTION organization_list_types: LIST OF STRING


organization_create

creates new organization definition in current state of pbs according to provided input

To call the query logged in user shall be associated with a person granted with administrative privileges over whole pbs (ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION organization_create(subject: v_organization): v_organization

Parameter:
subject input parameter of the organization, see v_organization
some attributes of the input are ignored, like the following:
  • subject.item.instance_id - generated
  • subject.item.cancelled - set to FALSE
  • subject.item.creator - set to logged in user
  • subject.item.last_changed - set to date/time of the call
  • subject.item.last_editor - set to logged in user
  • subject.item.comments - unset
  • subject.item.events - is populated with a creation event

Returns actual attributes of the newly registered organization (see v_organization)


organization_get

gets data of a organization definition specified by its instance id

To call the query logged in user shall be associated with a person granted with reader privileges over whole pbs (READER_TYPE, EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION organization_get(id: INTEGER): v_organization

Parameter:
id id of the organization instance

Returns actual data of the required organization (see v_organization)


organization_list

lists data of organization definitions specified by list of their instance id. Normally source of the the list is v_pbs returned by pbs_get

To call the query logged in user shall be associated with a person granted with reader privileges over whole pbs (READER_TYPE, EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION organization_list(ids: LIST OF INTEGER): LIST OF v_organization

Parameter:
ids list of interesting properties instance id-s

Returns list of actual data of the required properties (see v_organization)


organization_select

properties search is not implemented in current realize
QUERY_FUNCTION organization_select(
      pbs,
      person            : INTEGER;
      version           : STRING;
      role              : STRING)  :  LIST OF v_organization
Parameters:
pbs (optional) instance id of parent pbs
person (optional) instance id of person - member of the organization
version (optional) version of PBS where the organization was introduced
role (optional) organization/group type

Returns list of found organizations (see v_organization)


organization_update

updates data of organization defined before. The organization is specified by its instance id

To call the query logged in user shall be associated with a person granted with administrative privileges over whole pbs (ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION organization_update(subject: v_organization): v_organization

Parameter:
subject updated data of the organization definition to be updated in model (see v_organization)
Target instance specified by subject.item.instance_id

The following attributes are ignored:

  • subject.item.introduced - is leaved as before
  • subject.item.creator - is leaved as before
  • subject.item.last_changed - set to current date/time
  • subject.item.last_editor - set to calling user
  • subject.item.comments - is leaved as before
  • subject.item.event - is added with update event

Returns actual data of the updated organization records (see v_organization)


organization_cancel

cancels group/organization specified by its instance id in the target pbs. The organization is declared as cancelled and could not be used any more in references after that. The instance of the organization can be even removed from the model if it was not used in any relationships

To call the query logged in user shall be associated with a person granted with administrative privileges over whole pbs (ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION organization_cancel(id: INTEGER): BOOLEAN

Parameter:
id instance id of the organization to be cancelled

Returns TRUE if the instance deleted (was not used), FALSE if just cancelled


organization_add_person

adds new member to the organization/group. Both are specified by their instance id

To call the query logged in user shall be associated with a person granted with administrative privileges over whole pbs (ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION organization_add_person(
      id,
      person            : INTEGER) :  v_organization
Parameter:
id instance id of the organization/group
person instance id of the person to be added to the organization/group

Returns updated data of the organization (see v_organization)

NOTE: generic management of organization members could be done in one call to organization_update


organization_remove_person

removes a member from an organization/group. Both are specified by their instance id

To call the query logged in user shall be associated with a person granted with administrative privileges over whole pbs (ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION organization_remove_person(
      id,
      person            : INTEGER) :  v_organization
Parameter:
id instance id of the organization/group
person instance id of the person to be removed from the organization/group

Returns updated data of the organization (see v_organization)

NOTE: generic management of organization members could be done in one call to organization_update


Back to Home page