Book a Demo

Author Topic: Use cases and Activity Diagrams containing Rules  (Read 12554 times)

DChokshi

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Use cases and Activity Diagrams containing Rules
« on: June 22, 2011, 12:29:56 pm »
I want to capture business rules in a distinct model within EA but be able to show how a rule may trigger an alternate path within the scenario of a use case - e.g. rule="user must be 18+ years old". If the user fails this rule, I want the activity diagram for the use case to show the alternate flow, without my having to re-write/embed the rule within the steps of the use case. Is this possible?

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Use cases and Activity Diagrams containing Rul
« Reply #1 on: June 23, 2011, 09:39:28 pm »
Interesting concept.  The best I can think of is to start by rethinking the use case flows around some sort of validation model.  In other words I think you need to include in your use case flows one or more validation points where, given what the use case knows about its' environment, it can "throw an exception flow" and act accordingly.

So at a point in the main use case scenario you may have a situation where:

    survive_iff( business_rule_set(x)_is_satisfied )

In the case of "survival" the main flow will continue, elsewise some sort of alt flow occurs.

I can foresee a lot of complexity and problems being introduced by such a model1.  On the other hand it is an interesting idea at the conceptual level.

N.B. Also a lot of business rules would need to be expressed the other way up, which IMO is not a bad idea anyway, for example, instead of a constraint:

Rule_134.31e: "user must be 18 years old"

Business_Rule_24: user proves age>=18 years


... extrapolating

Business_Rule_42: user proves eyes are blue
Business_Rule_631.2: user proves annual_income >= $USD2,300,000


So the use case flow is now dependent for survival on rules that must be "survived", rather then trying to include every alternate scenario.


hth
(whoever I am now ???)2



1. In fact, I'd be very careful about thinking about it
2. OP ignore, it's just a personal problem I'm having with passwords
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Use cases and Activity Diagrams containing Rul
« Reply #2 on: June 23, 2011, 10:44:53 pm »
I'm (as bashful as I may be) am starting to like this! :
Code: [Select]
Use case : “Send goodies to Grandma”

Main Scenario: On invocation by user A, (only if user.identity=”Mrs Hood”), the system will
transport a basket of goodies from location A to location B and
transfer ownership of said goodies to user B, (user.identity=”Grandma”).

PreCondition:
      user A authority validated

PostCondition:
      user B nutritional needs satisfied

Main flow:
1) User invokes transport of goodies
    1. Unless::(Alt1: condition=”transporter not available”) [ch8594] fail
    2. Unless::(Alt2: condition=”goodies not available”) [ch8594] retry

2) System transports goodies to destination
    1. Unless::(Alt3:condition=”too dark”) [ch8594] fail
    2. Unless::(Alt4:condition=”inclement weather”) [ch8594] retry

3) System transfers ownership of goodies to recipient at destination
    1. Unless::(Alt5:condition=”recipient recognition fail”) [ch8594] raise Alarm,level
    2. Unless::(Alt6:condition=”any_else”) [ch8594] {outcome t.b.d.}

4) System registers condition  [ch8594] “Outcome Complete”

Conditions:
“Outcome Complete”
      Signal TRUE

”transporter not available” includes rule set:
      BR21: daughter.name!=”Little Red Riding”
      BR321: daughter.age>18
      BR421: daughter.attitude!=”subservient”

”goodies not available” includes rule set:
      BR3: larder.surplus<=0

“too dark” includes rule set:
      BR6: 8:00<=system.time<=9:00
      BR897213: environment.solareclipse=TRUE

… etc

”recipient recognition fail” includes rule set:
      BR25: recipient.eyes.size>=”normal”
      BR26: recipient.mouth.size>=”normal”
      BR27: recipient.teeth.size>=”normal”
      BR28: recipient.location!=”bed”

”any_else” includes rule set:
      BR316: room.occupants “does not include” object(“Woodsman”)


Alt Paths:
      fail=end case
      retry= restart case
      raise=System.Event.Raise(....   etc




« Last Edit: June 23, 2011, 10:50:47 pm by sargasso »
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Use cases and Activity Diagrams containing Rul
« Reply #3 on: June 23, 2011, 10:58:31 pm »
Oops  :-[ I think I just invented PL1
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Use cases and Activity Diagrams containing Rul
« Reply #4 on: June 24, 2011, 12:31:35 pm »
Quote
Oops  :-[ I think I just invented PL1
Could you bring back COBOL 88 Levels too please?  ;D

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!