reformat & fix types
This commit is contained in:
parent
024cceda71
commit
b1e1a01785
|
@ -2041,6 +2041,7 @@ def update_task_data(
|
||||||
mimetype="application/json",
|
mimetype="application/json",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def send_bpmn_event(process_instance_id: str, body: Dict) -> Response:
|
def send_bpmn_event(process_instance_id: str, body: Dict) -> Response:
|
||||||
process_instance = ProcessInstanceModel.query.filter(
|
process_instance = ProcessInstanceModel.query.filter(
|
||||||
ProcessInstanceModel.id == int(process_instance_id)
|
ProcessInstanceModel.id == int(process_instance_id)
|
||||||
|
|
|
@ -705,15 +705,17 @@ class ProcessInstanceProcessor:
|
||||||
db.session.delete(at)
|
db.session.delete(at)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
def serialize_task_spec(self, task_spec: SpiffTask) -> dict[str, Any]:
|
def serialize_task_spec(self, task_spec: SpiffTask) -> Any:
|
||||||
return self._serializer.spec_converter.convert(task_spec)
|
return self._serializer.spec_converter.convert(task_spec)
|
||||||
|
|
||||||
def send_bpmn_event(self, event_data: dict[str,Any]) -> None:
|
def send_bpmn_event(self, event_data: dict[str, Any]) -> None:
|
||||||
payload = event_data.pop("payload", None)
|
payload = event_data.pop("payload", None)
|
||||||
event_definition = self._event_serializer.restore(event_data)
|
event_definition = self._event_serializer.restore(event_data)
|
||||||
if payload is not None:
|
if payload is not None:
|
||||||
event_definition.payload = payload
|
event_definition.payload = payload
|
||||||
current_app.logger.info(f"Event of type {event_definition.event_type} sent to process instance {self.process_instance_model.id}")
|
current_app.logger.info(
|
||||||
|
f"Event of type {event_definition.event_type} sent to process instance {self.process_instance_model.id}"
|
||||||
|
)
|
||||||
self.bpmn_process_instance.catch(event_definition)
|
self.bpmn_process_instance.catch(event_definition)
|
||||||
self.do_engine_steps(save=True)
|
self.do_engine_steps(save=True)
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ class ProcessInstanceService:
|
||||||
def spiff_task_to_api_task(
|
def spiff_task_to_api_task(
|
||||||
processor: ProcessInstanceProcessor,
|
processor: ProcessInstanceProcessor,
|
||||||
spiff_task: SpiffTask,
|
spiff_task: SpiffTask,
|
||||||
add_docs_and_forms: bool = False
|
add_docs_and_forms: bool = False,
|
||||||
) -> Task:
|
) -> Task:
|
||||||
"""Spiff_task_to_api_task."""
|
"""Spiff_task_to_api_task."""
|
||||||
task_type = spiff_task.task_spec.spec_type
|
task_type = spiff_task.task_spec.spec_type
|
||||||
|
|
Loading…
Reference in New Issue