Creating Custom Folder Entities

Last Updated: 12/09/2015 Introduced in Verision: 2.0
Custom Folder Entities are special objects that can ‘reside’ in a Decisions folder. If you are just looking to easily store data in a table a simple ORM object (described i) may be all you need. However, if you are looking for expanded functionality you may want to create a Custom Folder Entity. Below is a list of some of the benefits this entity provides.
  • Your entity will inherit some basic fields like DateCreated, DateModified, CreatedBy, ModifiedBy which will be automatically updated by Decisions when you interact with this object.
  • Your data will be protected by being able to participate in the Logical Delete methodology employeed by the Decisions platform. In other words when you delete a folder entity, the entity is only logically deleted (an IsDeleted flag is set to true), so that your data is recoverable if later you want to “undelete” the entity.
  • Your entity will be able to ‘live’ inside of Decisions folders. This means that you entities can be logically grouped inside the Decisions portal and that they will show up in the default “All Entities” reports.
  • Your entity can have custom actions associated with it (an action to Edit your entity is described below).
To begin, you will need to create a new class that inherits from  AbstractFolderEntity.
You will write your object in the same way as described in the ORM Basics article. Below is a sample for the Quote entity that we will build.
Now that you’ve written the fields of your folder entity, you can attach actions to your entity. These action will show up in menus in the Decisions portal when this entity is selected. Below is an example of how to attach an “Edit” action to your entity.
And here is how the EditQuote method would look.

Now you have a fully functional folder entity. However, you don’t have an easy way to create one in the portal. One way to easily create an action to create your new folder entity is by creating a Folder Behavior. The article Creating Custom Folder Behavior more fully describes how to create a folder behavior. Below is an example of how you would write one with an action to create this new folder entity.


Additional Resources