Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Manfred Kröpfli 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).
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
-
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.
-
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
-
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.
-
The new template has been posted here: http://community.sparxsystems.com/resources/code-templates/workflow-script-template