Projet

Général

Profil

Development #51942

rafraichir l'objet courant après l'exécution d'un workflow d'une autre demande/fiche

Ajouté par Frédéric Péters il y a environ 3 ans. Mis à jour il y a environ 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
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

Révision 218b4a80 (diff)
Ajouté par Frédéric Péters il y a environ 3 ans

workflows: refresh object after execution of external workflow (#51942)

Révision 05541118 (diff)
Ajouté par Frédéric Péters il y a environ 3 ans

workflows: refresh object after execution of external workflow (#51942)

Historique

#2

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Description mis à jour (diff)
#3

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Assigné à mis à Frédéric Péters
#4

Mis à jour par Frédéric Péters il y a environ 3 ans

#5

Mis à jour par Thomas Noël il y a environ 3 ans

  • Statut changé de Solution proposée à Solution validée

Limpide.

#6

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)
#7

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

Formats disponibles : Atom PDF