GithubHelp home page GithubHelp logo

Comments (6)

knipknap avatar knipknap commented on July 21, 2024

I just committed a fix in ee84959

from spiffworkflow.

tinck avatar tinck commented on July 21, 2024

Thanks, but after ee84959 another error occured, when running deserialize.py
@knipknap

Traceback (most recent call last):
File "deserialize.py", line 7, in
spec = WorkflowSpec.deserialize(serializer, workflow_json)
File "/home/x/code/python/venv/workflow/lib/python3.5/site-packages/SpiffWorkflow/specs/WorkflowSpec.py", line 136, in deserialize
return serializer.deserialize_workflow_spec(s_state, **kwargs)
File "/home/x/code/python/venv/workflow/lib/python3.5/site-packages/SpiffWorkflow/serializer/json.py", line 66, in deserialize_workflow_spec
return super(JSONSerializer, self).deserialize_workflow_spec(thedict, **kwargs)
File "/home/x/code/python/venv/workflow/lib/python3.5/site-packages/SpiffWorkflow/serializer/dict.py", line 424, in deserialize_workflow_spec
spec = WorkflowSpec(s_state['name'], filename=s_state['file'])
TypeError: string indices must be integers

from spiffworkflow.

knipknap avatar knipknap commented on July 21, 2024

This sounds like your workflow spec may be wrong. Does your JSON contain the "name" and "file" fields?

from spiffworkflow.

tinck avatar tinck commented on July 21, 2024

After running the code
open('workflow-spec.json', 'w').write(pretty)
in serialilze.py, the program outputs JSON string into workflow-spec.json, which I used in deserialize.py.
And the JSON string is

"{"description": "", "file": null, "name": "", "task_specs": {"Start": {"class": "SpiffWorkflow.specs.StartTask.StartTask", "data": {}, "defines": {}, "description": "", "id": 1, "inputs": [], "internal": false, "locks": [], "lookahead": 2, "manual": false, "name": "Start", "outputs": ["general"], "post_assign": [], "pre_assign": []}, "general": {"choice": null, "class": "SpiffWorkflow.specs.ExclusiveChoice.ExclusiveChoice", "cond_task_specs": [[["SpiffWorkflow.operators.Equal", [["Attrib", "confirmation"], ["value", "yes"]]], "president"]], "data": {}, "default_task_spec": "workflow_aborted", "defines": {}, "description": "", "id": 2, "inputs": ["Start"], "internal": false, "locks": [], "lookahead": 2, "manual": false, "name": "general", "outputs": ["workflow_aborted", "president"], "post_assign": [], "pre_assign": []}, "nuclear_strike": {"class": "SpiffWorkflow.specs.Simple.Simple", "data": {}, "defines": {}, "description": "", "id": 5, "inputs": ["president"], "internal": false, "locks": [], "lookahead": 2, "manual": false, "name": "nuclear_strike", "outputs": [], "post_assign": [], "pre_assign": []}, "president": {"choice": null, "class": "SpiffWorkflow.specs.ExclusiveChoice.ExclusiveChoice", "cond_task_specs": [[["SpiffWorkflow.operators.Equal", [["Attrib", "confirmation"], ["value", "yes"]]], "nuclear_strike"]], "data": {}, "default_task_spec": "workflow_aborted", "defines": {}, "description": "", "id": 4, "inputs": ["general"], "internal": false, "locks": [], "lookahead": 2, "manual": false, "name": "president", "outputs": ["workflow_aborted", "nuclear_strike"], "post_assign": [], "pre_assign": []}, "workflow_aborted": {"cancel_successfully": false, "class": "SpiffWorkflow.specs.Cancel.Cancel", "data": {}, "defines": {}, "description": "", "id": 3, "inputs": ["general", "president"], "internal": false, "locks": [], "lookahead": 2, "manual": false, "name": "workflow_aborted", "outputs": [], "post_assign": [], "pre_assign": []}}}"

from spiffworkflow.

knipknap avatar knipknap commented on July 21, 2024

Ah, the error was in serialize.py. Fix is committed.

from spiffworkflow.

tinck avatar tinck commented on July 21, 2024

Problem solved, Thanks.

from spiffworkflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.