Task Completion SDK

I am currently looking at the customisation taskcompletionsdk (docs.rws.com/.../sample-ui-customizations) to adapt the complete step dialog. We are currently WS 11.7.3.

I have following questions relating to the provided sample:

  1. Is it possible to limit the customisation to one task step (e.g. based on its name) or it can only be applied to all steps in the workflow?
  2. The okButton seems to run the complete step by choosing the first transition. Is there a way of changing this or is this a default?
  3. Is there a way to display all transitions as the standard dialog does or do we need to implement a custom code to reproduce what the application does out of the box?

Thank you in advance for your support

emoji
Parents
  • Hi Laurent,

     

    I am sorry for the delay in answering your question.

     

    Find below the answers to your questions. The code samples are adjustments to the original taskcompletionsdk.js file.

     

    1. Is it possible to limit the customization to one task step (e.g. based on its name) or it can only be applied to all steps in the workflow?

    You can achieve this is two ways:

    • You can implement your own logic for applying changes only to a task step (based on transition name or any other information). In the example below we made some adjustments only for the “Translate” transition:

    Screenshot of Trados Studio code with a function highlighted, showing an alert for adjustments only on the 'Translate' step.

     

    1. The okButton seems to run the complete step by choosing the first transition. Is there a way of changing this or is this a default?

    WorldServer will select the first transition by default. You can override this behavior with custom code that will change the selection based on your needs. In the example below, we are selecting the second transition when available:

     Screenshot of Trados Studio code with an error, indicating a missing semicolon at the end of a function call.

    1. Is there a way to display all transitions as the standard dialog does or do we need to implement a custom code to reproduce what the application does out of the box?

     

    Sure, you can just comment out this line of code:

     Screenshot of Trados Studio code with a section commented out, possibly to disable a feature or function.

    I hope the provided information helps you achieve the customization you need.

     

    Best regards,

    Anca

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 10:38 AM (GMT 0) on 4 Mar 2024]
  • Dear  ,

    One more question: how should I proceed to apply additional logic to the OK button so that it completes the task (native behaviour) and does another action (e.g. set an attribute)? Do I need to create a new function which will implement again the complete task or can I have a function which is executed at the same time as the complete task?

    Thank you in advance for your help.

    Regards,

    Laurent

    emoji
  • Hi  ,

    The implementation depends on what you want to achieve.
    I would call any action (like set attributes) before completing the task to ensure there is no paralelization issue or undesired behavior, like complete task execution hapenning before setting up the attributes.

    You can do this in several ways:
    1. New button that calls set attributes API + Complete API - if you wish to do it yourself, hide OK button.
    2. New button that calls  set attributes API + the complete function from OK button, hide OK button (as in the screenshot, for the 'Fly' button).

    Thank you,

    Anca

    emoji
Reply Children