Adore Graphical Representation

This page illustrates the Adore graphical representation of processes. We use a simple orchestration and two fragments to illustrate the complete graphical model.

Process: Activities & Relations

The graphical representation helps designer to understand their process. We represent activities as boxes, and relations as arrows. Each box is identified according to the associated activity identifier. The content of the box depends of the activity kind. The following table maps Adore different relations with the associated graphical relation:

Relation Graphical Representation
WaitFor A simple arrow
WeakWait A dashed arrow
Guard A simple arrow with a label (condition)
OnFailure A red arrow, with a label (exception)

The following figure represents a simple orchestration which adds 1 to its received value, and reply this new value to its caller.

Orchestration example

Here is the associated Adore code:

orchestration atomic::next {
  variables { n as integer; result as integer; }
  activities {
    a0. n := receive();
    a1. result := add(n,'1' as integer);
    a2. reply(result);
  }
  relations { a0 < a1; a1 < a2; }
}

Fragments: P, Hook & S

  • In the fragment context, P means predecessors and S means successors.

The following fragment catch an exception callDisconnected thrown by the hook, and customize the error according to the current context.

Fragment Example (Simple)

Here is the associated Adore code:

fragment callDisconnected {
  variables {}
  activities { h. hook(); thr. throw('lostWitnessContact' as string); }
  relations { ^ < h; h < $; fail(h,'disconnected') < thr; }
}

The following fragment introduce a timeout contract in an existing orchestration. This fragment starts a stopwatch in parallel to the hooked activities. If the hook consumes more time than the stopwatch one, the timeout condition will be validated and an exception will be thrown.

Fragment Example (Less Simple)

Here is the associated Adore code:

fragment timeContract<duration>{
  variables { delay as integer; timeout as boolean; duration as integer; } 
  activities { 
    e0. delay := id('0' as integer) ;
    e1. delay := timer::wait(duration) ;
    h. hook() ;
    e2. timeout := isDifferent(delay,'0' as integer) ;
    e3. throw('response time violation!' as string) ;
  } 
  relations { 
    ^ < e0 ; e0 < e1 ; e0 < h ; h << e2; e1 << e2 ;
    e2 < e3 when timeout ; e2 < $ when  ! timeout ;
  } 
}
foundations/syntax/graph.txt · Last modified: 2010/01/11 11:30 by mosser
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0