!global $ICON_FORMAT="png" !global $TEXT_WIDTH_MAX=200 !global $MSG_WIDTH_MAX=150 !global $FONT_SIZE_XS=10 !global $FONT_SIZE_SM=12 !global $FONT_SIZE_MD=16 !global $FONT_SIZE_LG=20 !global $FONT_COLOR="#6f4545ff" !global $FONT_COLOR_LIGHT="#757575" ' Smart Flow Counters !global $studentCounter = 0 !global $courseCounter = 0 !global $userCounter = 0 !global $orderCounter = 0 !global $packageCounter = 0 !global $classCounter = 0 !global $policyCounter = 0 !global $serviceCounter = 0 !function $getNextCounter($aggregateType) !if ($aggregateType == "Student") !global $studentCounter = $studentCounter + 1 !return $studentCounter !elseif ($aggregateType == "Course") !global $courseCounter = $courseCounter + 1 !return $courseCounter !elseif ($aggregateType == "User") !global $userCounter = $userCounter + 1 !return $userCounter !elseif ($aggregateType == "Order") !global $orderCounter = $orderCounter + 1 !return $orderCounter !elseif ($aggregateType == "Package") !global $packageCounter = $packageCounter + 1 !return $packageCounter !elseif ($aggregateType == "Class") !global $classCounter = $classCounter + 1 !return $classCounter !elseif ($aggregateType == "Policy") !global $policyCounter = $policyCounter + 1 !return $policyCounter !elseif ($aggregateType == "Service") !global $serviceCounter = $serviceCounter + 1 !return $serviceCounter !else !return 1 !endif !endfunction !function $createContextualAggregate($aggregateType, $command) !$counter = $getNextCounter($aggregateType) !$context = $aggregateType !if (%strpos($command, "Package") >= 0) !$context = $aggregateType + "Pkg" !elseif (%strpos($command, "Class") >= 0) !$context = $aggregateType + "Cls" !elseif (%strpos($command, "Delete") >= 0) !$context = $aggregateType + "Del" !elseif (%strpos($command, "Create") >= 0) !$context = $aggregateType + "Crt" !elseif (%strpos($command, "Update") >= 0) !$context = $aggregateType + "Upd" !endif !$aggregateName = $context + $counter Aggregate($aggregateName, $aggregateType) !return $aggregateName !endfunction !function $processElement($element, $command) !if ($element == "Student" || $element == "Course" || $element == "User" || $element == "Package" || $element == "Class") !return $createContextualAggregate($element, $command) !else !return $element !endif !endfunction !procedure $flow($from, $through, $to="", $to2="", $to3="", $to4="", $to5="") !$actualThrough = $processElement($through, $from) $from --> $actualThrough !if ($to != "") $actualThrough --> $to !endif !if ($to2 != "") $actualThrough --> $to2 !endif !if ($to3 != "") $actualThrough --> $to3 !endif !if ($to4 != "") $actualThrough --> $to4 !endif !if ($to5 != "") $actualThrough --> $to5 !endif !endprocedure !procedure $flow2($from, $through, $evt1="", $evt2="", $evt3="") !$actualThrough = $processElement($through, $from) $from --> $actualThrough !if ($evt1 != "") $actualThrough --> $evt1 !endif !if ($evt2 != "") $actualThrough --> $evt2 !endif !if ($evt3 != "") $actualThrough --> $evt3 !endif !endprocedure !procedure $flow3($from, $through, $to1, $evt1="", $evt2="", $evt3="") !$actualThrough = $processElement($through, $from) !$actualTo1 = $processElement($to1, $from) $from --> $actualThrough $actualThrough --> $actualTo1 !if ($evt1 != "") $actualTo1 --> $evt1 !endif !if ($evt2 != "") $actualTo1 --> $evt2 !endif !if ($evt3 != "") $actualTo1 --> $evt3 !endif !endprocedure !procedure $flow4($from, $through, $to1, $to2, $evt1="", $evt2="", $evt3="") !$actualThrough = $processElement($through, $from) !$actualTo1 = $processElement($to1, $from) !$actualTo2 = $processElement($to2, $from) $from --> $actualThrough $actualThrough --> $actualTo1 $actualTo1 --> $actualTo2 !if ($evt1 != "") $actualTo2 --> $evt1 !endif !if ($evt2 != "") $actualTo2 --> $evt2 !endif !if ($evt3 != "") $actualTo2 --> $evt3 !endif !endprocedure !procedure $flow5($from, $through, $to1, $to2, $to3, $evt1="", $evt2="", $evt3="") !$actualThrough = $processElement($through, $from) !$actualTo1 = $processElement($to1, $from) !$actualTo2 = $processElement($to2, $from) !$actualTo3 = $processElement($to3, $from) $from --> $actualThrough $actualThrough --> $actualTo1 $actualTo1 --> $actualTo2 $actualTo2 --> $actualTo3 !if ($evt1 != "") $actualTo3 --> $evt1 !endif !if ($evt2 != "") $actualTo3 --> $evt2 !endif !if ($evt3 != "") $actualTo3 --> $evt3 !endif !endprocedure !procedure $flow6($from, $through, $to1, $to2, $to3, $to4, $evt1="", $evt2="", $evt3="") !$actualThrough = $processElement($through, $from) !$actualTo1 = $processElement($to1, $from) !$actualTo2 = $processElement($to2, $from) !$actualTo3 = $processElement($to3, $from) !$actualTo4 = $processElement($to4, $from) $from --> $actualThrough $actualThrough --> $actualTo1 $actualTo1 --> $actualTo2 $actualTo2 --> $actualTo3 $actualTo3 --> $actualTo4 !if ($evt1 != "") $actualTo4 --> $evt1 !endif !if ($evt2 != "") $actualTo4 --> $evt2 !endif !if ($evt3 != "") $actualTo4 --> $evt3 !endif !endprocedure !procedure $flow7($from, $through, $to1, $to2, $to3, $to4, $to5, $evt1="", $evt2="", $evt3="") !$actualThrough = $processElement($through, $from) !$actualTo1 = $processElement($to1, $from) !$actualTo2 = $processElement($to2, $from) !$actualTo3 = $processElement($to3, $from) !$actualTo4 = $processElement($to4, $from) !$actualTo5 = $processElement($to5, $from) $from --> $actualThrough $actualThrough --> $actualTo1 $actualTo1 --> $actualTo2 $actualTo2 --> $actualTo3 $actualTo3 --> $actualTo4 $actualTo4 --> $actualTo5 !if ($evt1 != "") $actualTo5 --> $evt1 !endif !if ($evt2 != "") $actualTo5 --> $evt2 !endif !if ($evt3 != "") $actualTo5 --> $evt3 !endif !endprocedure !procedure $flow8($from, $through, $to1, $to2, $to3, $to4, $to5, $to6) !$actualThrough = $processElement($through, $from) !$actualTo1 = $processElement($to1, $from) !$actualTo2 = $processElement($to2, $from) !$actualTo3 = $processElement($to3, $from) !$actualTo4 = $processElement($to4, $from) !$actualTo5 = $processElement($to5, $from) !$actualTo6 = $processElement($to6, $from) $from --> $actualThrough $actualThrough --> $actualTo1 $actualTo1 --> $actualTo2 $actualTo2 --> $actualTo3 $actualTo3 --> $actualTo4 $actualTo4 --> $actualTo5 $actualTo5 --> $actualTo6 !endprocedure !procedure EsEntity($shape, $stereotype, $id, $label="") !if ($label != "") $shape "$label" as $id <<$stereotype>> !else $shape $id <<$stereotype>> !endif !endprocedure show stereotype skinparam defaultTextAlignment center skinparam wrapWidth 200 skinparam maxMessageSize 150 skinparam Arrow { Color $FONT_COLOR FontColor $FONT_COLOR FontSize $FONT_SIZE_SM } ' definition of the Item eventstorming/Element/FacadeCommand skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #779fae } !procedure FacadeCommand($id, $label="") EsEntity('file', 'FacadeCommand', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Command skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #aec6cf } !procedure Command($id, $label="") EsEntity('file', 'Command', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Result skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #cfcfc4 } !procedure Result($id, $label="") EsEntity('file', 'Result', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Event skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #ffb853 } !procedure TransactionalEvent($id, $label="") EsEntity('file', 'TransactionalEvent', $id, $label) !endprocedure skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #ffb853 } !procedure Event($id, $label="") EsEntity('file', 'Event', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/DomainEvent skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #ffcb81 } !procedure DomainEvent($id, $label="") EsEntity('file', 'DomainEvent', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/IntegrationEvent skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #ffdeaf } !procedure IntegrationEvent($id, $label="") EsEntity('file', 'IntegrationEvent', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Query skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #62d862 } !procedure Query($id, $label="") EsEntity('file', 'Query', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/ReadModel skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #77dd77 } !procedure ReadModel($id, $label="") EsEntity('file', 'ReadModel', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/UserInterface skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #a2e8a2 } !procedure UserInterface($id, $label="") EsEntity('file', 'UserInterface', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Aggregate skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #fdfd9d } !procedure Aggregate($id, $label="") EsEntity('file', 'Aggregate', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Service skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #fcfc78 } !procedure Service($id, $label="") EsEntity('file', 'Service', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Policy skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #b6a2db } !procedure Policy($id, $label="") EsEntity('file', 'Policy', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Saga skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #c9bbe5 } !procedure Saga($id, $label="") EsEntity('file', 'Saga', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Process skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #ddd4ee } !procedure Process($id, $label="") EsEntity('file', 'Process', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Timer skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #cfcfc4 } !procedure Timer($id, $label="") EsEntity('file', 'Timer', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Person skinparam actor<> { StereotypeFontSize 0 shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #ffd1dc } !procedure Person($id, $label="") EsEntity('actor', 'Person', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/System skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #ffd1dc } !procedure System($id, $label="") EsEntity('file', 'System', $id, $label) !endprocedure ' definition of the Item eventstorming/Element/Comment skinparam file<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor transparent } !procedure Comment($id, $label="") EsEntity('file', 'Comment', $id, $label) !endprocedure skinparam rectangle<> { StereotypeFontSize $FONT_SIZE_SM shadowing false FontColor $FONT_COLOR BorderColor $FONT_COLOR BackgroundColor #e8f4fd } !procedure Handler($id, $label="") EsEntity('file', 'Handler', $id, $label) !endprocedure