A Process Entity is a special entity that stores runtime information about processes that can be used in, for example, queries about processes.
Add a Process Entity
- Simply edit the process properties and set the
Expose Process Entityproperty to Yes.
Process Entity Identifier
Process entities are uniquely identified by the process identifier which means each process instance has one and only one process entity.
Using a Process Entity
Use the Process Entities to obtain process runtime information to use in your application logic, such as, to check whether the process is suspended or to use the process identifier attribute of the process entity to terminate a process execution.
Imagine that you have an application with processes to manage documents and you want a document process to end when that document is deleted. Imagine also that a process instance is launched for each newly created document, which means: the document identifier is an input parameter of the process (why?) and also an attribute of the process entity (why?).
Now, to end the process, design a screen action to be executed when the document is deleted, and execute the ProcessTerminate System action. To obtain the process identifier, add an aggregate using the process entity with the condition that the process entity document identifier attribute must be equal to the identifier of the document you are deleting. Then, use the process identifier attribute of the obtained process entity in the System action.
When you delete a process, its process entity is automatically deleted.
In a scenario of having millions of records in the process entity, consider using the best practice for scaling queries over process entities.
Using Process Entity References
OutSystems provides you with mechanisms to reuse Process Entities among eSpaces. When you expose your Process its Process Entity is automatically exposed or when you use a Process defined in another eSpace its Process Entity can also be used.