Skip to main content
Tweeted twitter.com/#!/StackProgrammer/status/604293282185764864
edited tags
Link
Michel
  • 971
  • 1
  • 7
  • 17
Source Link
Michel
  • 971
  • 1
  • 7
  • 17

Good way to program an orchestration / processflow

I'm programming a process in which clients will be separated in 3 different groups, and for every group a different action will be performed.

My question concerns the process of deciding which client will be in which group.

As input I received a flow diagram with 7 decision blocks.

I think you can imagine the flow chart:

If A and B and Not C and F then you are in group 1.

If A and not B and C and E you are in group B. If A and not B and C and not E but F you also are in group B.

Anyway, you probably get what I mean.

What I'm searching for is what is a good way to implement this?

We've come up with the following solutions

1 program the code like I've typed it:

if A() && !B() && C() || (D() && E()) groupA.Add(client)
if A() && !B() && C() && F()) groupB.Add(client)

2 program a BIG if / if / else

if A()
    if B()

    else
        if ! C()

        else
else
    if C()
    
    else

etc.

But.... both don't make me happy, so I was wondering if there was a better way of solving this?