Click or drag to resize

Item class customization

Apart from design and runtime possibilities, Packflow offers many ways to customize applications with code.

Pages, parts, services, timer jobs, controllers, binders, helpers, views, etc. But the most attractive are items as they represent the core business entities of Packflow applications..

This article focuses on their customization only by coding in the class.


Most low-code platforms generate entities with metadata and default methods but without providing extended features along with them.

Sometimes we see the opposite: great platforms with a lot of features, but no generated/owned entities.

Packflow engine and objects bring a lot of features, utilities, settings, and API in general.

To afford these capabilities along with specific customizable entities, we have chosen to rely on the simplest OO concept: inheritance.

To be presented as powerful AND flexible, a platform has to offer the best of two worlds.

In consequence, all item types will inherit from PFItem.


This section explores some of the most interresting behaviors to override on a PFItem.

Please note that this list is not exhaustive.


This method is called each time an instance of this object is loaded from the database or initialized for a new item.

This is the perfect place to attach your event methods.

Very important: do not use any inefficient code or queries calling the database in this method. This would slow down every database load, and for example it would make every gridview targeting this content extremely slow.

Caption (property)

Display text representing this item.

This text is used to represent the item in many occasions.

The default value is composed of the content-type display name and the reference.

ShortCaption (property)

Short display text representing this item.

This text is used to represent the item when the space is limited.

The default value is the reference.

CommentsEnabled (property)

Indicates whether comments are enabled for this item.

This allows to show or hide the comment icon in the form. A more global option exists in Designer.


Allows to customize default file names proposed to users for each template.

This method receives a list of customizable file names. Keys are template names, values are default names for instances.


This is the method called when an item is deleted.

By default, it only flags the row in the database.

Override this method to change or extend this behavior.

EnableVersionMergeToResolveSaveConflicts (property)

If an object is saved with an older version than the last persisted (in database), the system will try to merge the versions values (if no conflicts between values) and will then save the merged item to database.

This option is enabled by default and a more global option exists in Designer.

When enabled, this allows to modify an item while an user is editing it. If no conflict appears (by value) the two versions' values will be merged.


This method generates a message (subject and body) from a modeling message (ContentMessage).

Can be overriden to change the whole generation of messages.


This method gets the content of a message placeholder (in a ContentMessage) in the specified language.

Must be overriden when such placeholders have been designated in the model to provide their content.


Returns a reference for the current item.

Is called by the Save method when the item is not yet created and the reference is empty.

By default, the method ReferenceGenerator.GenerateReference is used.


Used to initialize a task title in the current workflow state.

By default returns the following pattern: "{Reference} : {State}".

Another possibility to override this title could be to override the Save method of the task object.


By default, computes the due date using modeling settings on current state and taken transition.

The method is called when new tasks are created for the workflow, generally when a new state is reached.


This method gets the list of users notified when comments are added to this item.

By default, the list contains users having already posted a comment, or present in a flagged field ("Users receive notifications for new comments" in the application model).


This method checks if a field is required before any Save of this item.

By default, returns True if the field is marked as required or if the transition requires this field, if a transition is specified.

Note : will return false for all FileHolder fields before creation.


Override this method if you want to force-open this item's visibility to every user having access to this Packflow site.

LogIdentification (property)

This property returns a technical text representing this object.

Used in logging or exception messages.

The default text contains the type, id, GUID, instance creation date and parent information.


Applies the data of this object in the database.

Override this method to extend the way an item is saved.


If multiple transitions are possible out of a state; the conflict must be resolved.

By default, takes top most transition based on Transition Priority and then on participation count.

Override this method to make your own rules of transition resolution.

Please note that this method is only called when the users' decision (via task) are not sufficient to determine the outbound transition.


This section lists the available events on PFItem.

As specified in the previous section, we recommend to attach your handlers from the OnInitialized (overriden) method.




Occurs when an item is being persisted for the first time in database.


Occurs after an item has been created in database.


Occurs when an item is being updated in database.


Occurs after an item has been updated in database.


Occurs when an item is being updated or created in database.


Occurs when an item has been updated or created in database.


Occurs when an item is being deleted.


Occurs after an item has been deleted.


Occurs when the state has been changed in this item instance, but the save has not been called yet.


Occurs after the call to Save() during enactment when the SQL transaction made to move the workflow is committed.


Occurs when a file of this item has been downloaded.


Occurs when a file of this item has been opened for modification (Office or KeePass application).


Occurs when a file is being created on this item.


Occurs after a file has been created on this item.


Occurs when a file of this item is being updated.


Occurs after a file of this item has been updated.


Occurs when a file has been confirmed on this item. A file is confirmed when, after its upload, the parent item is saved with a reference to the file in the FileHolder value.


Occurs when a file of this item is being deleted.


Occurs after a file of this item has been deleted.


Occurs before a modeled notification is sent.


Occurs after a PFItemComment has been added on the item.

Your object

Do not limit yourself to the described content here, this is your object.

You can extend it with new methods, properties or events.