```plantuml
!ifndef FONTNAME
!define FONTNAME "sans-serif"
!endif
 
!ifndef FONTSIZE
!define FONTSIZE 11
!endif

!define PRIMARY 000
!define SECONDARY 333

!function font_style()
   fontColor PRIMARY
   fontName FONTNAME
   fontSize FONTSIZE
   stereotypeFontColor SECONDARY
   stereotypeFontSize FONTSIZE
!endfunction

A --> B
```

---

##### Procedure
```plantuml
@startuml
!procedure msg($source, $destination)
$source --> $destination
!endprocedure

!procedure init_class($name)
class $name {
$addCommonMethod()
}
!endprocedure


!procedure $addCommonMethod()
  toString()
  hashCode()
!endprocedure


init_class("foo1")
init_class("foo2")
msg("foo1", "foo2")
@enduml
```

---

##### Logging
```plantuml
@startuml
!function bold($text)
!$result = "<b>"+ $text +"</b>"
!log Calling bold function with $text. The result is $result
!return $result
!endfunction

Alice -> Bob : This is bold("bold")
Alice -> Bob : This is bold("a second call")
@enduml
```

---

##### Conditions
```plantuml
@startuml
!$a = 10
!$ijk = "foo"
Alice -> Bob : A
!if ($ijk == "foo") && ($a+10>=4)
Alice -> Bob : yes
!else
Alice -> Bob : This should not appear
!endif
Alice -> Bob : B
@enduml
```

---

##### Variable definition
```plantuml
@startuml
!$ab = "foo1"
!$cd = "foo2"
!$ef = $ab + $cd

Alice -> Bob : $ab
Alice -> Bob : $cd
Alice -> Bob : $ef
@enduml
```

---

##### Return function
```plantuml
@startuml
!function $double($a)
!return $a + $a
!endfunction

Alice -> Bob : The double of 3 is $double(3)
@enduml
```

```plantuml
@startuml
!function $double($a) !return $a + $a

Alice -> Bob : The double of 3 is $double(3)
Alice -> Bob : $double("This work also for strings.")
@enduml
```

```plantuml
@startuml
!function $dummy()
!local $ijk = "local"
!return "Alice -> Bob : " + $ijk
!endfunction

!global $ijk = "foo"

Alice -> Bob : $ijk
$dummy()
Alice -> Bob : $ijk
@enduml
```

---

##### Default argument value
```plantuml
@startuml
!function $inc($value, $step=1)
!return $value + $step
!endfunction

Alice -> Bob : Just one more $inc(3)
Alice -> Bob : Add two to three : $inc(3, 2)
@enduml
```

```plantuml
@startuml
!procedure defaulttest($x, $y="DefaultY", $z="DefaultZ")
note over Alice
  x = $x
  y = $y
  z = $z
end note
!endprocedure

defaulttest(1, 2, 3)
defaulttest(1, 2)
defaulttest(1)
@enduml
```

---

##### Unquoted procedure or function
```plantuml
@startuml
!unquoted function id($text1, $text2="FOO") !return $text1 + $text2

alice -> bob : id(aa)
alice -> bob : id(ab,cd)
@enduml
```

---

##### 
```plantuml
A --> B
```