Skip to content

Commit

Permalink
[schellar] workflow_context as a json
Browse files Browse the repository at this point in the history
  • Loading branch information
Jozef Volak committed Aug 13, 2024
1 parent 912b0ed commit e3ec320
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions schellar/python/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
# 1.1.0
- Update dependencies
- Add response handler with task Failed status

# 1.2.0
workflow_context as a JSON input in workflow
changes stringify on workflow_context worker input
4 changes: 2 additions & 2 deletions schellar/python/frinx_worker/schellar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]:
)

if worker_input.workflow_context:
create_schedule.input.workflow_context = json_dumps(worker_input.workflow_context).replace('"', '\\"')
create_schedule.input.workflow_context = json_dumps(worker_input.workflow_context)

mutation = create_schedule.render(form="extracted")
response = execute_schellar_query(query=mutation.query, variables=mutation.variable)
Expand Down Expand Up @@ -279,7 +279,7 @@ def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]:
)

if worker_input.workflow_context:
update_schedule.input.workflow_context = json_dumps(worker_input.workflow_context).replace('"', '\\"')
update_schedule.input.workflow_context = json_dumps(worker_input.workflow_context)

mutation = update_schedule.render()
response = execute_schellar_query(query=mutation.query, variables=mutation.variable)
Expand Down
4 changes: 2 additions & 2 deletions schellar/python/frinx_worker/schellar/workflows/schellar.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class WorkflowInput(WorkflowImpl.WorkflowInput):
name="workflow_context",
frontend_default_value="",
description="Workflow input parameters in json format",
type=FrontendWFInputFieldType.STRING,
type=FrontendWFInputFieldType.JSON,
)

from_date: WorkflowInputField = WorkflowInputField(
Expand Down Expand Up @@ -159,7 +159,7 @@ class WorkflowInput(WorkflowImpl.WorkflowInput):
name="workflow_context",
frontend_default_value="",
description="Workflow input parameters in json format",
type=FrontendWFInputFieldType.STRING,
type=FrontendWFInputFieldType.JSON,
)

from_date: WorkflowInputField = WorkflowInputField(
Expand Down
2 changes: 1 addition & 1 deletion schellar/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ packages = [{ include = "frinx_worker" }]
name = "frinx-schellar-worker"
description = "Conductor worker for Schellar service"
authors = ["Jozef Volak <[email protected]>"]
version = "1.1.1"
version = "1.2.0"
readme = ["README.md", "CHANGELOG.md", "RELEASE.md"]
keywords = ["frinx-machine", "schellar", "worker"]
license = "Apache 2.0"
Expand Down

0 comments on commit e3ec320

Please sign in to comment.