Bug 853496 - BPMN Editor Does not Show Service Task for any further new Work Item Definition(s) if definition as corrupted
BPMN Editor Does not Show Service Task for any further new Work Item Definiti...
Status: VERIFIED
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRM (Guvnor) (Show other bugs)
BRMS 5.3.0.GA
Unspecified Unspecified
unspecified Severity high
: ER4
: BRMS 5.3.1 GA
Assigned To: Tihomir Surdilovic
Jiri Locker
: Reopened
: 853022 (view as bug list)
Depends On: 853022
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-31 14:12 EDT by Alessandro Lazarotti
Modified: 2014-10-26 21:11 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
If the configuration of one service task fails within the BPMN2 Editor, all other tasks appear to fail as well. This causes service task interactions to become unusable within the designer. This has been fixed by evaluating each service node configuration independently while not affecting the evaluation of other service nodes. Users can still see service node definitions of all service nodes with a valid configuration.
Story Points: ---
Clone Of: 853022
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
kverlaen: needinfo+


Attachments (Terms of Use)
screenshot1 (96.78 KB, image/png)
2012-09-11 11:18 EDT, Tihomir Surdilovic
no flags Details
screenshot2 (68.48 KB, image/png)
2012-09-11 11:19 EDT, Tihomir Surdilovic
no flags Details
screenshot3 (89.67 KB, image/png)
2012-09-11 11:20 EDT, Tihomir Surdilovic
no flags Details
Screenshot - Clear problem of designer (50.43 KB, image/png)
2012-10-08 03:45 EDT, Sona Mala
no flags Details
Server.log (10.22 KB, application/octet-stream)
2012-10-08 04:02 EDT, Sona Mala
no flags Details
Empty repository (8.35 KB, text/xml)
2012-10-08 07:16 EDT, Sona Mala
no flags Details
Verification of test scenario in comment #16 PART1 (19.47 MB, application/zip)
2012-10-12 06:51 EDT, Sona Mala
no flags Details
Verification of test scenario in comment #16 PART2 (8.42 MB, application/zip)
2012-10-12 07:33 EDT, Sona Mala
no flags Details

  None (edit)
Description Alessandro Lazarotti 2012-08-31 14:12:48 EDT
How reproducible:

Should be able to reproduce

Steps to Reproduce:
1. I created a default work item definition in Guvnor.
   It showed up correctly in the BPMN web editor under the service task pallet.
2. I then modified the work item with a missing " in a parameter name, saved
3. I then changed the name and display name of the broken work item definition.
4. I then created a new default work item definition and saved.
5. From this point no new work item definitions appear in the web editor service task pallet.
  

Additional info:
When designer is opened the log file reports issues related to workitem, for example: 
"Failed to setup workitems : [Error: unterminated string literal]
[Near : {... ayName" : "MyTask2", ....}]"

When designer is opened the log file reports issues related to workitem, for example: 
"Failed to setup workitems : [Error: unterminated string literal]
[Near : {... ayName" : "MyTask2", ....}]"

However nothing is reported to end user, the designer does not show this message and the worktitem just does not appear.
Ideally BRMS should provide a validation when a worktitem is savd and report some issue in that moment. Today if a bad definition of workitem is created, BRMS is able to save it and build a package successfully, only desginer will log something about this, but silent in the log file.
Comment 1 Alessandro Lazarotti 2012-08-31 14:18:38 EDT
*** Bug 853022 has been marked as a duplicate of this bug. ***
Comment 2 Tihomir Surdilovic 2012-09-11 09:13:28 EDT
This is not a Designer issue. The change I would suggest is in Guvnor to enable Validation on the Workitem Definition configuration editor.
Comment 3 Tihomir Surdilovic 2012-09-11 11:18:22 EDT
Fixed in Guvnor and committed to 5.3.x Guvnor branch (prod branch). Workitem definitions editor now has a Validate option which validates the correctness of it. The validation checks for syntax errors in the configuration MVEL. 

(attaching screenshots of validation)
Comment 4 Tihomir Surdilovic 2012-09-11 11:18:57 EDT
Created attachment 611819 [details]
screenshot1
Comment 5 Tihomir Surdilovic 2012-09-11 11:19:41 EDT
Created attachment 611820 [details]
screenshot2
Comment 6 Tihomir Surdilovic 2012-09-11 11:20:05 EDT
Created attachment 611821 [details]
screenshot3
Comment 7 Sona Mala 2012-10-05 10:40:52 EDT
It is great, that validator of Work Item Definition exist. User can find problems easier.

But user can save invalid definition as well as valid one. The problem, which was described, still exists:
  Designer shows in Shape Repo last valid configuration of service tasks. In case that is added invalid task, I am not able to validate process which use the correct service (even if this service is in different asset). The validator in designer shows alert "Invalid answer from server".

Step to reproduce:
1. clear a repository
2. create new BPMN process (Service taskss in Shape Repo: Email, Log)
3. close process
4. create new work item definition asset (default one) and save it
5. open BPMN process (Service tasks in Shape Repo: Email, Log, MyTask)
6. create simple process (Start->MyTask->End)
7. create PNG and validate the process (Alert: "There are no validation errors")
8. close BPMN asset
9. open work item definition and create new invalid work item "MyTask2" and save it
10. open BPMN process (Service tasks in ShapeRepo: Email, Log, MyTask)

Actual result:
Process is changed (Start->Task->End). Service tasks in Shape repository: Email, Log, MyTask. Validation alert: "There are no validation errors."

Expected result:
a]Process is not changed (still Start->MyTask->End)!!! Service tasks in Shape repository: Email, Log, MyTask. Validation alert: "There are no validation errors."

Workaroud of Actual result:
11. change Default Task back (to MyTask)
12. Validate

Actual result:
Validation alert: "Invalid answer from server."

Expected result:
a] Validation alert: "There are no validation errors." and corrupted service definition is ignored
b] Show error cross near a start event (Work Item definition is not valid).

Please delete Service Tasks section before you start up a designer!!!
Main problem is this usecase: User have created very large process and after some time he decided add new service (but forgot validate it). He loose all services in process!!! And he must define task in process again or roll back.
Comment 8 Tihomir Surdilovic 2012-10-05 10:54:47 EDT
Couple of comments about this, if I miss anything please let me know:

1) >>But user can save invalid definition as well as valid one<< yes just like users can save rules and processes that are "invalid" or cannot be executed. This is part of testing/modeling ongoing efforts.

2) In the steps to reproduce: 
>> 9. open work item definition and create new invalid work item "MyTask2" and save  << If you edit the existing definition, at that point you are invalidating all other definitions itself, not just MyTask2. If you create another workitem definition separate than the one where you have MyTask, only that workitem definition should be invalid. 

The change from MyTask to Task is actually a good thing IMO. Designer still knows that your task has the task type of "MyTask" however since it is unable to determine its definition it default to the abstract (default) task type. When you fix your workitem definition and re-open the business process, it will be back to MyTask...so designer has not actually changed the process for you, it just does not know how to draw it correctly (the BPMN2 is un-changed from your previous one). 

Regarding >> Please delete Service Tasks section before you start up a designer!!!
Main problem is this usecase: User have created very large process and after some time he decided add new service (but forgot validate it). He loose all services in process!!! And he must define task in process again or roll back. <<
I don't think this is the case. The process BPMN2 did not change! Only the display. When you user goes back and fixes / corrects their workitem definition, re-opening the process will bring it back to the expected display. The BPMN2 however stays as it was before (Designer does not do any magic of changing the bpmn2 :) )

Let me know if this is OK.
Comment 9 Sona Mala 2012-10-08 03:45:06 EDT
> 2) In the steps to reproduce: 
> >> 9. open work item definition and create new invalid work item "MyTask2" and save  << 
>If you edit the existing definition, at that point you are invalidating all other definitions itself, not just MyTask2.
>If you create another workitem definition separate than the one where you have MyTask, only that workitem definition should be invalid. 
I try this, but I get same result.

> The change from MyTask to Task is actually a good thing IMO. Designer still
> knows that your task has the task type of "MyTask" however since it is
> unable to determine its definition it default to the abstract (default) task
> type. When you fix your workitem definition and re-open the business
> process, it will be back to MyTask...so designer has not actually changed
> the process for you, it just does not know how to draw it correctly (the
> BPMN2 is un-changed from your previous one). 
I agree with you. But user cannot find that MyTask is invalid, because it is in ShapeRepository and the alert "Invalid answer from server." says nothing.

> Regarding >> Please delete Service Tasks section before you start up a
> designer!!!
> Main problem is this usecase: User have created very large process and after
> some time he decided add new service (but forgot validate it). He loose all
> services in process!!! And he must define task in process again or roll
> back. <<
> I don't think this is the case. The process BPMN2 did not change! Only the
> display. When you user goes back and fixes / corrects their workitem
> definition, re-opening the process will bring it back to the expected
> display. The BPMN2 however stays as it was before (Designer does not do any
> magic of changing the bpmn2 :) )

This was my fault. I do not know, that BPMN2 remember type of task. I verified that.

> Let me know if this is OK.
But still there is problem, that Designer shows last valid configuration of service tasks.
I makes steps from comment #7 (step from #1 to #9).
Then:
  1. I correct MyTask2.
  2. Open BPMN2 process (Process shows MyTask correctly)
  3. clear a repository in guvnor
  4. create newwid.wid with valid definition of MyTask3 and save it.
  5. create newwid2.wid with invalid definition of MyTask4 and save it.
  6. create new BPMN2 process and open Service Tasks in Shape Repository.

Actual result:
There are still Email, Log, My Task, My Task 2 in Service Tasks. But no such work item definition is not in repository!!!!!! Screenshot is attached.

Expected result:
I guess that there should be only MyTask3 (according to your descriptions).
Comment 10 Sona Mala 2012-10-08 03:45:52 EDT
Created attachment 623323 [details]
Screenshot - Clear problem of designer
Comment 11 Sona Mala 2012-10-08 04:02:20 EDT
Created attachment 623325 [details]
Server.log

This is server.log output for opening designer and validation of process with corrupted service task. I thing that this exception shows a problem about MyTask. But ordinary user has not got access to server.log.
Comment 12 Sona Mala 2012-10-08 04:06:48 EDT
Comment on attachment 623323 [details]
Screenshot - Clear problem of designer

I thing that this is designer issue because it shows invalid service tasks. Designer allows create invalid BPMN2 process as you can see on screen shot.
Comment 13 Tihomir Surdilovic 2012-10-08 06:49:04 EDT
Regarding: 

>> 1. I correct MyTask2.
  2. Open BPMN2 process (Process shows MyTask correctly)
  3. clear a repository in guvnor
  4. create newwid.wid with valid definition of MyTask3 and save it.
  5. create newwid2.wid with invalid definition of MyTask4 and save it.
  6. create new BPMN2 process and open Service Tasks in Shape Repository. <<

I'm getting a different result which matches the code - when the two .wids in the package are newwid.wid and newwid2.wid where newwid2 has an invalid definition, then designer does not show the Service Tasks section at all. 

Currently it should be an all-or-nothing deal - if you have a wid which has an invalid config the parsing fails on all. 

Is the request to show everything that is valid and ommit the invalid configs? Please let me know because I am getting confused as in what is the requirement / what should be changed from the current behavior.

Thanks!
Comment 14 Sona Mala 2012-10-08 07:16:15 EDT
Created attachment 623408 [details]
Empty repository
Comment 15 Sona Mala 2012-10-08 07:18:34 EDT
My Fault: in step #3 I mean "import empty repository" instead of "shut down server, delete repository, start up server".
Comment 16 Tihomir Surdilovic 2012-10-11 14:19:45 EDT
In the test scenario:

1) If mywid1 or mywid2 (or both) are invalid - designer should show the default Log and Email icons
2) If mywid1 and mywid2 are valid - designer shows the sevice asks

What might be confusing is that if you create the process before the workitems (so package contains no pre-defined workitem configs) Designer will install the default (Email, Log) workitem into Guvnor. If you create your custom workitem configs before the process, Designer will not install the Default, but in case any of yours are invalid will use it from the default from its local war.

After testing all this I do not understand:

1) What is wrong
2) How it behave instead

Please help.
Comment 17 Sona Mala 2012-10-12 06:40:53 EDT
> In the test scenario:
> 
> 1) If mywid1 or mywid2 (or both) are invalid - designer should show the
> default Log and Email icons
> 2) If mywid1 and mywid2 are valid - designer shows the sevice asks

This scenario sounds good, but then title of this issue is nonsense: 
 "BPMN Editor Does not Show Service Task for any further new Work Item Definition(s) if definition as corrupted".

But designer's current behaviour is not able to describe by this test scenario, because using of default service task (Log, Email) is not safe. The explanation of this issue in bugzilla is too hard and I am going to attach zip files which documented this issue (for example video of desktop).

> After testing all this I do not understand:
> 1) What is wrong

     + Test Scenario in sense of issue title
        1) At least one of wids is valid - designer shows the
valid ones.
        2) All wids are invalid - designer shows the default service tasks or designer shows empty list of Service Tasks.
        Expected algorithm
           - clear list of service tasks
           - take wids as element
           - if wid is valid
              -> add all definitions of task to the list
           - if wid is invalid
              -> do not attach anything at the end of the list
     + Your test scenario:
         - Expected behaviour: 
              clear list of service tasks
              if found any corrupted wid
              -> clear list of service tasks
              -> maybe add: upload just default wid (Log,Email). 
                       but: what designer should do when this wid is changed by customer and is corrupted
         - Actual behaviour looks like:
              if found any corrupted wid
              -> return(break, log message) or something like that
              -> maybe: show the last valid configuration
Comment 18 Sona Mala 2012-10-12 06:51:15 EDT
Created attachment 625903 [details]
Verification of test scenario in comment #16 PART1

This file contains:
   - verification step by step in text file
   - screenshots of verifications in important point
   - video which records desktop during verification
Comment 19 Sona Mala 2012-10-12 07:33:17 EDT
Created attachment 625916 [details]
Verification of test scenario in comment #16 PART2

This file contains:
   - verification step by step in text file
   - screenshots of verifications in important point
   - video which records desktop during verification

This is without default service task (Email, Log)
Comment 20 Tihomir Surdilovic 2012-10-12 10:32:17 EDT
I have watched your vide and thank you for the all the details you have put into this. Up-front there is a difference that I find than in the vide:

After creating the two wids (first invalid and second one valid) (after importing the empty repo), then create the business process:

you - you do see the service nodes tab in the stencil set pallele
me - I do not see it

That I think is causing all of this confusion. Can you please try:

1) clear your browser cache
2) import the empty repository
3) ... continue w/ steps on the vide ...

I am really thinking that in your case in the video since the browser cache was not cleared, that you see the two service icons because the stencil set was cached. 

Let me know if this helps.
Comment 21 Tihomir Surdilovic 2012-10-24 19:47:41 EDT
I kind of need some feedback on this :) Let me know if my last comment makes sense. Thanks
Comment 22 Tihomir Surdilovic 2012-10-29 10:13:56 EDT
Fix checked into designer 2.3.x production branch.
Fix detail:

When users have multiple workitem definitions configured, failure of one definition does not cause cascade affect of all others being considered faulty as well. Only the definition(s) that are fault will not be seen in the stencil set.

Saving the process should be possible as well now if there are service nodes on canvas for who the workitem definitions become faulty.

Let me know if this is not behaving as expected.

Thanks.
Comment 23 Douglas Hoffman 2012-11-08 21:28:35 EST
Thanks for the doc text information regarding this bug. I'll update these notes for Release Notes purposes.

- Doug
Comment 24 Jiri Locker 2012-11-14 11:52:04 EST
I confirm that saving an invalid work item definition file now doesn't affect processes that use service task defined in other WID files. Namely, even if an invalid WID file has been saved in the repository, it is still possible to

* define and use new service task nodes
* validate and save processes

In the case a WID file is saved in an invalid state and there is a process that is using a service task node defined in the invalid WID, opening such process results in converting all invalid service task nodes into generic task nodes and the process can be validated without errors.

Fix verified in BRMS 5.3.1 ER4.

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