Stream: shorthand
Topic: Liquid syntax / variables in fsh
Jose Costa Teixeira (Sep 11 2020 at 17:23):
Can we add to discussion backlog: using liquid syntax or other mechanism to include external variables in a fsh file?
David Pyke (Sep 11 2020 at 17:23):
What would be the use case?
Jose Costa Teixeira (Sep 11 2020 at 17:25):
As a fsh editor, I want to create dozens of example resources that are very similar to each other by providing one template in fsh and having sushi populate the variable values.
Jose Costa Teixeira (Sep 11 2020 at 17:25):
Similar to word mail merge
David Pyke (Sep 11 2020 at 17:26):
Then you start needing if and other structures and things get difficult
David Pyke (Sep 11 2020 at 17:27):
mFSH can do what you want, mostly
Jose Costa Teixeira (Sep 11 2020 at 17:27):
Variables would be like {{random*10}} or {{sequence(1,10)}} or some fancy lookup
Jose Costa Teixeira (Sep 11 2020 at 17:27):
Why do I need an if?
Jose Costa Teixeira (Sep 11 2020 at 17:27):
And what is mFSH?
David Pyke (Sep 11 2020 at 17:28):
macro FSH. Let you do simple substitutions
David Pyke (Sep 11 2020 at 17:28):
Most of the time I"m doing batch examples, they're conditional to some extent
Jose Costa Teixeira (Sep 11 2020 at 17:29):
Typical scenario: create a CSV with 200 lines of the variables that change (takes a few minutes); create the fsh template; sushi it
David Pyke (Sep 11 2020 at 17:31):
I create the fsh in excel, that lets me use various lookups and transforms
Jose Costa Teixeira (Sep 11 2020 at 17:31):
Whenever I have to create more than a few example instances, I need a XLS to see and edit the different values, and I create a fsh from that.
Jose Costa Teixeira (Sep 11 2020 at 17:33):
Yes, and I wonder how it would be simpler to do that with variables instead of creating fsh content in excel
David Pyke (Sep 11 2020 at 17:45):
Just need to poke the sushi team to get macros brought back onto the front burner
Chris Moesel (Sep 11 2020 at 18:05):
See the Wicked FSH presentation we've been giving at the Connectathon. There are some slides on "Parameterized RuleSets" which introduce the idea of macros -- although they don't yet consider the possibility of feeding macros data from external sources.
Jose Costa Teixeira (Sep 11 2020 at 19:58):
So will macros support the use case above?
Jose Costa Teixeira (Sep 11 2020 at 20:03):
From what I read, it seems orthogonal - macros and templates with variables for serialized instance creation
Jose Costa Teixeira (Sep 11 2020 at 20:05):
I don't think we should put those together
Chris Moesel (Sep 11 2020 at 21:25):
From what I read, it seems orthogonal - macros and templates with variables for serialized instance creation
I don't think we should put those together
I think I agree with you.
David Pyke (Sep 11 2020 at 21:27):
I think it works well, I create a ruleset with variables that acts as a template, I use a macro to populate it
Grahame Grieve (Sep 14 2020 at 00:07):
the core build includes all the functionality to do this, but I never got around to making it a part of the IG publisher. I should do that
Last updated: Apr 12 2022 at 19:14 UTC