How to use the decision block?

Hi,


Can you please explain how the decisionblock is used?
What kind of data can be added in the condition inside the block?

F.e.: Can I compair the value of Workflow variable? 
Condition: MyWFvariable > 0

Please give me some examples and a general explanation of how to set this up.

I decision block you input a boolean expression. This expression follows scripter rules, which means it uses pascal syntax and can use any function registered in script, and also of course the workflow variables can be used. So the decision block will take the path depending if the boolean expression evaluates true or false.

Suppose a decision block is add after a script. When will the decision block be executed? Is this done after the script is completely executed (including some external processing of code, like creating a file and storing the recordno of the created file into a WF-var)?

In my case I want to check of there is actually a document created (WF-var: RecordIDCreated > 0). But when will this WF-var be updated. If (RecordIDCreated > 0) the next task is opened, otherwise the task for creating the document needs to be re-opened.

Task1 -> Start create document
Script -> Create document by executing some code on the mainform
Decision -> Document created (RecordIDCreated > 0)
if YES   Task2 -> Ask for approval
if NO     Task1 is reopened

Yes, one block starts executing only after the previous block is completely executed. So the script must finished until execution flow hits the decision block. So, if your Script block updates the value of RecordIDCreated variable, it will run just fine.

Ok, thank you very much.