Set Property used in subsequent create item task have blank values - workflow

Followed Orchard Core Workflows Walkthrough: Content Approval blog
and created a 3 step workflow:
Starting event HTTP Post with raw JSON content
Set "NewsItem" property task using JSON.parse(readBody()) value
Create content item task with Content Properties, where I'm trying to use the NewsItem property defined before, e.g. "Author": "{{ NewsItem.Author }}" etc. I have the complete JSON structure (which works with hardcoded values).
Ran the workflow and the result is … that the newly created news item content has blank values all over. Any idea why?

http://www.ideliverable.com/blog/orchard-core-workflows-walkthrough-content-approval had it wrong. Need to use Workflow.Properties["MyProperty"].PropertyName instead of {{MyProperty.PropertyName}}

Related

Can you use nested Repeating Content Controls with the Populate a Microsoft Word template action?

Basically what I am trying to accomplish is to have a table which has a section for each Division and within that section have subsections for each Company within that Division. This is as close as I have gotten (with DivisionTable and CompanyTable both being repeating content controls):
After populating the template from a workflow the Divisions are working fine (its repeating three times w/ the correct info) but in the Company Table it just shows [obj] where it should be the Company Name. It also looks like there may be two new unnamed tags placed here after its generated but I'm not sure.
In the Populate a Word Template action inside the DivsionTable tag I am putting an array:
This is what the first object in the array looks like:
{
"CompanyTable": [
{
"CompanyName": "Company Name Goes Here"
}
],
"DivisionDesc": "Finishes",
"DivisionNo": "09"
}
Is what I am trying to do even possible? I looked at some other posts but I never saw a clear answer.
If it is possible then what exactly am I doing wrong? If it is not possible do you have any suggestions on how to accomplish this another way?

In Azure DevOps, is there a way to hide Iteration and Area fields in custom work item types?

In Azure Devops, using Customize option, you can add/modify fields except the Title, State, Reason, Area, Iteration Path. Is there a way I can modify a custom work item type to remove these fields as well?
No, these are system fields. There are headers elements that we'll have on each work item type:
Fields: Work item ID, Title, Assigned To, State, Reason, Area Path,
Iteration Path, and tags
Pages: History page, Links page
, and Attachments page.
Is there a way I can modify a custom work item type to remove these
fields as well?
System controls like Area Path, Iteration Path and Reason can be hidden from work item form using Rest API. In additon to hide them, lables to these controls can also be edited. You can not hide Title and State. Here are the steps:
Get the process ID
Get https://dev.azure.com/{Organization} /_apis/work/processes?api-version=6.0-preview.1
Update a System Control
PATCH https://dev.azure.com/{organization}/_apis/work/processes/{processId}/workItemTypes/{witRefName}/layout/systemcontrols/{controlId}?api-version=6.0-preview.1
Request Body:
{
"visible": false
}
Result:

Make twig plugins by dynamically horizontal reusing via "use" (not "include")

Need: A dynamic template loaded from a DB
I need to present a JSON object via "template plugins" that will come from a database (defined outside the application itself). The plugin will be applied only if a plugin exists.
For this example, let's assume I have this object of type "Reservation" that contains a sub-object of type "Flight":
{
"id": "ABC-XYZ",
"reservationDate": "2020-09-23",
"state": "paid",
"flight":
{
"origin": "BCN",
"destination": "MAD",
"airline": "VY"
}
}
Rules
The controller will call a page template passing multiple objects.
The page template will "use" or "include" (see later more info) an object.html.twig and will display it.
The object.html.twig will do this:
If there's not any known plugin able to handle this type of object, the template will display a <pre> with the object converted to YAML. This will be mainly act as a "default" plugin or "fallback" plugin.
If there's a known plugin able to handle the object, the object will be sent to the plugin (which is not anything else than another twig template).
In this case, the plugin should be able to separate "parts" of "interpretable" results to make them "nice" and leave the rest into an object that will be, in turn, displayed again with the original "default" plugin.
If there are parts of the object that are in turn interpretable, they will be in turn passed to other plugins.
Example "desired" outputs
Sample 1. No plugin available
Sample 2. Plugin 'reservation' available. Interprets the state in green. Also removes the redundant data of the ID
Sample 3. Same than 2 but also plugin 'flight' available, able to process the flight block. Formats the texts and makes a lookup of the airline full-name
Sample 4. Plugin 'flight' available, able to process the flight, that in turn knows that the origin and the destination are "airports" and passes them into the corresponding nested 'airport' plugin, because they are "reusable" objects not only in the "flight" plugin but also in many other places in the application, so they are defined appart
What I have already explored
I know that doing it via 'include' it could work. But let's take a look at the differences between 'use' and 'include':
The major difference between include and use in twig is that:
When you include a template, it's direct HTML 'inserted there' where you can use the {{ }} operator for printing and {% %} for control flow (set variables, ifs, fors, etc.). The renderer will process it straight forward. But defining a new block via {% block myNiceBlock %} is forbidden.
When you 'use' a template, it's pre-loaded, and blocks are permitted. There's no rendering of the included block. Then, from the caller, you use a {{ block( 'whatever' ) }} to tell the renderer to go and render that specific block.
The 'include' is more rudimentary. The use allows horizontal reusing and allows itself to auto-organize itself with other sub-blocks called by the parent block, all in one single file.
For example, in the airports example, if there are N images, in a include you should put the wrapper HTML directly in the file, do a loop and inside the loop write the inner HTML.
Instead in the use approach you'd do an airport block which in turn loops over the images and just calls the block airportImage which is defined in another block in the same file, thus facilitating clean-coding.
Requirement
The application should not be re-deployed when new plugins are created. They must be loaded from a DB or any other dynamic system, as the plugins will be written by "users of the application" as they need it. No deploy allowed.
The plugins should be written in terms of a "block-able" twig template, so need to be 'use'-able.
Question
Discovering "which" plugin to call is not a problem. Assume that whoever (the controller, the twig itself, whoever really) can discover for this example that a "reservation" plugin exists somewhere. How can I use it from the page? When the reservation is rendering it "asks if a flight plugin" is available. If not, all to the YAML. If it is, how can then dynamically tell the reservation to use the flight?
In short: How do I force a template to dynamically use (not include) templates that, in turn, comes from the database (not from fixed files)?
NOTE: If this info is useful: I'm using Symfony 5 with webpack.
Thanks!

Nesting liquid tag to select a list item

Hey I'm wondering if you could help me with some Liquid coding I am struggling with.
I am using Liquid with customer.io in order to code an email template.
customer.io uses data from user attributes e.g {{customer.sub_speciality_id}}
as well as data from a trigger sent as a JSON e.g {{trigger.test}}
I am using the following tag {{trigger.sub_specialities.3[0].title}}
Which looks in the JSON under for the values from the key "sub_specialities" it then chooses the section whose key is "3" which is a list, then picks the first item in that list and returns the title
That works fine.
But what I would like to do is to replace 3 with a liquid tag based off the customer attribute sub_speciality which is stored as {{customer.sub_speciality_id}}
so in a way {{trigger.sub_specialities.{{customer.sub_speciality_id}}[0].title}}
But I know you can't do liquid like that. How would I go about doing that?
You need to convert that key to string, like this {{trigger.sub_specialities["3"][0].title}}
I use a capture tag from Liquid to capture value.
{% capture sub_speciality_id %}{{customer.sub_speciality_id}}{% endcapture %}
When I capture that value in variable sub_speciality_id I can use that to retrieve data.
{{trigger.sub_specialities[sub_speciality_id][0].title}}

How to change the SSRS input parameters position in report

My SSRS report contains 7 input parameters and while running my report the size of the parameter(i.e. length) is increasing.
One of my input parameter(drop down list) may contain 100 characters so the size is not constant but i want to place all parameters in 2 lines or 3 lines(in a row).
Now it is coming 2 parameters per a row
Please advice
As gbn indicates, it's not easy to change the built in report server method of presenting the parameters. SSRS likes to always use two parameters per line, presented in the order that they exist in the report (which must match the dependency order.)
So the alternatives that gbn mentions: Both involve building a "Wrapper" application: some custom code or a web page that you can code however you like to get the parameters. Then you call Reporting Services, either in code or by passing a formatted URL with your parameters. The report can be displayed in a frame, new window, or passed as a stream to where ever you'd like.
The URL access is pretty straightforward and reliable: I often use it either by hand (to create "favorites") or in code.
http://msdn.microsoft.com/en-us/library/ms153586.aspx
For what you are looking for, these might be more work than you expected, but they will be extremely flexible for your interface.
Jamie
You can certainly do that, just right click on the RDL file in the solution explorer and select view code. then move the XML tags named <ReportParameter Name="Nameofparameter"> under <ReportParameters> according to where ever you want to position. And then save it. thats it!!!
The report parameters are kind of floating in values of 2, so if u have 4 report parameters then it will be shown as 1,2 next line 3,4. Best of luck!!
Use ASP.NET for the paramaters and a ReportViewer control or URL access to render. Seriously.
I don't know of any option to present parameters any way other then the default
I believe you could try using jQuery. The report parameters are rendered in a table under a div tag with class sqlrv-ParameterContainer. Write a jQuery or JavaScript function that will extract the full innerHTML from this div ie. the table content and then extract the table row information like the <label> or <input> tags.
Create your desired table structure with <table><tr><td>{extracted sections}</td><td></td></tr></table> or leave it to your requirement...
Then just append this new HTML structure in place of the original default structure.
In jQuery it will be like
$(".sqlrv-ParameterContainer").html();
which will give you the entire table structure that comes inside the parameter. Use XML parsing and get the input controls and all. Extract these controls as-is, don't change anything.
$(".sqlrv-ParameterContainer table").remove(); // it will remove the SSRS rendered default table from DOM
$(".sqlrv-ParameterContainer table").appendChild('<table><tr>......</tr></table>'); // Append your custom html structure here....
This was something that came to my mind quickly... I would suggest you test it... :)
This doesn't help the OP with SSRS-2008 but in case it helps others - Microsoft have improved this in SSRS 2016 - parameters can now be easily managed via the GUI in Report Builder / Visual studio:
https://www.intertech.com/ssrs-parameters-2016-update/