Attributes of parallel tasks are not updated frequently enough
The below program contains a parallel with a simple sequential task, and another task that starts a top-level task to update the titles of all tasks in the parallel every second. The
parallel is arranged with tabs, so these titles appear as tab titles.
Expected behaviour: every second, the title of the tab changes to the current time.
- The title of the tab only changes when the value of the input field is changed by the user
- After pressing continue, even this does not allow the title to change any more; the title remains frozen
tis simply an
>>! t), changing the value of the input field also does not allow the title to change
parallelTaskList (Internal.TaskState), writing to the share sets
unsyncedAttributes, which is used in
evalEmbeddedParallelTask (WF.Combinators.Core) to change the UI. My guess for problem 1 is that
evalEmbeddedParallelTask is only called when the task is reevaluated, therefore the title does update until this happens. Maybe we have to force an evaluation for the relevant task when
parallelTaskList (or even
taskListMetaData) is written to?
import Data.Func import qualified Data.Map import iTasks import iTasks.Extensions.DateTime Start w = doTasks (ArrangeWithTabs False @>> task) w where task = get currentTaskInstanceNo >>- \instanceNo -> parallel [ (Embedded, \_ -> t 1 @! ()) , (Embedded, \list -> appendTopLevelTask 'Data.Map'.newMap True (setTitle list) @! ()) ]  t i = updateInformation  i >>! t setTitle list = forever $ waitForTimer True 1 >>- \datetime -> upd (\(_,items) -> [ ( i.TaskListItem.taskId , 'Data.Map'.singleton "title" (JSONString (toString datetime)) ) \\ i <- items ]) (sdsFocus fullTaskListFilter list) @! ()