Development #51942
rafraichir l'objet courant après l'exécution d'un workflow d'une autre demande/fiche
Début:
11 mars 2021
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
(Via #51784#note-10)
On peut se trouver à appeler un workflow sur une autre demande/fiche (via l'action "création d'une demande" ou "workflow externe") et cette exécution peut se trouver modifier l'objet initial; on devrait donc après coup rafraichir les données depuis la db.
--- a/wcs/wf/create_formdata.py +++ b/wcs/wf/create_formdata.py @@ -435,6 +435,7 @@ class CreateFormdataWorkflowStatusItem(WorkflowStatusItem): code.formdata = new_formdata # this will .store() the code new_formdata.perform_workflow() new_formdata.store() + # TODO: formdata.refresh_from_db() if new_formdata.user_id is None and not new_formdata.backoffice_submission and get_session(): get_session().mark_anonymous_formdata(new_formdata) diff --git a/wcs/wf/external_workflow.py b/wcs/wf/external_workflow.py index 09c5e6290..f5f56d14a 100644 --- a/wcs/wf/external_workflow.py +++ b/wcs/wf/external_workflow.py @@ -226,5 +226,7 @@ class ExternalWorkflowGlobalAction(WorkflowStatusItem): get_publisher().substitutions.feed(caller_source) perform_items(trigger.parent.items, target_data) + # TODO: formdata.refresh_from_db() + register_item_class(ExternalWorkflowGlobalAction)
avec cette nouvelle méthode refresh_from_db à créer.
(ça demande aussi de s'assurer qu'on fasse un .store() avant l'exécution du workflow tiers).
Fichiers
Révisions associées
workflows: refresh object after execution of external workflow (#51942)
Historique
Mis à jour par Frédéric Péters il y a environ 3 ans
- Fichier 0001-workflows-refresh-object-after-execution-of-external.patch 0001-workflows-refresh-object-after-execution-of-external.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Thomas Noël il y a environ 3 ans
- Statut changé de Solution proposée à Solution validée
Limpide.
Mis à jour par Frédéric Péters il y a environ 3 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 218b4a803664a7e47dd1c2308bb78eca91c2d7cf Author: Frédéric Péters <fpeters@entrouvert.com> Date: Fri Mar 12 09:19:55 2021 +0100 workflows: refresh object after execution of external workflow (#51942)
Mis à jour par Frédéric Péters il y a environ 3 ans
- Statut changé de Résolu (à déployer) à Solution déployée
workflows: refresh object after execution of external workflow (#51942)