Top
Top
LibraryEASYProcess Reference ManualProcessesServicesEntityWorkshopCreate

Create Overview

Create is used to create new entity objects. Create works similar to a sql insert into statement. The create service will create an entity object with properties and an entity type and it will also insert a record into sql for the table that is synced with the entity type.

The Entity Create service is useful because it will auto generate the EntityId without needing to generate it. If you chose to do the insert with a SQL query, you would need to first call a GetNextNumber to generate the Entity Id to have the value in order to pass it in and insert the string.


Create Use Example
Workshop:EntityWorkshop
Service:Create
Inputs
EntityIdThis is the Id of the entity object record that you are creating and often the primary key of the associate table. This is not needed as input since the Create service will auto assign this value with the next number available. This is the same number that would be generated the GetNextNumber entity service.

EntityTypeThis is the Entity Type of the entity object record that you are creating. The recommended values will list all possible entity types. The Entity Types correspond to SQL table name.

PropertiesThis is the container node that contains all the property nodes. It does not access any input, but you can Right-Click to add new Properties (Property #0, Property #1, etc.). Each Property below this node is added to the created entity object.

PropertyThe property is a container node which accepts no input, but represents a single entity object you are adding.

NameThis is the name of the object property you would like to assign a value to. The name must correspond to an existing property of the entity (column in the table).

ValueThis is the value you would like to assign to the property.

AutoLoad

Outputs
Entity/EntityIdThis is the unique ID of the entity object record that was created.
Entity/EntityIdsThis is the unique ID of the entity object record that was created.
Entity/EntityTypeThis is the entity type of the entity object record that was created. Example entity types are menus or menu items.
Entity/Properties/PropertyNameThese are the different properties and property values of the created entity object record. This will list all the properties that exist for the entity, not just the ones that you passed in a value for.

Create Use Examples

Basic Create Use

In this example we are looking at Message Center. In the message center you can add a new message and add an attachment to the message.

The upload button has a button process that creates an entity object record with an entity type of MessageCenterAttachments. When the button is selected, we are saving an attachment to a specified directory. If the attachment was uploaded to the directory successfully, the Create service runs and creates the new entity object record for MessageCenterAttachments entity type.

The MessageCenterAttachments entity type has properties of MessageId, Filename, and description. These properties are being populated when the create service runs. The create service is also inserting a record into the MessageCenterAttachments sql table that is synced with the MessageCenterAttachments entity type.

The Property Names correspond to columns that exist in the table tied to the entity. The property name must already exist as a column for the table/property for the entity. This is case sensitive. This means that if you make a database change to add a column, but do not sync the EASYProcess entity, the property will not exist yet and the record will be created without a value for the newly added column.

           

Notice that the output lists all properties, not just the ones passed in. It also auto assigned an AttachmentId.


Powered by EASYProcess (© 2019 K-Rise Systems, Inc).