Skip to content

Commit

Permalink
Merge pull request #1255 from Amsterdam/feature/add-sub-wf
Browse files Browse the repository at this point in the history
Add 2 new tasks to subworkflow
  • Loading branch information
NvdLaan authored Aug 6, 2024
2 parents eb61e8e + c898783 commit dce4f9b
Show file tree
Hide file tree
Showing 12 changed files with 2,098 additions and 19 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ jobs:

- run: docker network create zaken_network
- run: docker network create top_and_zaak_backend_bridge
- run: docker-compose -f docker-compose.local.yml up --detach
# - run: docker-compose -f docker-compose.tests.yml up
- run: docker compose -f docker-compose.local.yml up --detach
- run: sleep 30
- run: bash bin/setup_credentials.sh
- run: ./e2e-tests/fix_models.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- run: docker network create top_and_zaak_backend_bridge
working-directory: backend

- run: docker-compose -f docker-compose.local.yml up --build --detach
- run: docker compose -f docker-compose.local.yml up --build --detach
working-directory: backend

###################################################
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- name: Linting
run: bash bin/cleanup_pre_commit.sh
- name: Build Docker image
run: docker-compose -f docker-compose.local.yml build
run: docker compose -f docker-compose.local.yml build
- name: Create Docker network
run: docker network create zaken_network
- name: Create TOP and Zaken Docker network
run: docker network create top_and_zaak_backend_bridge
- name: Start images
run: docker-compose -f docker-compose.local.yml up -d
run: docker compose -f docker-compose.local.yml up -d
- name: Run Tests
run: docker-compose -f docker-compose.local.yml exec -T zaak-gateway python manage.py test
run: docker compose -f docker-compose.local.yml exec -T zaak-gateway python manage.py test
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ First, make sure you have built the project and executed the database migrations
```bash
docker network create top_and_zaak_backend_bridge
docker network create zaken_network
docker-compose -f docker-compose.local.yml build
docker compose -f docker-compose.local.yml build
```

Start AZA backend:

```bash
docker-compose -f docker-compose.local.yml up
docker compose -f docker-compose.local.yml up
```

To create all necessary credentials run the following command:
Expand Down Expand Up @@ -95,7 +95,7 @@ docker compose -f docker-compose.local.yml run --rm zaak-gateway python manage.p
Or a specific test:

```bash
docker-compose -f docker-compose.local.yml exec -T zaak-gateway python manage.py test apps.addresses.tests.tests_models.AddressModelTest.test_can_create_address_with_bag_result_without_stadsdeel
docker compose -f docker-compose.local.yml exec -T zaak-gateway python manage.py test apps.addresses.tests.tests_models.AddressModelTest.test_can_create_address_with_bag_result_without_stadsdeel
```


Expand Down Expand Up @@ -173,7 +173,7 @@ To improve reliability, the health checks should be expanded for each essential
It's possible to generate a graph of the datamodel using the following command:

```
docker-compose run --rm zaak-gateway python manage.py graph_models cases debriefings permits fines addresses events visits summons -X ModelEventEmitter,ModelEditableTimeConstraint,ModelEditablelBase --pygraphviz -o diagram.png
docker compose run --rm zaak-gateway python manage.py graph_models cases debriefings permits fines addresses events visits summons -X ModelEventEmitter,ModelEditableTimeConstraint,ModelEditablelBase --pygraphviz -o diagram.png
```

Note that the apps and models should be updated whenever applications and models are added or modified.
Expand Down
1,914 changes: 1,914 additions & 0 deletions app/apps/workflow/bpmn_files/default/sub_workflow/7.1.0/sub_workflow.bpmn

Large diffs are not rendered by default.

136 changes: 136 additions & 0 deletions app/apps/workflow/fixtures/fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -1032,5 +1032,141 @@
"message_name": "start_handhavingsverzoek",
"to_directing_proccess": false
}
},
{
"model": "workflow.workflowoption",
"pk": 122,
"fields": {
"theme": 2,
"name": "Doorzon PV",
"message_name": "start_doorzon_pv",
"to_directing_proccess": false,
"enabled_on_case_closed": true
}
},
{
"model": "workflow.workflowoption",
"pk": 123,
"fields": {
"theme": 4,
"name": "Doorzon PV",
"message_name": "start_doorzon_pv",
"to_directing_proccess": false,
"enabled_on_case_closed": true
}
},
{
"model": "workflow.workflowoption",
"pk": 124,
"fields": {
"theme": 5,
"name": "Doorzon PV",
"message_name": "start_doorzon_pv",
"to_directing_proccess": false,
"enabled_on_case_closed": true
}
},
{
"model": "workflow.workflowoption",
"pk": 125,
"fields": {
"theme": 6,
"name": "Doorzon PV",
"message_name": "start_doorzon_pv",
"to_directing_proccess": false,
"enabled_on_case_closed": true
}
},
{
"model": "workflow.workflowoption",
"pk": 126,
"fields": {
"theme": 7,
"name": "Doorzon PV",
"message_name": "start_doorzon_pv",
"to_directing_proccess": false,
"enabled_on_case_closed": true
}
},
{
"model": "workflow.workflowoption",
"pk": 127,
"fields": {
"theme": 8,
"name": "Doorzon PV",
"message_name": "start_doorzon_pv",
"to_directing_proccess": false,
"enabled_on_case_closed": true
}
},
{
"model": "workflow.workflowoption",
"pk": 128,
"fields": {
"theme": 2,
"name": "Terug melding BAG",
"message_name": "start_terugmelding_bag",
"to_directing_proccess": false
}
},
{
"model": "workflow.workflowoption",
"pk": 129,
"fields": {
"theme": 3,
"name": "Terug melding BAG",
"message_name": "start_terugmelding_bag",
"to_directing_proccess": false
}
},
{
"model": "workflow.workflowoption",
"pk": 130,
"fields": {
"theme": 4,
"name": "Terug melding BAG",
"message_name": "start_terugmelding_bag",
"to_directing_proccess": false
}
},
{
"model": "workflow.workflowoption",
"pk": 131,
"fields": {
"theme": 5,
"name": "Terug melding BAG",
"message_name": "start_terugmelding_bag",
"to_directing_proccess": false
}
},
{
"model": "workflow.workflowoption",
"pk": 132,
"fields": {
"theme": 6,
"name": "Terug melding BAG",
"message_name": "start_terugmelding_bag",
"to_directing_proccess": false
}
},
{
"model": "workflow.workflowoption",
"pk": 133,
"fields": {
"theme": 7,
"name": "Terug melding BAG",
"message_name": "start_terugmelding_bag",
"to_directing_proccess": false
}
},
{
"model": "workflow.workflowoption",
"pk": 134,
"fields": {
"theme": 8,
"name": "Terug melding BAG",
"message_name": "start_terugmelding_bag",
"to_directing_proccess": false
}
}
]
8 changes: 8 additions & 0 deletions app/apps/workflow/user_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,3 +1008,11 @@ class task_administrative_hercontrole(user_task):

class task_opstellen_verslag_digitale_hercontrole(user_task):
due_date = relativedelta(days=3)


class task_doorzon_pv(user_task):
"""Doorzon PV"""


class task_sub_workflow_terug_melding_bag(user_task):
"""Terug melding BAG"""
22 changes: 22 additions & 0 deletions app/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,28 @@ def get_redis_url():
"start_verzoek_opheffing_openbaarmaking_namen": {},
},
},
"7.1.0": {
"messages": {
"start_signal_process": {},
"start_correspondence_process": {},
"start_callbackrequest_process": {},
"start_objectionfile_process": {},
"start_extra_information": {},
"start_nuisance_process": {},
"start_casus_overleg_proces": {},
"start_opstellen_digitale_analyse_proces": {},
"start_aanleveren_wob_dossier": {},
"start_terugkoppelen_bi": {},
"start_uitkomst_corporatie_proces": {},
"start_rapport_bewoners": {},
"start_afsluiten_zaak": {},
"start_mma_signal_process": {},
"start_lod_verzoek_tot_opheffing": {},
"start_verzoek_opheffing_openbaarmaking_namen": {},
"start_doorzon_pv": {},
"start_terugmelding_bag": {},
},
},
},
},
"summon": {
Expand Down
2 changes: 1 addition & 1 deletion bin/setup_credentials.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Creates a superuser for the zaak-gateway backend
echo "from django.contrib.auth import get_user_model; get_user_model().objects.create_superuser('[email protected]', 'insecure')" | docker-compose -f docker-compose.local.yml run -T --rm zaak-gateway python manage.py shell
echo "from django.contrib.auth import get_user_model; get_user_model().objects.create_superuser('[email protected]', 'insecure')" | docker compose -f docker-compose.local.yml run -T --rm zaak-gateway python manage.py shell
2 changes: 1 addition & 1 deletion bin/setup_user_groups.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ group.permissions.add(Permission.objects.get(name=\"Create a new 'Digitaal toezi
(group, _) = UserGroup.objects.get_or_create(name='TOEZICHTHOUDER_DIGITAAL_TOEZICHT', display_name='Toezichthouder - Digitaal toezicht')
group.permissions.add(Permission.objects.get(name=\"Can read 'Digitaal toezicht'\"))
group.permissions.add(Permission.objects.get(name=\"Create a new 'Digitaal toezicht' Case\"))" | docker-compose -f docker-compose.local.yml run -T --rm zaak-gateway python manage.py shell
group.permissions.add(Permission.objects.get(name=\"Create a new 'Digitaal toezicht' Case\"))" | docker compose -f docker-compose.local.yml run -T --rm zaak-gateway python manage.py shell
6 changes: 3 additions & 3 deletions e2e-tests/fix_models.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
docker-compose -f docker-compose.local.yml run --rm zaak-gateway python manage.py shell -c "
docker compose -f docker-compose.local.yml run --rm zaak-gateway python manage.py shell -c "
from django.contrib.auth import get_user_model
get_user_model().objects.get_or_create(email='[email protected]', first_name='local', last_name='user')"

docker-compose -f docker-compose.local.yml run --rm zaak-gateway python manage.py shell -c "
docker compose -f docker-compose.local.yml run --rm zaak-gateway python manage.py shell -c "
from apps.users.models import User, UserGroup
from django.contrib.auth.models import Permission
(group, _) = UserGroup.objects.get_or_create(name='PROJECTHANDHAVER', display_name='Projecthandhaver')
Expand All @@ -14,7 +14,7 @@ group.permissions.add(Permission.objects.get(name='Can read gevoelige dossiers')
user = User.objects.get(email='[email protected]')
user.groups.add(group)"

docker-compose -f docker-compose.local.yml run --rm zaak-gateway python manage.py shell -c "
docker compose -f docker-compose.local.yml run --rm zaak-gateway python manage.py shell -c "
from django_celery_beat.models import PeriodicTask, IntervalSchedule
schedule, created = IntervalSchedule.objects.get_or_create(every=10, period=IntervalSchedule.SECONDS)
PeriodicTask.objects.get_or_create(interval=schedule, name='Update workflows', task='apps.workflow.tasks.task_update_workflows')"
8 changes: 4 additions & 4 deletions e2e-tests/setup_or_reset_and_start.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash

docker-compose down
docker compose down

docker volume rm $(docker volume ls -q)

docker-compose -f ../docker-compose.local.yml build
docker compose -f ../docker-compose.local.yml build

docker-compose run --rm zaak-gateway python manage.py migrate
docker compose run --rm zaak-gateway python manage.py migrate

bash ../bin/setup_credentials.sh

./fix_models.sh

docker-compose -f ../docker-compose.local.yml up
docker compose -f ../docker-compose.local.yml up

0 comments on commit dce4f9b

Please sign in to comment.