fixed create process instance

This commit is contained in:
mike cullerton 2022-06-10 08:11:26 -04:00
parent 7c82415757
commit a0eaee3646
3 changed files with 12 additions and 9 deletions

View File

@ -170,7 +170,7 @@ paths:
# process_instance_create
post:
operationId: spiffworkflow_backend.routes.process_api_blueprint.process_instance_create
summary: Creates a workflow from a workflow spec and returns the workflow
summary: Creates an process instance from a process model and returns the instance
tags:
- Process Instances
responses:

View File

@ -49,7 +49,6 @@ def process_group_add(body):
def process_group_delete(process_group_id):
ProcessModelService().process_group_delete(process_group_id)
print("process_group_delete")
def process_groups_list():
@ -154,7 +153,7 @@ def add_file(process_model_id):
)
def process_instance_create(process_model_id):
def process_instance_create(process_group_id, process_model_id):
"""Create_process_instance."""
process_instance = ProcessInstanceService.create_process_instance(
process_model_id, g.user

View File

@ -109,9 +109,11 @@ def test_process_group_delete(app, client: FlaskClient, with_bpmn_file_cleanup):
assert persisted is not None
assert persisted.id == process_group_id
client.delete(
f"/v1.0/process-groups/{process_group_id}", headers=logged_in_headers(user)
)
client.delete(f"/v1.0/process-groups/{process_group_id}",
headers=logged_in_headers(user))
deleted = ProcessModelService().get_process_group(process_group_id)
assert deleted is None
print(f"test_process_group_delete: {__name__}")
@ -173,13 +175,15 @@ def test_get_file(app, client: FlaskClient, with_bpmn_file_cleanup):
def test_get_workflow_from_workflow_spec(
app, client: FlaskClient, with_bpmn_file_cleanup
app,
client: FlaskClient,
with_bpmn_file_cleanup
):
"""Test_get_workflow_from_workflow_spec."""
user = find_or_create_user()
spec = load_test_spec(app, "hello_world")
response = client.post(
f"/v1.0/process-models/{spec.id}", headers=logged_in_headers(user)
f"/v1.0/process-models/{spec.process_group_id}/{spec.id}", headers=logged_in_headers(user)
)
assert response.status_code == 201
assert "hello_world" == response.json["process_model_identifier"]
@ -355,7 +359,7 @@ def create_process_instance(
"""Create_process_instance."""
load_test_spec(app, process_model_dir_name, process_group_id=test_process_group_id)
response = client.post(
f"/v1.0/process-models/{process_group_id}/{process_model_dir_name}",
f"/v1.0/process-models/{test_process_group_id}/{process_model_dir_name}",
headers=headers,
)
assert response.status_code == 201