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: 

Running scripts on CO affected items

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
dkeeley
774 Views, 7 Replies

Running scripts on CO affected items

Hi,

 

I want to be able to run a script on the affected items of a CO when they promoted to the new state. I need to spawn some new items each of the affected items once they are released. I have had two thoughts about doing this but I need some input.

 

Approach 1

Add a script to the transition to the managed state in the change order workflow. This would require me to be able to read the affected items of the change order using a script. Is this possible?

 

Approach 2

Set up a script to run when each of the affected items are edited. This approach would require that a lifecyle or revison change is an item 'edit'. I'm not sure if this is the case

 

Thanks,

 

David.

7 REPLIES 7
Message 2 of 8
jpiggee
in reply to: dkeeley

David,

 

See you Private message inbox.

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 3 of 8
dkeeley
in reply to: jpiggee

Hi Joe,

 

See attached.

Message 4 of 8
jpiggee
in reply to: dkeeley

Hi David,

 

So for the long wait on the reply but I want to make sure to cover all options and questions that may arise when answering this. If I still am leaving a little confusion in this answer let me know.

 

Side note- Thank you for the great mental exercise!

 

Let’s get started shall we?

 

So looking at the diagram this could be possible but there is one thing stopping us.

 

How it could work:

You could build to different library workspace building scripts one for Contract items, one for Sales Specifications. Then you would call on these when the Change order item moved through the transition to the Managed state.

 

Why it won’t work:

Unfortunately with a current limitation on how scripts are executed in the system, if a workspace is spawned there is no way to know what the item is until after the script is done. So Change order would know that Sales were created and Contract was created also, It could also tell the workspaces that “XXXX” Change order created it but Sales and Contract wouldn’t be able to tell the Contact order how to find them.

 

How you could work around:

If you were to tell and store the parent item (the link to the Change order) in the Sales and Contract item, then on a spate transition with in the spawned workspaces you could have them write back to the original Change Order.

 

Other possible problems to consider:

Scalability- the more workspaces you are spawning the more time it takes for the JAVA engine to run. This is a variable factor based on what else is happening in the cloud when this is going on. So in theory it could work one time but not the next (theory being the key word here). So now it comes down to testing (lots of it) and a backup plan for how to check if this does fail, so that a failure goes unnoticed.

 

Once again thankyou for the question and I hope this answers everything!

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 5 of 8
dkeeley
in reply to: jpiggee

Hi Joe,

 

Wow. Thanks for the very detailed reply. Much appreciated.

 

I'll read over it tonight and get back to you tomorrow.

 

David.

Message 6 of 8
dkeeley
in reply to: dkeeley

Hi Joe,

 

I spent some time digesting this last night. It seems that none of the proposed solutions will really do what I want them to do. The problem would be corrected if you were able to access relationships via scripts (like grid items). Can you provide me with any idea of when you hope to introduce this funtionality to PLM 360?

 

If I knew when relationship scripting was coming I would find a short-term manual work-around for this problem.

 

I know there's already a lot of chat about this in the IdeaStation.

 

Thanks,

 

David.

Message 7 of 8
jpiggee
in reply to: dkeeley

Hi David,

 

Glad the info helped, but sorry for it not giving you a solution you were looking for.

 

As for when access to relations via scripting being available? This I unfortunately don’t know at this time.

 

However because it is under development / review, I would highly recommend joining in and offering your ideas on the conversations about it in the IdeaStation. Not only will you be able to help molded it in the way you would like to see it, but you could also help us understand more about what users like you are trying to achieve with our product.

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 8 of 8
dkeeley
in reply to: jpiggee

Hi Joe,

 

I think the new 'workflow items' scripting functionality that's been added in the November update will solve my problem. It tool me a while to figure out the syntax but I think I've got it now.

 

//Load the item in the 'Affected Items' tab using the following;

var linked_item = loadItem(item.workflowItems[1].id);

 

//The make a change to any filed in the item using the following;;
linked_item.ORIENTATION = 'Vertical';

 

etc etc etc

 

I can create spawned items etc using this method I think.

 

Great work guys. Keep it up.

 

David.

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

Post to forums  

Autodesk Design & Make Report