Page History
Info | ||||
---|---|---|---|---|
| ||||
AQ_Instance_Create is used to create a new instance and directly set its attributes and relations. By default the instance is activated directly upon creation (before attributes and relations can be set). |
Parameters
Name | Description | Type | Required | |
---|---|---|---|---|
Entity | The type of the instance that should be created | Module Element - Entity | True | |
Instance Activation | Select whether the created instance is activated before or after setting the attributes and relations. The instance will remain activated after the service call, regardless of which value is chosen. | Enumeration
| True | |
Attributes and Relations | Add one line for each attribute or relation that you want to set | Line | False | |
Attribute/Relation | Select an attribute or relation of the entity selected above | Module element - Attribute/Relation | False | |
Value | Write an expression that results in a value for the selected attribute or relation | Expression | False |
This service executes all lines from top to bottom, so when setting InstanceActivationType to "Before" you could use the new value of an attribute or relation that you set in a previous line by using this attribute or relation in the expression of a subsequent line. Attributes and relation will be set in the order that you specify.
Examples
Create Job
Imagine a situation in which you want to create a new job instance, and place it in the Person.hasJobs relation. In this fictitious example we are only registering business engineers, and the job title should get this value. The service shown below will do all this within one service.
...
UI Text Box | ||
---|---|---|
| ||
If a person can have multiple jobs, then the above service will work. By adding setting the Job.BelongsToPerson relation, the Person.HasJobs relation will be updated by adding the instance to the existing job instances. |
Copy Job
Imagine a situation in which you want to create a new job instance and use current active job instance to retrieve values from. In this fictitious example we are using the active job instance to retrieve values from and set them on the newly created job instance. The service shown below will do all this within one service.
...