Bug 983585 - AutoSave makes commit every 30 seconds even if the process does not change
Summary: AutoSave makes commit every 30 seconds even if the process does not change
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Designer
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ER5
: 6.0.0
Assignee: Tihomir Surdilovic
QA Contact: Sona Mala
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-11 14:04 UTC by Sona Mala
Modified: 2014-08-06 20:13 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:13:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Commits in GIT - screenshot (152.37 KB, image/png)
2013-07-11 14:04 UTC, Sona Mala
no flags Details
Commit in GIT after click on canvas (202.26 KB, image/png)
2013-09-18 12:14 UTC, Sona Mala
no flags Details

Description Sona Mala 2013-07-11 14:04:09 UTC
Created attachment 772254 [details]
Commits in GIT - screenshot

Description of problem:
New feature 'Auto Save' generates new commit every 30 seconds, even if process does not change.


Version-Release number of selected component (if applicable):
6.0.0 DR6

How reproducible:


Steps to Reproduce:
2. create a process (in jbpm-playground)
3. enable auto save
4. after some time checkout the git repository
   git clone EAP6/jboss-eap-6.1/bin/.niogit/jbpm-playground.git/
5. open gitk for this repository

Actual results:
Attached picture.

Expected results:
Auto save check if there is some new changes and than save the process.

Imagine that user interrupts his work for a long time (some meetings, calls etc.) but process is still open. There is so many amount of commits, which are useless.


Additional info:
Screenshot shows that file is changed, but if you take a better look, you can see that there is only one change - all IDs.

Maybe if IDs stay same, then the git does not generates commits so offen.

Comment 1 Tihomir Surdilovic 2013-08-27 14:26:15 UTC
This has been fixed to save only if there were changes to the process. Note that even clicking on the canvas can trigger a re-save as as possible change (any onmouse-out does).

Comment 2 Sona Mala 2013-09-18 12:13:10 UTC
Verified that if I am not working with designer, 'save' method is not invoked.


Tiho is really necessarily to change the ID of each XML element every time if an user click on canvas? 
   (see attached commit, which was generated as reaction of click on canvas)


I think that if you save process with the same sequence of characters (use same ID) then there is nothing to commit.

This fact leads to implication: if there is nothing to commit then the file does not contain any change.

So you can use git repository to determinate changes:
  - operation save:
       -> save actual BPMN2 code (do not change IDs)
       -> commit the changes
  - operation close the editor:
       -> save actual BPMN2 code (do not change IDs)
       -> if there is nothing to commit then just close the editor
       -> if there are some changes to commit then you ask the user for action "Save (Commit) changes" or "Discard changes"

Tiho:
 - is too hard to use old ID for XML element?
 - is this algorith applicable?

Comment 3 Sona Mala 2013-09-18 12:14:07 UTC
Created attachment 799345 [details]
Commit in GIT after click on canvas

Comment 4 Sona Mala 2013-09-19 11:46:40 UTC
Tiho and what about changing properties?

Step to reproduce:
------------------
  1. enable autosave
  2. create a process Start->UserTask->EndTask
  3. wait until alert "saved" is appear
  4. modify properties of UserTask:
      - name
      - task name
      - data assignment
      - on-entry script
      - actors
      - etc.
   5. Without clicking into canvas, close process
   6. Reopen process


Actual results
--------------
User task has empty properties.

Expected results
----------------
Properties are very important parts of BPMN2 process. They should be saved by autosave as well as flow elements.

Comment 8 Tihomir Surdilovic 2013-11-01 20:57:09 UTC
Auto-save only saves when there were no modifications made to the process. Note that even clicking on the canvas is considered a modification (user could have changed properties). As far as the node IDs is concerned, nodes IDs are generated on each save (have to be unique). This is necessary to maintain the unique id requirement.

Comment 9 Sona Mala 2013-11-04 10:08:30 UTC
Please consider this situation for saving properties:
  - an user works on process, the auto save is enabled
  - an user activates a node
  - the auto save saves a process
  - an user change a name of element
  - an user close a process

So an activation of node is done a few seconds before auto-save. Another autosave is not called because an user has closed the process. Between autosave and closing the process is done only one action -> Change a property.

I understand that an user can see that process was saved (alert is present) and he can activate a node again to be sure that a property will be saved.

I just show a risk of this solution (the limit situation).

Tiho, can you reproduce this issue?

Comment 10 Sona Mala 2013-11-04 10:17:56 UTC
Please consider these facts about IDs:
  - if no element is added then the IDs are still unique. 
       -> So why you generate these unique IDs again?
  - if some element is added then you need just one unique ID.
       -> Is it so hard to choose one unique ID?

Comment 11 Tihomir Surdilovic 2013-11-04 15:17:18 UTC
I have updated designer to set the "dirty" flag on any property changes. I think for the ID issue we could discuss that in another BZ? WDYT?

Comment 12 Sona Mala 2013-11-04 16:43:50 UTC
Thank you, I agree with comment #11.

Comment 13 Sona Mala 2013-12-12 13:13:54 UTC
I verified for ER5 that changes in nodes (click on canvas) and properties (change in any property) are saved by autosave and if there are no changes then operation save is not called.


Note You need to log in before you can comment on or make changes to this bug.