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: 

Execute WF transition in another WS (on existing item)

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
wendy.salas
431 Views, 2 Replies

Execute WF transition in another WS (on existing item)

Hello,

 

I have 2 workspaces A and B. Both have items that exist in the DB, and are associated through the Relationships tab (bi-directional).

 

I would like to write a script so that when the item in WS B is set to 'Closed', the related item in WS A is set to Closed as well. I have found the script that allows for 'performWorkflowTransitionBy', but I have only been able to use it when creating new items, and I would like to use it in an existing item, and driving the linkage thru the Relationships tab.

 

Could you please provide any guidance? (maybe I am not understanding how the Relationships are called on the script reference). 

 

Thanks!

2 REPLIES 2
Message 2 of 3

I have done something similar with automatically pushing workflows forward, but not on related items.

 

You should be able to advance the related items as follows:

 

for (var i=1;item.relationships.length; i++) {
	relatedItem = item.relationships[i-1].item;
	relatedItem.performWorkflowTransitionByCustomID('AUTONOTIFY', 'Automatically notified since created from a CO')
}

Be sure to add some conditional statements to check if the item should be moved forward and that the item is in the expected state.

 

Hope that helps.

Message 3 of 3

Thanks Tony! Will test and let you know if we run into any issues. I was on the wrong path on how to call relationships.

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

Post to forums  

Autodesk Design & Make Report