variable is not saved to table NFLOW_WORKFLOW_STATE

33 views
Skip to first unread message

Unicorn__

unread,
Mar 19, 2021, 9:59:39 AM3/19/21
to nflow-users
Hi 
I have situation when i execute the same step many times. 
Each time result shoudl be saved  to  stateVariables
with comand  - execution.setVariable(key,result)
and then i move to manual step.
 variable shoudl be saved to table NFLOW_WORKFLOW_STATE 
but i observed that sometimes they are not saved. 


It looks like sometimes nflow forget to save variable.

Is it possible that if i try to get WorkflowInstance before stateVariable is saved then 
i lost result and result is never saved ?
Or if i try to run the same step again before prev run save the state then result is not saved?

In this case how i can resolve this issue ?

Unicorn__

unread,
Mar 22, 2021, 3:52:47 AM3/22/21
to nflow-users
I shoudl add that i am using nflow 7.2.0

nflow-users

unread,
Mar 23, 2021, 12:54:38 PM3/23/21
to nflow-users
Hi,

State variables are saved in the same transaction as the workflow instance state is saved, i.e. after processing each state - as long as the state is persisted successfully, the state variables should not be lost.

Getting the workflow instance has no effect to saving the state variables. Depending on where and how you are getting the workflow instance, you might not see some changes that are not persisted by nFlow (yet). But for sure it should not prevent nFlow from persisting the changes when it's done.

nFlow engine cannot run any other steps of the same workflow instance before the state of the previous run has been persisted.

Could you write some test or pseudo code that demonstrates what you are trying to do?

br, Edvard

Unicorn__

unread,
Mar 25, 2021, 9:24:59 AM3/25/21
to nflow-users
Ok. looks like the problem in our case was in sequence NFLOW_WORKFLOW_ACTION_ID_SEQ
Oracle create this sequence with cache  size 20 - in our case that result in unpredicted order of records created in  FLOW_WORKFLOW_ACTION  table.

When we remove cache then action ids are assigned in right order and we get results in right order. And nothing is lost.
We modyfied our sql scripts for this  :

create sequence nflow_workflow_action_id_seq nocache

create sequence nflow_workflow_id_seq nocache

Edvard Fonsell

unread,
Mar 25, 2021, 10:06:50 AM3/25/21
to nflow-users
Thanks for the info, we will include these fixes in the Oracle scripts for the next release.
Reply all
Reply to author
Forward
0 new messages