I'm not sure if this is possible but I'm hoping an APEX ninja can help me with something I want to attempt.
I have a class called Process
and at different entry points I intend to make a List<Process>
that I can iterate through to implement dynamic business logic that should be applied to a List<SObject>
.
IF for example these processes were fired during a trigger event, then while I iterate through the List<SObjects>
within the Trigger
I want to be able to apply a dynamic list of filters (defined within a given Process
). For example in event-driven programming I would be able to do something like this:
for(SObject obj : Objects){
for(Filter filter : Filters){
// Apply filter to obj
}
}
OR in my scenario this may look more like so:
for(SObject obj : Objects){
for(Process p : Processes){
for(Filter f : p.filters){
// Apply filter to obj
}
p.run();
}
}
Can you please confirm if this is or isn't possible and any details that might help me to implement a solution?
I'm not sure if I'm phrasing this question clearly enough, so if I need any additions please comment below and I'll make adjustments to clarify. Thank you!
Filter
or business logic in aList
to be run at a later time, rather than storing the "results" of a filter to be run if that makes sense. Do you know of anything along those lines? – Xtremefaith Aug 16 '16 at 2:31