Code Monkey home page Code Monkey logo

Comments (14)

Siqsuruq avatar Siqsuruq commented on May 28, 2024 1

In your wexflow.xml configuration file there is a section where you can configure your temporary folder. When you run WF and some task creates an output, so output goes to this folder in the format wfId/date/time/task_timestamp. This way, next task in your wf knows where to read files,so the contents of the output files will automatically read and be available for your next task.

from wexflow.

TechyGuy99 avatar TechyGuy99 commented on May 28, 2024

same thing i am wondering about. I have ENVIRONMENT Task, have to pass its setting to HttpGet task. How does that work?

from wexflow.

Siqsuruq avatar Siqsuruq commented on May 28, 2024

If you are using custom tasks you can programmatically pass data with Shared Memory or read files, here is link to docs how to read files in the next task: https://github.com/aelassas/wexflow/wiki/Custom-Tasks#files. Look at the comment that result is written to file: https://github.com/aelassas/wexflow/wiki/HttpGet.

from wexflow.

TechyGuy99 avatar TechyGuy99 commented on May 28, 2024

If you are using custom tasks you can programmatically pass data with Shared Memory or read files, here is link to docs how to read files in the next task: https://github.com/aelassas/wexflow/wiki/Custom-Tasks#files. Look at the comment that result is written to file: https://github.com/aelassas/wexflow/wiki/HttpGet.

Thanks for info. what i am not clear about is for any arbitrary activity, how do i know where to look for previous activity outputs and possibly inputs. Is there a contract where every activity has to store this in a well known place?

from wexflow.

shaibarlev avatar shaibarlev commented on May 28, 2024

On the same issue, the task only returns 4 statuses: Success, Warning, Error, Rejected. Tto get the http return codes like (200,202,304,400,404,500 and more) and the message return from any http verbs (Post, Get, Put, Delete) you'll need to read it from the files ?

P.S. on the page https://github.com/aelassas/wexflow/wiki/Tasks - the link to the HttpPost documentation doesn't show the sample/documentation for the task. it pointing to the main Wiki page.

from wexflow.

TechyGuy99 avatar TechyGuy99 commented on May 28, 2024

Ok, so i want to make a wf that based on a rest variable value, triggers a specific activity. is there a way to do that and example?
Seems like i would need an actitivity that generates a switchvalue based on a rest input

from wexflow.

Siqsuruq avatar Siqsuruq commented on May 28, 2024

I think most of the Wexflow project's standard tasks are more like an example, so you can write your own custom tasks. I've written an example of a simple custom task to get the response from the HTTP code and write it to a file. Here is a link GitHub The status of the task has nothing to do with the status of the HTTP response code, but you can create a custom task that will fail if the HTTP response, for example, is 400 or something like that.

from wexflow.

Siqsuruq avatar Siqsuruq commented on May 28, 2024

For the another question I'm not quite understand what is "rest input". If you want to make a request and execute some specific task based on response, you can do it in one custom task, or create one which returns boolean or switch condition, if you want to use if/while switch.
To do so just add boolean or switch condition to TaskStatus: return new TaskStatus(Status.Success , false);

from wexflow.

TechyGuy99 avatar TechyGuy99 commented on May 28, 2024

For the another question I'm not quite understand what is "rest input". If you want to make a request and execute some specific task based on response, you can do it in one custom task, or create one which returns boolean or switch condition, if you want to use if/while switch. To do so just add boolean or switch condition to TaskStatus: return new TaskStatus(Status.Success , false);

I wanted the input to the rest call to determine the switch output, so i could redirect the flow accordingly.

from wexflow.

Siqsuruq avatar Siqsuruq commented on May 28, 2024

For the another question I'm not quite understand what is "rest input". If you want to make a request and execute some specific task based on response, you can do it in one custom task, or create one which returns boolean or switch condition, if you want to use if/while switch. To do so just add boolean or switch condition to TaskStatus: return new TaskStatus(Status.Success , false);

I wanted the input to the rest call to determine the switch output, so i could redirect the flow accordingly.

Input or output, still fuzzy for me. You want a custom task that accepts some parameters like make POST request to this URL and make a switch output. Smth like that?

from wexflow.

TechyGuy99 avatar TechyGuy99 commented on May 28, 2024

For the another question I'm not quite understand what is "rest input". If you want to make a request and execute some specific task based on response, you can do it in one custom task, or create one which returns boolean or switch condition, if you want to use if/while switch. To do so just add boolean or switch condition to TaskStatus: return new TaskStatus(Status.Success , false);

I wanted the input to the rest call to determine the switch output, so i could redirect the flow accordingly.

Input or output, still fuzzy for me. You want a custom task that accepts some parameters like make POST request to this URL and make a switch output. Smth like that?
I am trying to set the CommentType on a comment. From that state, i want a rule that says for state A, set CommentState To some value, for TYpe B, CommentState = another value.

from wexflow.

TechyGuy99 avatar TechyGuy99 commented on May 28, 2024

I ended up writting a function that checks for rest, then local, then settings when a task runs.
Clean as i can set variables at workflow level or get some from the rest call.

from wexflow.

shaibarlev avatar shaibarlev commented on May 28, 2024

Can you share ?

from wexflow.

TechyGuy99 avatar TechyGuy99 commented on May 28, 2024

@shaibarlev
public static string GetWorkflowVariableValue(this Wexflow.Core.Task task, string variableName, string defaultValue = null)
{

  if (task == null)
      throw new ArgumentException("Null task");
  var workflow = task.Workflow;
  if (workflow == null) throw new ArgumentNullException("Null Workflow");

  var val = workflow.RestVariables.SingleOrDefault(r => r.Key == variableName)?.Value
      ?? workflow.LocalVariables.SingleOrDefault(v => v.Key == variableName)?.Value ??
      task.GetSetting(variableName, null) ?? workflow.GlobalVariables.SingleOrDefault(g => g.Key == variableName)?.Value
      ?? Environment.GetEnvironmentVariable(variableName);



  if (val == null && string.IsNullOrEmpty(val))
  {
      return defaultValue;
  }
  return val;

}

from wexflow.

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.