[{TableOfContents title='Contents'}]

!! Definition\\
Diaflux is a graphical workflow authoring plugin for KnowWE.\\
It is used to model complex problems in an easy to read and understandable fashion.\\

!! Syntax and Semantic\\
An Diaflux workflow is defined inside the markup __DiaFlux__\\

! Example

%%DiaFlux
<flowchart fcid="flow_7184e213" name="ExampleWorkFlow" icon="sanduhr.gif" width="750" height="500" autostart="false" idCounter="23">

	<!-- nodes of the flowchart -->
	<node fcid="#node_2">
		<position left="57" top="44"></position>
		<start>start</start>
	</node>

	<node fcid="#node_3">
		<position left="591" top="379"></position>
		<exit>exit</exit>
	</node>

	<node fcid="#node_5">
		<position left="231" top="59"></position>
		<decision>"ambient_temperature"</decision>
	</node>

	<node fcid="#node_6">
		<position left="317" top="157"></position>
		<action markup="KnOffice">"warm" = P7</action>
	</node>

	<node fcid="#node_9">
		<position left="196" top="157"></position>
		<action markup="KnOffice">"cold" = P7</action>
	</node>

	<node fcid="#node_11">
		<position left="572" top="157"></position>
		<action markup="KnOffice">"just_fine" = P7</action>
	</node>

	<node fcid="#node_16">
		<position left="473" top="368"></position>
		<action markup="KnOffice">"just_fine" = N7</action>
	</node>

	<node fcid="#node_18">
		<position left="504" top="267"></position>
		<action markup="KnOffice">"warm" = N7</action>
	</node>

	<node fcid="#node_19">
		<position left="619" top="268"></position>
		<action markup="KnOffice">"cold" = N7</action>
	</node>


	<!-- rules of the flowchart -->
	<edge fcid="#rule_7">
		<origin>#node_2</origin>
		<target>#node_5</target>
	</edge>

	<edge fcid="#rule_8">
		<origin>#node_5</origin>
		<target>#node_6</target>
		<guard markup="KnOffice">"ambient_temperature" > 25</guard>
	</edge>

	<edge fcid="#rule_10">
		<origin>#node_5</origin>
		<target>#node_9</target>
		<guard markup="KnOffice">"ambient_temperature" < 25</guard>
	</edge>

	<edge fcid="#rule_12">
		<origin>#node_5</origin>
		<target>#node_11</target>
		<guard markup="KnOffice">"ambient_temperature" = 25</guard>
		<routingPoint x="0.9747292418772563" y="0" />
	</edge>

	<edge fcid="#rule_15">
		<origin>#node_6</origin>
		<target>#node_16</target>
		<routingPoint x="0" y="0.86" />
	</edge>

	<edge fcid="#rule_14">
		<origin>#node_9</origin>
		<target>#node_16</target>
		<routingPoint x="0" y="1" />
	</edge>

	<edge fcid="#rule_17">
		<origin>#node_16</origin>
		<target>#node_3</target>
	</edge>

	<edge fcid="#rule_20">
		<origin>#node_11</origin>
		<target>#node_18</target>
	</edge>

	<edge fcid="#rule_21">
		<origin>#node_11</origin>
		<target>#node_19</target>
	</edge>

	<edge fcid="#rule_22">
		<origin>#node_19</origin>
		<target>#node_3</target>
	</edge>

	<edge fcid="#rule_23">
		<origin>#node_18</origin>
		<target>#node_3</target>
	</edge>

</flowchart>


 @package: DiafluxExample
  
%


!! Diaflux Editor
The Diaflux workflow may be edited using the __Visual Editor__.
[{Image src='visual_editor.jpg' width='222' height='99' align='left' }]\\

[{Image src='visual_editor_edit_nodes.jpg' width='540' height='303' align='left' }]\\


! Diaflux elements
* __Start node__: entry point for a DiaFlux\\
* __Exit node__: exit point of a DiaFlux\\
* __Action node__: select a question or solution here and model an interaction with this node.\\
* __Comment node__: use this node to provide annotations to transitions or nodes.\\
* __SnapShot node__: used to inhibit the truth maintainance to reverse decisions before this snapshot. (Behaves like a diode.)\\

!Graphical tools\\
* __Increase height__ of diagram\\
* __Decrease height__ of diagram\\
* __Increase width__ of diagram\\
* __Decrease width__ of diagram\\

!Editor tools\\
* __Save flowchart and close editor__\\
* __Revert changes__\\
* __Close editor__ (without saving)\\
* __Delete flowchart__\\

!! Best Practices\\
* A Diaflux shall have a unique name.\\
* One Diaflux needs to be checked for Autostart. (That is where a session workflow will start.)\\
* Do not overload a single DiaFlux. Model rather small parts and reference them in a superior DiaFlux-Diagram.\\
  Rule of thumb: Not more than a monitors field of view.\\



%%collapsebox
!Terminology of DiafluxExample 

%%knowledgebase 
DiafluxExample
@comment: a simple example
@filename: knowledgebase.d3web
@version: 0.01
@uses: DiafluxExample
/%

%%Question
input
- user_inputs
-- ambient_temperature [num] {DEGREES_C}
@package: DiafluxExample
%

%%Solution
output
- system_output
-- warm
-- cold
-- just_fine
@package: DiafluxExample
%

%%