Search Results for

    Show / Hide Table of Contents

    Attribute default value

    Object creation is often complex. Repeating object creation logic across different workflow definitions is not a good practice because updates may be missed. Casewhere allows you to configure default values for data attributes using rules.

    Configuration

    Casewhere uses scalar-function rules to calculate default values. In the data class editor, select the data attribute you want to configure default value, then select a rule or writing a new one.

    image-20220629221748554

    Please note that if you specify a value for the attribute when creating a new object, Casewhere will persist this value and ignore the rule. In the below example, the created message will have status Sent instead of the default value Draft.

    var dataApi = ctx.Use<IDataApi>(); 
    dataApi.Add("CwUatTx2Message", new 
    { 
        Status = "Sent", 
        Content = $"Application {ctx.Input.Name} is {ctx.Input.Status}" 
    });
    
    In This Article
    Back to top Generated by DocFX