Book a Demo

Author Topic: Workflow Scripts  (Read 4583 times)

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Workflow Scripts
« on: January 23, 2014, 06:11:07 am »
Hi,

I'm trying to call Repository.GetTreeSelectedPackage within a workflow script. The script has no syntax errors and is loaded by the workflow engine. I've run tests that show that the AllowStatusUpdate method is being called as it should, the issue is that the script stops at the line containing my Repository.GetTreeSelectedPackage call with no errors.

Are you not allowed to call Repository methods within the workflow script ?

Regards,


Jon.

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Workflow Scripts
« Reply #1 on: January 23, 2014, 03:33:01 pm »
The Workflow script is quite seperate to the main stream Automation script. So Repository.GetTreeSelectedPackage is not callable.

It is more meant for processing the whole model for items to be acted on. You might find other methods like filterng to achieve your goal.
For a run over using debug for this script see the whitepaper and the example model available on:
http://community.sparxsystems.com/white-papers/765-workflow-scripting-in-enterprise-architect

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Workflow Scripts
« Reply #2 on: January 23, 2014, 07:57:45 pm »
Hi Dermot,

Thanks for the response. My requirement is to run an SQL query that checks the contents of the selected package when its status is changed to, in this case, 'Ready for QA'. I can see using the workflow script i can check that the metatype = 'Package' and that the NewValue = 'Ready for QA'.

Can you confirm however that i have access to no capability provided by the Repository Class ?

You mention 'filtering' could you expand on this ? Is there a way to address my requirement using workflow scripts ?

Regards,

Jon.

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Workflow Scripts
« Reply #3 on: January 24, 2014, 03:54:44 pm »
A broad reply to your question is - Workflow gives lists of Elements to specific users or groups of users  depending on some status of the Elements. It is their set of tasks to perform. It is a complex search of the model.

If what you want is to prompt user(s) that a status has changed then best to do that by other means. Workflow simply provides the list of items to act on.

For such a prompt see Model Views "Notify me when new results found "
http://www.sparxsystems.com/enterprise_architect_user_guide/10/navigate_search_and_trace/model_views_operations.html
A Model View Search can be used to prompt the user of any changes ocurring to the Worklow items (no script required).
« Last Edit: January 24, 2014, 03:57:24 pm by Dermot »