How do you use Partial functions?

Hey,

I've been wondering about how partial functions can be used in Appian. 

One thing that I was looking at was sticking a bunch of them together to define validation functions by passing them as arguments like this: 

a!textField(
  value: local!value,
  saveInto: local!value,
  validations: rule!BLAKEJ3_Validation_Composer(
    rules: {
      rule!BLAKEJ3_Validation_TextIsLongerThan10Chars(_),
      rule!BLAKEJ3_Validation_TextIsShorterThanGivenLength(fieldLength:25, input:_),  
      rule!BLAKEJ3_Validation_TextMustEndInFullStop(_),
      rule!BLAKEJ3_Validation_ApplyBySentence(
        rules: rule!BLAKEJ3_Validation_SentenceMustStartWithCapital(_), input: _
      )
    },
    input: local!value
  )
)

This seems like it can be very readable and it breaks testing down into smaller bits that can have defined test cases in expression rules. It means that new validation rules can be assembled from shared modular rule components. However I'm also wondering if its over engineering for the vast majority of cases and if most validation is such simple functions that those aren't really relevant benefits.

I'm curious for more opinions about this as well as hearing how other people have used a very uncommon Appian function.

E: This crashes every time I try and add a tag

Parents Reply Children
No Data

 Discussion posts and replies are publicly visible