- 07 Aug 2024
- 2 Minutes to read
- Print
- DarkLight
Designer Behaviors
- Updated on 07 Aug 2024
- 2 Minutes to read
- Print
- DarkLight
Overview
The IDesignerBehavior interface is the base behavior interface for Flow, Rule, MatrixRule, Form, Report, and TextMerge Designer entities. This interface includes common functionality of all designer behaviors, which may be needed to abstract from specific behaviors. This helps users configure the gallery dialog displayed when using the CREATE FLOW/RULE/FORM actions. This allows users to adjust the behavior's appearance in the dialog by modifying the behavior's properties. Below is a code example of the IDesignerBehavior interface.
public interface IDesignerBehavior
{
string Name { get; }
bool IsUserSettable { get; }
string CreateGalleryImage { get; }
string Category { get; }
string GetDescription();
string BaseEntityName { get; }
int DisplayOrder { get; }
}
public interface IDesignerBehavior<T> : IDesignerBehavior
where T: class
{
DataDescription[] ProcessInputDeclaration(T entity, DataDescription[] inputData);
void OnBehaviorAssigned(T entity);
}
IDesignerBehavior Properties
Property Name | Description |
---|---|
Name | User-friendly behavior name. This property is defined in default behaviors and is generated from the behavior class name. |
IsUserSettable | Sets whether or not a Flow behavior shows up in the Decisions Portal UI when a user sets the behavior of a Flow. When set to false, this behavior will not appear in the behavior list for users to select from but can still be used by the user's code to set Flow behavior on Flows. |
CreateGalleryImage | ImageId of ImageInfo class. ImageId should match ImageInfoType.StoredImage |
Category | Category (in gallery dialog) where behavior will show up |
GetDescription | Specifies behavior description |
BaseEntityName | Entity name which will be suggested when creating an entity based on a behavior |
DisplayOrder | Specifies behavior order in the gallery dialog |
Example
In most cases, simply overriding the Category property and GetDescription() method will be needed. The Name and BaseEntityName will be generated from the behavior class name. These can be overridden if a user wants to specify a different Name for behavior and BaseEntityName.
Below is a code example of creating a Healthcare category in the Flow Designer entity.
public class InsuranceFlowBehavior : DefaultFlowBehavior
{
public override int DisplayOrder => 0;
public override string Category => "Healthcare";
public override string GetDescription()
{
return "Flow type allows to identify client insurance needs.";
}
}
public class AccidentFlowBehavior : DefaultFlowBehavior
{
public override int DisplayOrder => 10;
public override string BaseEntityName => "Accident Action";
public override string Category => "Healthcare";
public override string GetDescription()
{
return "Flow type allows to identify insurance payout in case of an accident.";
}
}