Skip to content
Snippets Groups Projects
Commit b81bccd3 authored by Fabio Vitello's avatar Fabio Vitello
Browse files

TMSS-361: Renamed demo workflow

parent 89209aed
No related branches found
No related tags found
1 merge request!255Resolve TMSS-361
......@@ -4,7 +4,7 @@ include(PythonInstall)
set(_py_files
__init__.py
helloworldflow.py
schedulingunitdemoflow.py
schedulingunitflow.py
)
python_install(${_py_files}
......
from .helloworldflow import *
from .schedulingunitdemoflow import *
\ No newline at end of file
from .schedulingunitflow import *
\ No newline at end of file
......@@ -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)
......@@ -4,7 +4,7 @@ include(PythonInstall)
set(_py_files
__init__.py
helloworldflow.py
schedulingunitdemoflow.py
schedulingunitflow.py
)
python_install(${_py_files}
......
from .helloworldflow import *
from .schedulingunitdemoflow import *
\ No newline at end of file
from .schedulingunitflow import *
\ No newline at end of file
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment