cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Script item.performWorkflowTransitionByCustomID

Script item.performWorkflowTransitionByCustomID

Hello,

 

After some tests I think that I have a better idea of how works the script:

 

item.performWorkflowTransitionByCustomID('CUSTOM_ID', 'COMMENTS')

 

 

 

Notes:

- For information, “script A” and “script B” are both action scripts.

- In the script A, every state has his own actions like that:

 

 

switch(customTransID){

    case 'SUBMIT_SINGLE_TRACK':

                item.performWorkflowTransitionByCustomID('SINGLE_TRACK_APPROVAL', 'blabla comment')

                break;

 

    case ‘SINGLE_TRACK_APPROVAL:

        item.performWorkflowTransitionByCustomID('PUSH_TO_ERP', ‘blabla comment');

        break;

}

 

In the tests below, I call this “state case”.

 

Initial situation: you use this formula in the ‘script A’ which performs a transition.

 

Test 1:

If the transition is performed in the SAME SCRIPT (‘script A’), the actions contained in the ‘script A’ are not performed.

==> The action script doesn’t look in the state case to execute the actions inside.

==> Of course, I have put the action ‘script A’ in the workflow to be executed.

 

Test 2:

If the transition is performed in ANOTHER SCRIPT (‘script B’), the actions contained in the ‘script B’ are performed.

==> The action script is executed even if the actions are in a state case.

==> Of course, I have put the action ‘script B’ in the workflow to be executed.

 

Perhaps it will be good to explain in the Autodesk Scripting Reference how it works if my tests are correct because it is a little confusing if you don’t do the tests.

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/ENU/PLM-360-Scripting/files/GU...

 

Thanks!

Sylvain

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

Submit Idea