<?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 Auto-Save Form in User Task in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/auto-save-form-in-user-task/m-p/214608#M167738</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone successfully implemented a way to auto-save the data entered by an end user in the Form while they execute their assigned User Task?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm building an app in Activiti Enterprise 1.5.2. Out-of-the-box, it will only save the form data when an end user deliberately clicks the save button at the top or bottom of the form. If they navigate away from their Task without clicking save, they will lose all the data they entered.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The closest I've come is using&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;scope.saveForm();&lt;/SPAN&gt;&amp;nbsp;in Javascript, but every time it's called, it refreshes the form, which takes the focus away from where the end user was on the form.&amp;nbsp;If the end user was at the bottom of the form, the refresh brings them all the way back up to the top. That's bad UX, so this won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to Activiti, so I'm not familiar with all of its guts, but maybe it's possible to customize the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;saveForm()&lt;/SPAN&gt; function to skip the form refresh?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts from the community would be greatly appreciated. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Dec 2016 15:57:22 GMT</pubDate>
    <dc:creator>joeblue</dc:creator>
    <dc:date>2016-12-20T15:57:22Z</dc:date>
    <item>
      <title>Auto-Save Form in User Task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/auto-save-form-in-user-task/m-p/214608#M167738</link>
      <description>Has anyone successfully implemented a way to auto-save the data entered by an end user in the Form while they execute their assigned User Task?I'm building an app in Activiti Enterprise 1.5.2. Out-of-the-box, it will only save the form data when an end user deliberately clicks the save button at the</description>
      <pubDate>Tue, 20 Dec 2016 15:57:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/auto-save-form-in-user-task/m-p/214608#M167738</guid>
      <dc:creator>joeblue</dc:creator>
      <dc:date>2016-12-20T15:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Auto-Save Form in User Task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/auto-save-form-in-user-task/m-p/214609#M167739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Hello Joe,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Use the following javascript&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: 16px;"&gt;&amp;nbsp;in one one or many of the Activiti&amp;nbsp;JS&amp;nbsp;hook points such as&amp;nbsp;formFieldValueChanged(),&amp;nbsp;formFieldFocus(),&amp;nbsp;formFieldBlur() etc. Refer&amp;nbsp;&lt;A class="link-titled" href="https://docs.alfresco.com/activiti/docs/dev-guide/1.5.0/#_start_and_task_form_customization" title="https://docs.alfresco.com/activiti/docs/dev-guide/1.5.0/#_start_and_task_form_customization" rel="nofollow noopener noreferrer"&gt;Alfresco Activiti&lt;/A&gt;&amp;nbsp; for more details on these extension points. &amp;nbsp;To enable auto-save&amp;nbsp;across the activiti instance, add this logic to&amp;nbsp;&lt;SPAN&gt;activiti-app/workflow/extensions/render-form-extensions.js. If you need this feature in just a few forms, add it to the "Javascript" tab in the Form Designer.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;//Doing this check to exclude Start Forms.&lt;BR /&gt;&lt;BR /&gt;if(scope.formData.taskId){&lt;BR /&gt; //Create POST Data&lt;BR /&gt; var postData = scope.createPostData();&lt;BR /&gt; //Extract Task ID&lt;BR /&gt; var taskId = scope.formData.taskId&lt;BR /&gt;&lt;BR /&gt;//Get FormService&lt;BR /&gt; var formService = angular.element(document.body).injector().get('FormService')&lt;BR /&gt;&lt;BR /&gt;//Call the Save API&lt;BR /&gt; formService.saveTaskForm(taskId, postData)&lt;BR /&gt; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 16:59:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/auto-save-form-in-user-task/m-p/214609#M167739</guid>
      <dc:creator>cjose</dc:creator>
      <dc:date>2016-12-21T16:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Auto-Save Form in User Task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/auto-save-form-in-user-task/m-p/214610#M167740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Boom! That did it. Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE to anyone who decides to add this code to their Activiti&amp;nbsp;instance:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thru working with Ciju, I found&amp;nbsp;out that every time the app saves the data in a form, the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;SAVED_FORM&lt;/SPAN&gt; table in the database gets a new row. So, if you execute a save every time &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;formFieldValueChanged()&lt;/SPAN&gt; is triggered, a new row is added to the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;SAVED_FORM&lt;/SPAN&gt; table. That's especially bad for text fields&amp;nbsp;because it would add a new row for every letter typed into the text box. That would get out of hand very fast in our app. Personally, I think&amp;nbsp;&lt;SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;formFieldFocus()&lt;/SPAN&gt; or &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;formFieldBlur()&lt;/SPAN&gt; are better places to use it. Also, consider adding a maintenance job in your database to delete unneeded saves.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2016 21:43:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/auto-save-form-in-user-task/m-p/214610#M167740</guid>
      <dc:creator>joeblue</dc:creator>
      <dc:date>2016-12-22T21:43:40Z</dc:date>
    </item>
  </channel>
</rss>

