Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can I create Milestones outside of an onCreate script?

5 REPLIES 5
Reply
Message 1 of 6
leungjcp
294 Views, 5 Replies

Can I create Milestones outside of an onCreate script?

We have about 50 files.  Each file represents a component we want to track, therefor we spawn 50 new records.  At the end of a WF transition, a WF script creates all the new records but we get a script timeout error.  (script ran too long....exceeds 9 secs)  

 

I've talked to support previously so this is not a  new issue.  If I remove the milestone creation code in my onCreate script, I can create approx. 80 records within the time limit.  But I still need to create the milestones at some point.  

 

Also, all 50 items are managed in another workspace, under a project management tab.  Is there a way I can create the milestones for each of the 50 items outside of the onCreate behaviour?

 

 

5 REPLIES 5
Message 2 of 6
shenx
in reply to: leungjcp

if you can wait for sometime, you can consider the escalation script. i.e., in the first state after the item created, enable the escalation and make it run the script to create milestone. the script will be run one by one for each item, will have less chance to get the timeout error.

Message 3 of 6
leungjcp
in reply to: shenx

This is an interesting approach although the minimum time is 1 day. I will consider this. Currently I have implemented my milestone creation at the first WF transition someone makes. Thanks.
[http://www.nucap.com/images/image001.jpg] Jason Leung - Design Engineer
NUCAP Industries Inc.
3370 Pharmacy Avenue, Toronto ON
Ph.416 494 1444 FAX.416 494 2505
Jason.Leung@nucap.com

Please visit us at www.nucap.com www.gripmetal.com



[http://www.nucap.com/images/banner-nrs.png]
Message 4 of 6
SailinBenedum
in reply to: leungjcp

Are your "Files" or records specific to a single milestone/workflow stage or can they be grouped by Milestone/WF Stage?

 

If not, I would suggest looking for a way to better group your Files by Milestone or WF Stage.

 

A technique we use to circumvent the 9sec rule is using Chained Scripts.

 

To do this we start with templates to capture the Tasks (Files in your case) that relate to each Milestone.

This would require 3 workspaces; Project Milestone Templates, Project Milestones, Project Tasks.

 

The "Project Milestone Templates", uses a Grid Tab to store your Tasks (Files) fields as well as a reference to the Milestone each one relates to (a text field that relates to the Milestone). You may already be doing this...

 

Then on your WF transition, you create the Milestones (actual milestones) as well as the Project Milestones, you can also associate these with the Milestones to show progress.

 

Your Project Milestone has a simple workflow [planned, scheduled, complete] and on the planned to scheduled transition ( let's call it "START_MILESTONE") you have a script that adds the Tasks from the template (Grid) just for that milestone.

 

When you create the Milestones you can choose to "start" all of them or just the first one, which you do by calling item.project.children[i].performWorkflowTransitionByCustomID('START_MILESTONE', 'Some Comment'); which in turn triggers the workflow transition script to add the tasks to the Milestone.

 

 

This will effectively kick off several Chained scripts, each one being bound by the 9sec restriction, but together Chained scripts have 90sec to complete.

 

Here is an example of what the Project tab looks like:

Project Items 3-7 haven't been started yet so the "Tasks" have not been created below them.

Project Milestones & Project Tasks.png

Sailin Benedum
D3 Technologies - Solution Consultant

D3 Technologies | Connect with me on LinkedIn
Message 5 of 6
leungjcp
in reply to: SailinBenedum

Each of my files represent a component for manufacture. In all my designs so far, I've created all the milestones at the time of item creation. (onCreate script). In this way I can easily retrieve, current state, current progress etc.

In my case, I can have 50+ components and each component will have 15 possible milestone/ states. So I need to create 50+ records and all need milestone creation within the 9sec limit at the turn of a WF transition . (Eng design complete -> transfer to our Shop)

I've tried chaining scripts but only chaining to library script calls. I have a workspace which manages the progress of all 50+ items and the workspace of the item itself. When all components reach 100% completion, I then capture metrics of how long entire project took, overall completed date etc....

The current design is also live in production and we never expected to face a time limit until we came across bigger designs with more items. For now each item does not have a milestone until it moves from "Not Started" state to whatever the chosen state will be. I've off-loaded the MS creation here since it was the easiest solution for us without changing the framework of the design.

Appreciate everyone's suggestions.



[http://www.nucap.com/images/image001.jpg] Jason Leung - Design Engineer
NUCAP Industries Inc.
3370 Pharmacy Avenue, Toronto ON
Ph.416 494 1444 FAX.416 494 2505
Jason.Leung@nucap.com

Please visit us at www.nucap.com www.gripmetal.com



[http://www.nucap.com/images/banner-pistoncushion.png]
Message 6 of 6
gasevsm
in reply to: leungjcp

Outsource the milestone handling to each created item to deal with own settings. Let the WF script set dummy hidden properties on the newly created items (eg dates for milestones or link back to the wf item that created them to reference), so they can in turn use own oncreate script and process own milestones. Those items can track own time and update too your central place of time taken by adding their part to current values.

Martin Gasevski | Fusion 360 Team Product Manager

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report