Author Topic: Catch broadcast events with workflow scripts?  (Read 5262 times)

Manfred Kröpfli

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Catch broadcast events with workflow scripts?
« on: October 26, 2010, 01:26:38 am »
Hi

I'm just new to EA scripting, but already did quite some EA addin programming.

With EA addins, I especially liked the broadcast event feature to intercept user actions with additional logic, mostly in the field of model security. When reading now about workflow scripts as a means for finer grained user access control, I intuitively thought about the broadcast event feature, but unfortunately, I couldn't find any hints.

It would represent a vast benefit to me to e.g. get a hold on an EA_OnPreNewElement() event through a workflow script and place additional logic there (see VBScript sniplet below).

Code: [Select]
Public Function EA_OnPreNewElement(Repository, Info)
   if (...)   'logic goes here
      EA_OnPreNewElement = True
   else
      EA_OnPreNewElement = False
End Function
The need of labor intense distribution of EA addins would be history for this kind of functionality. Any helpful thoughts on this issue?

Thx & cheers
Manfred
« Last Edit: October 26, 2010, 01:38:33 am by kroepfli »
Cheers
Manfred

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: Catch broadcast events with workflow scripts?
« Reply #1 on: October 26, 2010, 08:58:55 am »
Hi Manfred,

I'm not sure if its documented, but you should be able to handle the following already in workflow scripts.

function OnPreNewElement( sType, sStereptype )
function OnPreNewConnector( sType, sSubType, sStereotype )

These requests are broadcasted to the workflow scripts before they are broadcasted to the addins. As far as I can tell they are the only broadcasts that are handled through the workflow engine.
Best Regards,

Michael

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

Manfred Kröpfli

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Catch broadcast events with workflow scripts?
« Reply #2 on: November 01, 2010, 08:13:46 pm »
Hi Michael

no, these functions are not (yet) documented, but look very promissing.

Neverthesless, I'd wish to have more documentation and VBScript samples on workflow scripting to understand the concepts behind this feature properly. Looking at the current EA user guide involves a whole bunch of guessing.

Any better (inofficial) sources available by anyone?

Thanks for your contributions
Manfred
« Last Edit: November 01, 2010, 08:15:22 pm by kroepfli »
Cheers
Manfred

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: Catch broadcast events with workflow scripts?
« Reply #3 on: November 03, 2010, 11:39:50 am »
Hi Manfred,

I've just been through the script templates for Workflow scripts and provided a lot more documentation etc on the functions. Unfortunately it's way too big to post on the forums.

It should be available in the next version of Enterprise Architect, however in the meantime, if you would like a copy of it, please send an email to Sparx Support to my attention and I'll get a copy to you. I'll also try and get it published on the community site.
Best Regards,

Michael

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

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: Catch broadcast events with workflow scripts?
« Reply #4 on: November 04, 2010, 10:48:51 am »
Best Regards,

Michael

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