Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: jörg on September 04, 2018, 10:24:06 pm

Title: workflow script not called
Post by: jörg on September 04, 2018, 10:24:06 pm
First, Hi to all here in the Forum!

I'm pretty new to EA Scripting and I want to edit the workflow script. I created a new workflow script set the return value of AllowStatusUpdate to false. Nevertheless the status is changed. I added some output to the functions (Session.Output) but nothing appears in the system output window. It just seems not to call the functions. Same happens with the other functions (chenge version, phase, ...)


I'm really helpless in this point. Can anybody tell me what I do wrong here? I would really appreciate any help.
Title: Re: workflow script not called
Post by: Dermot on September 05, 2018, 12:51:28 pm
The Workflow Scripting does require some background to use it.
What I suggest you do is to download the whitepaper and example model on Workflow scrIpting from:
http://www.community.sparxsystems.com/white-papers/765-workflow-scripting-in-enterprise-architect
This gives a general guide and an example to work with.
Title: Re: workflow script not called
Post by: jörg on September 05, 2018, 07:17:50 pm
Hi Dermot,

thanks for your reply. I already had downloaded the example and have read all the documentation for workflow scripts I could find.
Yesterday in the example project I had a weird error message about a type conflicht in PreAllowStatusUpdate, after a restart this was ok again. But also in the example project the workflow functions seem not to be called. E. g. I logged in as a support member and was able to edit tags, although I shouldn't. There also was no message output (just tested again).
All I see in the System Output window (script tab) is "VBScript workflow engine created". The System tab is empty.

Do you have any idea what else I could test? Does the 'Session.Output" function basically work in workflow scripts?

Edit: I added PreAllowStatusUpdate and AllowStatusUpdate functions to the 'Validate' script (direct copy fom the default workflow script template) and set the return value of AllowStatusUpdate to false. ThenI saved the script and reloaded the project. Not only the changes of the status of an element (in the Properties/General dialog) are still possible, the type conflict message for PreAllowStatusUpdate comes again. Even after deleting the PreAllowStatusUpdate function from the script (and save and project reload) the message appears in the System Output window's 'Script' tab.
Something really goes wrong here and I have no clue how to proceed to get it working.
Title: Re: workflow script not called
Post by: jörg on September 06, 2018, 12:29:54 am
I don't know how, but I solved one of my problems. In my project I was able to disallow Status update by setting the return value of the function to false. I wasn't aware that I have to reload the scripts to make changes effective.  ::)
Also the Message about the type conflict I  accidentially make disappear after some changes. I just edited some stuff which was generating an error (I wanted to test 'option strict', which isn't available here and added some text after the PreAllowStatusUpdate function header), deleted the inserted stuff, reloaded the script and the Message was gone.

Edit: P.S.: How do I mark a topic as solved?