spiff-arena/SpiffWorkflow/doc/non-bpmn/tutorial/deserialize.py

8 lines
261 B
Python

from SpiffWorkflow.specs import WorkflowSpec
from SpiffWorkflow.serializer.json import JSONSerializer
serializer = JSONSerializer()
with open('workflow-spec.json') as fp:
workflow_json = fp.read()
spec = WorkflowSpec.deserialize(serializer, workflow_json)