Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow Reuse !? #20

Open
behrad opened this issue May 1, 2013 · 4 comments
Open

Flow Reuse !? #20

behrad opened this issue May 1, 2013 · 4 comments

Comments

@behrad
Copy link
Contributor

behrad commented May 1, 2013

How can I define & reuse a workflow, in etc/project?

@katspaugh
Copy link
Contributor

You can use file includes via the <> notation. Included files must be located in the etc directory of your project. You can include anywhere in the JSON.

    "workflows": [{
        "path": "read.json",
        "tasks": "<entity/read>"
    }]

@behrad
Copy link
Contributor Author

behrad commented May 6, 2013

with

"workflows": [{
    "path": "read.json",
    "tasks": "<flows/main>"
}]

I got

Error: { [Error: ENOENT, open '/data/workspace/opxi2flowy/etc/flows/main']

it seems it uses tasks param to resolve file name!!
Can you provide me please with a working example with also the read.json file contents !?

@katspaugh
Copy link
Contributor

@behrad
Copy link
Contributor Author

behrad commented May 8, 2013

@katspaugh That works as an include mechanism only! I got it now! but I wish I could mix included tasks with inline ones. This means to be able to write extended flows with reusable, mini tasks.
I mean something like this:

                          {
                                  "path":"test",
                                  "tasks": [{
                                      "include": "<entity/read>",
                                 },{
                                      "$function": "console.print",
                                      "$args": [ "Fetched Entity", "{$entity}" ]
                                 },{
                                      "include": "<entity/play>"
                                 }]
                          }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants