All product information in wiki.bizagi.com is only valid for Bizagi BPM Suite 9.1.X.
For newer Bizagi BPM Suite versions (10.X and up) please visit the User Guide.
 

Object Model: EntityManager

From Business Process Management, BPM and Workflow Automation Wiki | BizAgi BPMS

Jump to: navigation, search

<keywords content="keywords"> entity manager </keywords> 


Contents

Advanced Functions of CEntityManager

This article lists the functions available in the CEntityManager object of Bizagi for advanced business rules.


The CEntityManager class contains functions which are useful to obtain records and general informaiton directly stored in Bizagi's entities (even virtual ones).
Its use is specially promoted to obtain records of parameter entities.

The functions presented by the CEntityManager allows handling information in the data base. In Expressions, for example iterate over fact, these functions are used. It is suggested to use them ONLY if it is entirely needed for compatibility with previous versions or if no other ways to access data is possible (mainly Xpath). The most common functions are explained below:

Note: It is very important to point out that EntityManager should only be used to get and work with entities that are not related to the case and that CANNOT be accessed directly by surfing the data model with XPath. This is because EntityManager does not get the data from the Scope, but from the Database directly. Thus the information that has not be persisted yet is not going to be found by the EntityManager.


Image:Business_Rules15_Image001.jpg


Functions


Property Syntax
Description

ExistsEntityInstance

Depends on the parameters:

CEntityManager.ExistsEntityInstance (sEntName,sKeyName,oKeyValue)

Checks if there's an instance of a given entity id idEntity. True if exists, false otherwise.

getAttrib

Depends on the parameters

CEntityManager.getAttrib (sEntityName,oEntityKey,sAttribName)

Gets an attribute in an instance of an entity given the name of the entity, the value of the key and the name of the attribute.

GetEntity

Depends on the parameters

CEntityManager.GetEntity (sEntName,sKeyAttrib,oKeyAttribValue)

Gets an entity instance with values for a given entity, attribute, key, value. The returned value is an object

Example

GetEntityFromPath

CEntityManager.GetEntityFromPath (sEntPath,oSurrogateKeyValue)

Gets an entity instance based on the attribute path sEntPath with the value of the surrogate key. The value returned is always a CEntity object

setAttrib

CEntityManager.setAttrib (sEntityName,oEntityKey,sAttribName,oAttribValue

Sets an attribute sAttribName, with a new value oAttribValue in an entity sEntityName

instance with a key oEntityKey

Example



The "getAttrib" and "setAttrib" functions are also available in the CHelper object.


Related Articles



<comments />