diff --git a/SAS/TMSS/src/tmss/settings.py b/SAS/TMSS/src/tmss/settings.py index e8b60ccede3319cf623eda0852283b367fbdc05a..762d4d99eaf1b899fe171791c4b2a2698cccdff4 100644 --- a/SAS/TMSS/src/tmss/settings.py +++ b/SAS/TMSS/src/tmss/settings.py @@ -92,7 +92,8 @@ INSTALLED_APPS = [ 'drf_yasg', 'django_filters', 'material', - 'material.frontend'] + 'material.frontend' + ] MIDDLEWARE = [ 'django.middleware.gzip.GZipMiddleware', diff --git a/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py b/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py index 9cb552a539fbbc604782d358847513c485b697bd..5534c996057b8208ace312499448a71586833617 100644 --- a/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py +++ b/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.0.9 on 2020-11-30 08:59 +# Generated by Django 3.0.9 on 2020-12-02 20:16 from django.conf import settings import django.contrib.postgres.fields diff --git a/SAS/TMSS/src/tmss/urls.py b/SAS/TMSS/src/tmss/urls.py index 419387b6de0de0fc4df6daf65855dedc40be3490..253223e209b16dfdb83c72fa6dea65c014981a1f 100644 --- a/SAS/TMSS/src/tmss/urls.py +++ b/SAS/TMSS/src/tmss/urls.py @@ -234,6 +234,7 @@ if bool(os.environ.get('TMSS_ENABLE_VIEWFLOW', False)): viewflow_router.register('scheduling_unit_flow/qa_pi_verification', workflow_viewsets.PIVerificationViewSet, basename='qa_pi_verification') viewflow_router.register('scheduling_unit_flow/qa_decide_acceptance', workflow_viewsets.DecideAcceptanceViewSet, basename='qa_decide_acceptance') viewflow_router.register('scheduling_unit_flow/qa_scheduling_unit_process', workflow_viewsets.SchedulingUnitProcessViewSet, basename='qa_scheduling_unit_process') + viewflow_router.register('scheduling_unit_flow/qa_scheduling_unit_task', workflow_viewsets.SchedulingUnitTaskViewSet, basename='qa_scheduling_unit_task') viewflow_urlpatterns.extend(viewflow_router.urls) diff --git a/SAS/TMSS/src/tmss/workflowapp/apps.py b/SAS/TMSS/src/tmss/workflowapp/apps.py index 3ba8ab2cdb3c7e994ebf6bea7850ddc6128b9428..b4d7b07f0d004048aa3fac119f0354ee4bf5a38e 100644 --- a/SAS/TMSS/src/tmss/workflowapp/apps.py +++ b/SAS/TMSS/src/tmss/workflowapp/apps.py @@ -4,5 +4,5 @@ from django.apps import AppConfig class WorkflowappConfig(AppConfig): - name = 'lofar.sas.tmss.tmss.workflowapp' + name = 'workflowapp' diff --git a/SAS/TMSS/src/tmss/workflowapp/flows/schedulingunitflow.py b/SAS/TMSS/src/tmss/workflowapp/flows/schedulingunitflow.py index 32a11808966ceffc9468fc1d1a5bbd4e3695b47f..8bec6f43db23b4e229ff86c425fed3657bb6f81d 100644 --- a/SAS/TMSS/src/tmss/workflowapp/flows/schedulingunitflow.py +++ b/SAS/TMSS/src/tmss/workflowapp/flows/schedulingunitflow.py @@ -66,6 +66,7 @@ class Condition(Signal): activation.prepare() if activation.flow_task.condition_check(activation, instance): activation.done() + def ready(self): """Resolve internal `this`-references. and subscribe to the signal.""" @@ -210,7 +211,6 @@ class SchedulingUnitFlow(Flow): return activation - def check_condition_scheduled(self, activation, instance): if instance is None: instance = activation.process.su diff --git a/SAS/TMSS/src/tmss/workflowapp/migrations/0001_initial.py b/SAS/TMSS/src/tmss/workflowapp/migrations/0001_initial.py index aa03e1a4d75db411590a57f4ec385e3e0d39bd10..8119f3254e3b5d89bd1593f16b715b9d6f2d0d7a 100644 --- a/SAS/TMSS/src/tmss/workflowapp/migrations/0001_initial.py +++ b/SAS/TMSS/src/tmss/workflowapp/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.0.9 on 2020-11-26 09:54 +# Generated by Django 3.0.9 on 2020-12-02 20:16 from django.db import migrations, models import django.db.models.deletion @@ -9,6 +9,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ + ('tmssapp', '0001_initial'), ('viewflow', '0008_jsonfield_and_artifact'), ] @@ -45,19 +46,6 @@ class Migration(migrations.Migration): ('operator_accept', models.BooleanField(default=False)), ], ), - migrations.CreateModel( - name='HelloWorldProcess', - fields=[ - ], - options={ - 'verbose_name': 'World Request', - 'verbose_name_plural': 'World Requests', - 'proxy': True, - 'indexes': [], - 'constraints': [], - }, - bases=('viewflow.process',), - ), migrations.CreateModel( name='SchedulingUnitProcess', fields=[ diff --git a/SAS/TMSS/src/tmss/workflowapp/models/__init__.py b/SAS/TMSS/src/tmss/workflowapp/models/__init__.py index a0ae3713747c0b28c5595736d06f4bcb800da5b5..bfdfbc84e07beb363937412fd7fb6d5788c684d0 100644 --- a/SAS/TMSS/src/tmss/workflowapp/models/__init__.py +++ b/SAS/TMSS/src/tmss/workflowapp/models/__init__.py @@ -1,2 +1 @@ -from .helloworldflow import * from .schedulingunitflow import * \ No newline at end of file diff --git a/SAS/TMSS/src/tmss/workflowapp/models/schedulingunitflow.py b/SAS/TMSS/src/tmss/workflowapp/models/schedulingunitflow.py index c883b4fc9a3c857e2c2913df064c629d16239619..d33f462ed653833794709d701e3d0e0be47f05a4 100644 --- a/SAS/TMSS/src/tmss/workflowapp/models/schedulingunitflow.py +++ b/SAS/TMSS/src/tmss/workflowapp/models/schedulingunitflow.py @@ -1,7 +1,9 @@ # Create your models here. from django.db.models import CharField, IntegerField,BooleanField, ForeignKey, CASCADE, Model,NullBooleanField -from viewflow.models import Process +from viewflow.models import Process, Task +from viewflow.fields import FlowReferenceField +from viewflow.compat import _ from lofar.sas.tmss.tmss.tmssapp.models import SchedulingUnitBlueprint diff --git a/SAS/TMSS/src/tmss/workflowapp/serializers/schedulingunitflow.py b/SAS/TMSS/src/tmss/workflowapp/serializers/schedulingunitflow.py index 884061c224168ac706def57a833c5ee9cb7952bd..86a87874a523eb8c481e97d28141c2ed221f675f 100644 --- a/SAS/TMSS/src/tmss/workflowapp/serializers/schedulingunitflow.py +++ b/SAS/TMSS/src/tmss/workflowapp/serializers/schedulingunitflow.py @@ -4,6 +4,8 @@ from lofar.sas.tmss.tmss.workflowapp import models from django.views import generic from django.forms.models import modelform_factory +from viewflow.models import Task + from .. import forms @@ -31,5 +33,10 @@ class DecideAcceptanceSerializer(ModelSerializer): class SchedulingUnitProcessSerializer(ModelSerializer): class Meta: - model = models.SchedulingUnitProcess - fields = '__all__' \ No newline at end of file + model = models.SchedulingUnitProcess + fields = ['su','active_task','qa_reporting_to','qa_reporting_sos','pi_verification','decide_acceptance','can_delete','results_accepted','created','finished'] + +class SchedulingUnitTaskSerializer(ModelSerializer): + class Meta: + model = Task + fields = '__all__' \ No newline at end of file diff --git a/SAS/TMSS/src/tmss/workflowapp/viewsets/schedulingunitflow.py b/SAS/TMSS/src/tmss/workflowapp/viewsets/schedulingunitflow.py index 530d4cb8f9c0207c4c12212c1a4bce7832aa8d29..acaa7459631c3341df848686df8f8ba371f2dbd4 100644 --- a/SAS/TMSS/src/tmss/workflowapp/viewsets/schedulingunitflow.py +++ b/SAS/TMSS/src/tmss/workflowapp/viewsets/schedulingunitflow.py @@ -11,6 +11,7 @@ from viewflow.flow.views.utils import get_next_task_url from django.forms import CharField, CheckboxInput from django.forms.models import modelform_factory +from viewflow.models import Task from .. import forms, models, serializers @@ -36,6 +37,10 @@ class SchedulingUnitProcessViewSet(viewsets.ModelViewSet): queryset = models.SchedulingUnitProcess.objects.all() serializer_class = serializers.SchedulingUnitProcessSerializer +class SchedulingUnitTaskViewSet(viewsets.ModelViewSet): + queryset = Task.objects.all() + serializer_class = serializers.SchedulingUnitTaskSerializer + class QAReportingTOView(FlowMixin, generic.CreateView): template_name = 'qa_reporting.html' model = models.QAReportingTO