Book a Demo

Author Topic: Version 8 Workflows  (Read 6812 times)

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Version 8 Workflows
« on: March 31, 2010, 11:07:25 pm »
When version 8 was announced, I was very excited about two features.

1) The structured use case
2) Workflows

I have been evaluating the betas (including the latest Beta 3) and have found the stuctured use case most useful and am pleased with the result.

However, not the same with workflows. The help is very brief, and I cannot find any worked examples not how to use the scripts.

I did manage to create a new workflow script, which gave me a "boiler plate" scrip with comments. I modified one of the permission from true to false (the ability to change status) and yes I did change both the relavant methods.

I saved the script.

But no effect, I can still change anything I want.

How do you get the scripts to take effect? Do they only work on a named user with the security enabled?

I would be most grateful if someone out there has got this to work, and if so how?

Cheers

Phil
Models are great!
Correct models are even greater!

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Version 8 Workflows
« Reply #1 on: April 01, 2010, 09:34:03 am »
User Security needs to be enabled on your model before any workflow scripts will be used.  When editing the scripts, you may need to reload the model before your changes take effect.  I think clicking the "Refresh Script Tree" button in the scripting window might trigger any new changes to your workflow scripts to take effect immediately..

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Version 8 Workflows
« Reply #2 on: April 07, 2010, 07:50:41 pm »
Hi Aaron

Thanks but I still cannot get it to work! I do indeed have security enabled and have created a group called Users, in which there is one user phil who has all privileges.

I have tried to create a workflow script to prevent the current user changing the status field

The help states that CanEditStatus set to False completelt disables this control for the current user.

Simply changing the True (in the template script) to False has no effect whatsoever, the user phil can do what he likes.

I have also tried the following:

Public Function CanEditStatus()
    If IsMemberOf("Users") Then
            CanEditStatus = False
      Else
            CanEditStatus = True
    End If
End Function

but this also has no effect. I have tried reloading the project, reloading EA, refreshing the script etc. But all fails, any advice from anyone?
Models are great!
Correct models are even greater!

Graham_Moir

  • EA User
  • **
  • Posts: 749
  • Karma: +10/-15
    • View Profile
Re: Version 8 Workflows
« Reply #3 on: April 07, 2010, 08:28:23 pm »
Well version 8 is still in beta, so perhaps it's time to raise the issue formally as a beta bug ?

geert

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Version 8 Workflows
« Reply #4 on: April 15, 2010, 11:33:24 pm »
Hey Phil,

this worked for me:

Public Function CanEditStatus()
    If WorkflowUser.IsMemberOf("GeertsGroup") Then
            'MsgBox "Don't touch me"
          CanEditStatus = False
     Else
            'MsgBox "You can touch me!"
           CanEditStatus = True
   End If
End Function

Hope this helps for you.

Grtz!
« Last Edit: April 15, 2010, 11:46:49 pm by geert »

geert

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Version 8 Workflows
« Reply #5 on: April 16, 2010, 12:30:02 am »
Hey,

i executed following script:

Public Function CanEditStatus()
    If WorkflowUser.IsMemberOf("GeertsGroup") Then
          CanEditStatus = False
     Else
           CanEditStatus = True
   End If
End Function

works fine...

when you are of the specified group, you can open an element, the Status field will be disabled == great, i expected this.

now when that user changes the name of that element, suddenly the Status field is enabled and he can joyfully change the Status save it and afterwards rename it again == i did NOT expect this

Why is this? And can somebody help me to solve this problem?

Greetings,
Geert

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Version 8 Workflows
« Reply #6 on: April 16, 2010, 12:59:11 am »
Thanks, I have not got the scripts working in the released version 8.0. My script is slightly different:

Public Function AllowPhaseUpdate(OldValue, NewValue)
    If WorkflowUser.Username = "phil" Then
            AllowPhaseUpdate = False
            WorkflowStatus.LogEntry = True
            WorkflowStatus.Reason = "Sorry you are not allowed to change the phase of an element"
            WorkflowStatus.Action = "MessageBox"
      Else
            AllowPhaseUpdate = True
      end If
End Function

Oddly, I tried the same as you rename and then change the Phase, I was allowed, but upon a subsequent change I wasn't allowed!

I also experienced the same on initial load. After loading the project I could make changes, bu a subsequent change was prevented.

More investigation is needed I think!
Models are great!
Correct models are even greater!

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Version 8 Workflows
« Reply #7 on: April 16, 2010, 01:06:46 am »
I think I have discovered the answer to the anomoly with the workflow scripts,

The behaviour found by Geert and myself, appears to be affected by the "Lazy Load" option for EAP files. This is set by default on the Options menu.

I turned this off and the script works just fine, and behaves as expected.

I will submit a bug report for this.
Models are great!
Correct models are even greater!

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: Version 8 Workflows
« Reply #8 on: April 16, 2010, 09:20:02 am »
Hi Phil,

Have you guys tested this with the final version 8 release? We did fix up a few lazy load issues through the automation interface, and I'm hoping this would be one of them.
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Version 8 Workflows
« Reply #9 on: April 16, 2010, 06:33:37 pm »
I guess so, I used the workflow script on EA version 8 build 855
Models are great!
Correct models are even greater!

geert

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Version 8 Workflows
« Reply #10 on: April 16, 2010, 09:40:55 pm »
Me too. I tested it on the final releaseof EA 8, build 855.

geert

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Version 8 Workflows
« Reply #11 on: May 20, 2010, 06:11:04 pm »
hey,

i've noticed when taking a screenshot, the same thing happens.

I run the script, the status is disabled.
I take a screenshot, the status becomes enabled again.

Has this been reported as a bug in the meanwhile?

Grtz,
Geert