Every transition has script block
It's highly recommended that you update tasks from Workflow classes. Example:
No, I can't.
You can simply put script blocks after each transition and process a custom code for each case. After the script blocks, go to the Block 2.
Can you show me, how to do insert/update in script blocks on every transition?
Actually if you just want to execute an SQL statement, you can use the Database block, which is built for that purpose. Just drop the database block and write the SQL you want to be executed in the database.
Or, how to set adequte internal status on Block 2 depending which transition was used?
You don't do that in advance. Before the Block 2 is reached, no task is created (I assume Block 2 is a task block, right)? You can't set a task status before it's created. I've been asking you specific and technical questions about database access, but what exactly you want to achieve (at a higher level)?
I define new variable.
If you are using a script block, you can access the variable directly from script:
I need to read my variable from application (from Delphi)