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

/node-workflow/lib/job-runner.js:426 job.onerror_results.push({ #120

Open
cjonagam opened this issue Sep 13, 2014 · 7 comments
Open

/node-workflow/lib/job-runner.js:426 job.onerror_results.push({ #120

cjonagam opened this issue Sep 13, 2014 · 7 comments

Comments

@cjonagam
Copy link

  • I have modified sw.js file like this

            var restify = require('restify');
    
            var workflow = module.exports = {
                name: 'Simple 1',
                chain: [ {
                    name: 'Post gist',
                    timeout: 6,
                    retry: 3,
                    body: function (job, cb) {
                       setTimeout(function(){
                            console.log("\r\n -----------------------  TASK 1    ---------------------------");
                            cb(null,"----------------------------------------------   testttttttttttt 1 --------------------------------");
                       },2000);
                    }
                }, {
                    name: 'Get starred gist',
                    timeout: 6,
                    retry: 3,
                    body: function (job, cb) {
                          setTimeout(function(){
                             console.log('\r\n -----------------------------  TASK 2 ------------------------------');
                             cb(null,'------------------------------------------------- testtttttttttttttt 2  -----------------------------------');
                          },3000);
                    },
                    fallback: function (err, job, cb) {
                          console.log("\r\n FAAAAAAL BAAAAAAAAAAAAAAAAAAAAAAAAAAAACK  ");
                          cb('------------------------------ fall back 2 -------------------------------');
                    }
                }],
                timeout: 5,
                onerror: [ {
                    name: 'Delete gist if exists',
                    body: function (job, cb) {
                        console.log(' --------------------------------- Errorrrrrrrrrrrrrrrrrrrrr 2 --------------------------- ');
                    }
                }]
            };
    
  • I have now executed api.js and runner.js like this
    node /home/dev/node-workflow/bin/workflow-runner /home/dev//node-workflow-example/config.json
    node /home/dev/node-workflow/bin/workflow-api /home/dev//node-workflow-example/config.json

  • I have edited the api.js provided in your sample project to include sw.js workflow and executed following command

                   C:\node api debianmaster test
    

Then i'm getting following error after the workflow execution is complete.

                /home/gse/dev/node-workflow/lib/job-runner.js:426
                          job.onerror_results.push({
                                    ^
          TypeError: Object [] has no method 'push'
                  at null.<anonymous> (/home/gse/dev/node-workflow/lib/job-runner.js:426:41)
                  at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
@kusor
Copy link
Contributor

kusor commented Sep 13, 2014

I'm not following you, sorry. When you add it to...? Mind to elaborate a little bit more and provide details about the failure?

@cjonagam
Copy link
Author

kusor, thanks for responding. i have updated the issue with more details

@gepser
Copy link

gepser commented Nov 26, 2014

Is this still an issue? @cjonagam update if you still have problems with this and I'll try to help you.

@cjonagam
Copy link
Author

This issue is still open. I could not find any solutions.

@gepser
Copy link

gepser commented Nov 26, 2014

Let me try to understand your problem, you want to run the workflow from the API or from the runner? I understand that you want the API mode but just checking.

@cjonagam
Copy link
Author

i would like to make it work on runner.
Error is with both api and runner

@gepser
Copy link

gepser commented Nov 26, 2014

Well, in order to make it work with the runner you need to type this in a terminal:
**./node_modules/.bin/workflow-runner config.json 2>&1 | ./node_modules/.bin/bunyan**

then you have to run your .js file, in the case of the example should be the module.js file.
**node module.js githubUser githubPass**

of course before everything you need to have your redis-server running (if you are doing it with redis).

try doing this with this files (module.js and shared-workflow.js) and give me the feedback in order to help you.
https://github.com/kusor/node-workflow-example/

if you want me to help you more easily give me your skype or gmail user and I'll do my best to help you.

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

3 participants