<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Workflow task button filter - custom EL expression in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/workflow-task-button-filter-custom-el-expression/m-p/320500#M7501</link>
    <description>&lt;P&gt;Thank you for the answer
I think I miss something fundamental in this case, nothing seems to be accessible,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.platform.actions.ActionService"
  point="filters"&amp;gt;
  &amp;lt;filter id="PanMuntligOverlaggning_enable"&amp;gt;
    &amp;lt;rule grant="true"&amp;gt;
      &amp;lt;condition&amp;gt;#{currentDocument!= null}&amp;lt;/condition&amp;gt;
    &amp;lt;/rule&amp;gt;
  &amp;lt;/filter&amp;gt;
&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Doesn't work, seems I have no access to most things I tried, only thing that gives a true on the null check is "currentUser"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.platform.actions.ActionService"
point="filters"&amp;gt;
&amp;lt;filter id="PanMuntligOverlaggning_enable"&amp;gt;
&amp;lt;rule grant="true"&amp;gt;
&amp;lt;condition&amp;gt;#{true}&amp;lt;/condition&amp;gt;
&amp;lt;/rule&amp;gt;
&amp;lt;/filter&amp;gt;
&amp;lt;/extension&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Works ofc, so the filter is active and "working" I just dont seem to have any variables to access in this context.
So I guess the first realization here is to figure out what my actual context is so I can figure out what objects I have access to
The button I want to hide is in a task sent from a workflow&lt;/P&gt;
&lt;P&gt;I'm using Nuxeo Platform 2019 (server 10.10) , with Nuxeo JSF UI 10.10.0 installed&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jun 2020 13:58:47 GMT</pubDate>
    <dc:creator>Marcus_Doublet</dc:creator>
    <dc:date>2020-06-26T13:58:47Z</dc:date>
    <item>
      <title>Workflow task button filter - custom EL expression</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/workflow-task-button-filter-custom-el-expression/m-p/320498#M7499</link>
      <description>&lt;P&gt;I want to activate a task button depending on a property in the input document:
In the filter-input in the workflow node properties Task Button tab I've put the following ID:
PanMuntligOverlaggning_enable&lt;/P&gt;
&lt;P&gt;Then in Advanced Settings-&amp;gt;Xml Extensions I have an extions doing this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.platform.actions.ActionService"
  point="filters"&amp;gt;
  &amp;lt;filter id="PanMuntligOverlaggning_enable"&amp;gt;
    &amp;lt;rule grant="true"&amp;gt;
      &amp;lt;condition&amp;gt;#{currentDocument.getPropertyValue('pananmodan:yrkande') == '1'}&amp;lt;/condition&amp;gt;
    &amp;lt;/rule&amp;gt;
&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The input document has the property
"pananmodan:yrkande": "1" defined as String&lt;/P&gt;
&lt;P&gt;EDIT:
I've realized that the "currentDocument" might be the workflow document and not the input document, still no success.
Is it possible to access workflow variables in the filter?&lt;/P&gt;
&lt;P&gt;The button is not visible, any suggestions? I want the button to be visible only in the case of that said attribute beeing the string value 1
Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 06:51:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/workflow-task-button-filter-custom-el-expression/m-p/320498#M7499</guid>
      <dc:creator>Marcus_Doublet</dc:creator>
      <dc:date>2020-06-24T06:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow task button filter - custom EL expression</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/workflow-task-button-filter-custom-el-expression/m-p/320499#M7500</link>
      <description>&lt;P&gt;So yes, the filter should be pointing to the workflow instance itself, so you should use its variable. In your case, you would have to copy the value of &lt;CODE&gt;pananmodan:yrkande&lt;/CODE&gt; into a workflow variable &lt;CODE&gt;myWorkflowVariable&lt;/CODE&gt; and have the filter like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-xml"&gt;&amp;lt;condition&amp;gt;#{currentDocument.myWorkflowVariable == '1'}&amp;lt;/condition&amp;gt;
```
Let's try it

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Jun 2020 22:41:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/workflow-task-button-filter-custom-el-expression/m-p/320499#M7500</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2020-06-25T22:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow task button filter - custom EL expression</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/workflow-task-button-filter-custom-el-expression/m-p/320500#M7501</link>
      <description>&lt;P&gt;Thank you for the answer
I think I miss something fundamental in this case, nothing seems to be accessible,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.platform.actions.ActionService"
  point="filters"&amp;gt;
  &amp;lt;filter id="PanMuntligOverlaggning_enable"&amp;gt;
    &amp;lt;rule grant="true"&amp;gt;
      &amp;lt;condition&amp;gt;#{currentDocument!= null}&amp;lt;/condition&amp;gt;
    &amp;lt;/rule&amp;gt;
  &amp;lt;/filter&amp;gt;
&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Doesn't work, seems I have no access to most things I tried, only thing that gives a true on the null check is "currentUser"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.platform.actions.ActionService"
point="filters"&amp;gt;
&amp;lt;filter id="PanMuntligOverlaggning_enable"&amp;gt;
&amp;lt;rule grant="true"&amp;gt;
&amp;lt;condition&amp;gt;#{true}&amp;lt;/condition&amp;gt;
&amp;lt;/rule&amp;gt;
&amp;lt;/filter&amp;gt;
&amp;lt;/extension&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Works ofc, so the filter is active and "working" I just dont seem to have any variables to access in this context.
So I guess the first realization here is to figure out what my actual context is so I can figure out what objects I have access to
The button I want to hide is in a task sent from a workflow&lt;/P&gt;
&lt;P&gt;I'm using Nuxeo Platform 2019 (server 10.10) , with Nuxeo JSF UI 10.10.0 installed&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 13:58:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/workflow-task-button-filter-custom-el-expression/m-p/320500#M7501</guid>
      <dc:creator>Marcus_Doublet</dc:creator>
      <dc:date>2020-06-26T13:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow task button filter - custom EL expression</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/workflow-task-button-filter-custom-el-expression/m-p/320501#M7502</link>
      <description>&lt;P&gt;Clarification, i'm using WebUI not JSFUI.
I suspect that the solution I try to do doesnt work in WebUI. Although the help text in the workflow editwindow implies that a filterId should be specified, and the only way I found to use filters is with above mentioned ActionService xml extension.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 10:35:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/workflow-task-button-filter-custom-el-expression/m-p/320501#M7502</guid>
      <dc:creator>Marcus_Doublet</dc:creator>
      <dc:date>2020-08-17T10:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow task button filter - custom EL expression</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/workflow-task-button-filter-custom-el-expression/m-p/320502#M7503</link>
      <description>&lt;P&gt;I tried it and did not seem to have access to any or few data. I've tried things like "currentDocument != null" that seems to give false. I've updated with additional info in the answers. Clarification is that its WebUI that I use&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 12:16:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/workflow-task-button-filter-custom-el-expression/m-p/320502#M7503</guid>
      <dc:creator>Marcus_Doublet</dc:creator>
      <dc:date>2020-08-17T12:16:44Z</dc:date>
    </item>
  </channel>
</rss>

