From b81bccd307dff4db9a82c978d46a0ff7d4a285e2 Mon Sep 17 00:00:00 2001 From: Fabio Roberto Vitello <fabio.vitello@inaf.it> Date: Mon, 19 Oct 2020 16:50:31 +0200 Subject: [PATCH] TMSS-361: Renamed demo workflow --- SAS/TMSS/src/tmss/workflowapp/flows/CMakeLists.txt | 2 +- SAS/TMSS/src/tmss/workflowapp/flows/__init__.py | 2 +- ...schedulingunitdemoflow.py => schedulingunitflow.py} | 10 +++++----- SAS/TMSS/src/tmss/workflowapp/models/CMakeLists.txt | 2 +- SAS/TMSS/src/tmss/workflowapp/models/__init__.py | 2 +- ...schedulingunitdemoflow.py => schedulingunitflow.py} | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) rename SAS/TMSS/src/tmss/workflowapp/flows/{schedulingunitdemoflow.py => schedulingunitflow.py} (96%) rename SAS/TMSS/src/tmss/workflowapp/models/{schedulingunitdemoflow.py => schedulingunitflow.py} (65%) diff --git a/SAS/TMSS/src/tmss/workflowapp/flows/CMakeLists.txt b/SAS/TMSS/src/tmss/workflowapp/flows/CMakeLists.txt index 769f922e478..ba35dcf6abd 100644 --- a/SAS/TMSS/src/tmss/workflowapp/flows/CMakeLists.txt +++ b/SAS/TMSS/src/tmss/workflowapp/flows/CMakeLists.txt @@ -4,7 +4,7 @@ include(PythonInstall) set(_py_files __init__.py helloworldflow.py - schedulingunitdemoflow.py + schedulingunitflow.py ) python_install(${_py_files} diff --git a/SAS/TMSS/src/tmss/workflowapp/flows/__init__.py b/SAS/TMSS/src/tmss/workflowapp/flows/__init__.py index 45516795a25..a0ae3713747 100644 --- a/SAS/TMSS/src/tmss/workflowapp/flows/__init__.py +++ b/SAS/TMSS/src/tmss/workflowapp/flows/__init__.py @@ -1,2 +1,2 @@ from .helloworldflow import * -from .schedulingunitdemoflow import * \ No newline at end of file +from .schedulingunitflow import * \ No newline at end of file diff --git a/SAS/TMSS/src/tmss/workflowapp/flows/schedulingunitdemoflow.py b/SAS/TMSS/src/tmss/workflowapp/flows/schedulingunitflow.py similarity index 96% rename from SAS/TMSS/src/tmss/workflowapp/flows/schedulingunitdemoflow.py rename to SAS/TMSS/src/tmss/workflowapp/flows/schedulingunitflow.py index 0a2882d7a45..fbbbb27b607 100644 --- a/SAS/TMSS/src/tmss/workflowapp/flows/schedulingunitdemoflow.py +++ b/SAS/TMSS/src/tmss/workflowapp/flows/schedulingunitflow.py @@ -65,8 +65,8 @@ class Condition(Signal): super(Condition, self).ready() @frontend.register -class SchedulingUnitDemoFlow(Flow): - process_class = models.SchedulingUnitDemoProcess +class SchedulingUnitFlow(Flow): + process_class = models.SchedulingUnitProcess # 0. Start on SU instantiation # 1. To be Manually scheduled? -> Go to 1a @@ -113,7 +113,7 @@ class SchedulingUnitDemoFlow(Flow): flow.StartSignal( post_save, this.on_save_can_start, - sender=models.SchedulingUnitDemo + sender=models.SchedulingUnit ).Next(this.wait_schedulable) ) @@ -121,7 +121,7 @@ class SchedulingUnitDemoFlow(Flow): Condition( this.check_condition, post_save, - sender=models.SchedulingUnitDemo, + sender=models.SchedulingUnit, task_loader=this.get_scheduling_unit_task ) .Next(this.form) @@ -183,5 +183,5 @@ class SchedulingUnitDemoFlow(Flow): def get_scheduling_unit_task(self, flow_task, sender, instance, **kwargs): print(kwargs) - process = models.SchedulingUnitDemoProcess.objects.get(su=instance) + process = models.SchedulingUnitProcess.objects.get(su=instance) return Task.objects.get(process=process,flow_task=flow_task) diff --git a/SAS/TMSS/src/tmss/workflowapp/models/CMakeLists.txt b/SAS/TMSS/src/tmss/workflowapp/models/CMakeLists.txt index 1c94f0a15d5..57e7e39aac4 100644 --- a/SAS/TMSS/src/tmss/workflowapp/models/CMakeLists.txt +++ b/SAS/TMSS/src/tmss/workflowapp/models/CMakeLists.txt @@ -4,7 +4,7 @@ include(PythonInstall) set(_py_files __init__.py helloworldflow.py - schedulingunitdemoflow.py + schedulingunitflow.py ) python_install(${_py_files} diff --git a/SAS/TMSS/src/tmss/workflowapp/models/__init__.py b/SAS/TMSS/src/tmss/workflowapp/models/__init__.py index 45516795a25..a0ae3713747 100644 --- a/SAS/TMSS/src/tmss/workflowapp/models/__init__.py +++ b/SAS/TMSS/src/tmss/workflowapp/models/__init__.py @@ -1,2 +1,2 @@ from .helloworldflow import * -from .schedulingunitdemoflow import * \ No newline at end of file +from .schedulingunitflow import * \ No newline at end of file diff --git a/SAS/TMSS/src/tmss/workflowapp/models/schedulingunitdemoflow.py b/SAS/TMSS/src/tmss/workflowapp/models/schedulingunitflow.py similarity index 65% rename from SAS/TMSS/src/tmss/workflowapp/models/schedulingunitdemoflow.py rename to SAS/TMSS/src/tmss/workflowapp/models/schedulingunitflow.py index b9797a0b12e..db9cb36ee21 100644 --- a/SAS/TMSS/src/tmss/workflowapp/models/schedulingunitdemoflow.py +++ b/SAS/TMSS/src/tmss/workflowapp/models/schedulingunitflow.py @@ -3,11 +3,11 @@ from django.db.models import CharField, IntegerField,BooleanField, ForeignKey, CASCADE, Model from viewflow.models import Process -class SchedulingUnitDemo(Model): +class SchedulingUnit(Model): name = CharField(max_length=50) state = IntegerField() -class SchedulingUnitDemoProcess(Process): +class SchedulingUnitProcess(Process): text = CharField(max_length=150) approved = BooleanField(default=False) - su = ForeignKey(SchedulingUnitDemo, blank=True, null=True, on_delete=CASCADE) + su = ForeignKey(SchedulingUnit, blank=True, null=True, on_delete=CASCADE) -- GitLab