Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Add template function to link to other tasks #41

Open
JeanMertz opened this issue Jul 25, 2019 · 1 comment
Open

Add template function to link to other tasks #41

JeanMertz opened this issue Jul 25, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@JeanMertz
Copy link
Contributor

JeanMertz commented Jul 25, 2019

It'd be nice if you could use a template function add links to other tasks in your task output.

For example, say a task shows a list of customer capabilities, it could then show it as this:


Capabilities:


With the revoke links linking to another task that allows you to remove capabilities from a customer.

The link would have to support the following:

  • Link to an existing task.
  • Optionally pre-fill variable values.

I don't know what the best way to do this is, but perhaps links could look something like [revoke][automaat:task id:12 variable:Var Name=value here variable:Variable 2=value]

  • [revoke] will be the link text.
  • automaat:task is a special prefix to let the parser know it should link to an existing Automaat task (we could add more automaat:... links later, if required, for example linking to search results).
  • id:12 is the ID of the task to link to. We could instead use task names here, but then renaming a task would break this.
  • variable:name=value is an optional (repeatable) pre-filled variable value.

(see next comment)

@JeanMertz
Copy link
Contributor Author

JeanMertz commented Jul 25, 2019

Actually, I think we can write a custom Tera function for this, and have it fit with all the other templating support we have.

So you'd do something like [revoke]({{ task_url(id=12, variables=["Var Name=value", "Variable 2=value"]) }}), although I'm not yet sure if/how functions can support a vector as an input value, but we can experiment with that.

@JeanMertz JeanMertz changed the title Allow processor output to link to other tasks Add template function to link to other tasks Jul 25, 2019
@JeanMertz JeanMertz added the enhancement New feature or request label Aug 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant