<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to run tasks in background (Creo Object Toolkit - Java)? in Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Customization/How-to-run-tasks-in-background-Creo-Object-Toolkit-Java/m-p/1036828#M14516</link>
    <description>&lt;P&gt;We are working on building a Creo application using Object Toolkit Java.&lt;/P&gt;&lt;P&gt;One usecase of our application is to execute tasks in background (such as authentication flow, upload opened model) while displaying progress (using animated gifs) on the custom UI created using Creo UI editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per our observation, whenever we start a task in background by creating a new Thread in Java, it blocks the currently open UI dialog i.e the UI dialog completely freezes and doesn't display anything.&lt;/P&gt;&lt;P&gt;The result is same for all modality types for a dialog - MODAL, MODELESS and WORKING.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample code snippet:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="java"&gt;uifcComponent.CreateDialog(UPLOAD_DIALOG, UPLOAD_DIALOG);
uifcDialog.DialogFind(UPLOAD_DIALOG, UPLOAD_DIALOG).SetModality(DialogStyle.DIALOG_STYLE_WORKING);
uifcComponent.ActivateDialog(UPLOAD_DIALOG);
Thread backgroundThread = new Thread(() -&amp;gt; {
    // Background tasks

    // Destroy dialog once background task is complete
    uifcComponent.DestroyDialog(UPLOAD_DIALOG, UPLOAD_DIALOG);
}, "thread_name");
backgroundThread.setDaemon(true);
backgroundThread.start();&lt;/LI-CODE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is there a way to keep the UI active and display some progress using animated gif while something is running in background?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cc:&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/1004609"&gt;@RJ_11007702&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Oct 2025 14:38:30 GMT</pubDate>
    <dc:creator>GS_14113977</dc:creator>
    <dc:date>2025-10-03T14:38:30Z</dc:date>
    <item>
      <title>How to run tasks in background (Creo Object Toolkit - Java)?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-run-tasks-in-background-Creo-Object-Toolkit-Java/m-p/1036828#M14516</link>
      <description>&lt;P&gt;We are working on building a Creo application using Object Toolkit Java.&lt;/P&gt;&lt;P&gt;One usecase of our application is to execute tasks in background (such as authentication flow, upload opened model) while displaying progress (using animated gifs) on the custom UI created using Creo UI editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per our observation, whenever we start a task in background by creating a new Thread in Java, it blocks the currently open UI dialog i.e the UI dialog completely freezes and doesn't display anything.&lt;/P&gt;&lt;P&gt;The result is same for all modality types for a dialog - MODAL, MODELESS and WORKING.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample code snippet:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="java"&gt;uifcComponent.CreateDialog(UPLOAD_DIALOG, UPLOAD_DIALOG);
uifcDialog.DialogFind(UPLOAD_DIALOG, UPLOAD_DIALOG).SetModality(DialogStyle.DIALOG_STYLE_WORKING);
uifcComponent.ActivateDialog(UPLOAD_DIALOG);
Thread backgroundThread = new Thread(() -&amp;gt; {
    // Background tasks

    // Destroy dialog once background task is complete
    uifcComponent.DestroyDialog(UPLOAD_DIALOG, UPLOAD_DIALOG);
}, "thread_name");
backgroundThread.setDaemon(true);
backgroundThread.start();&lt;/LI-CODE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is there a way to keep the UI active and display some progress using animated gif while something is running in background?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cc:&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/1004609"&gt;@RJ_11007702&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2025 14:38:30 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-run-tasks-in-background-Creo-Object-Toolkit-Java/m-p/1036828#M14516</guid>
      <dc:creator>GS_14113977</dc:creator>
      <dc:date>2025-10-03T14:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to run tasks in background (Creo Object Toolkit - Java)?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-run-tasks-in-background-Creo-Object-Toolkit-Java/m-p/1036882#M14517</link>
      <description>&lt;P&gt;In synchronous you use share the event loop with Creo, even if you would create another thread, you may not called, and by the way this kind of program is not supported by PTC.&amp;nbsp;&lt;BR /&gt;You need an asynchronous connection and your own event loop, here you can do what even you like. But even in this mode multiple threads may an issues, it depends which thread tries to do something in Creo.&amp;nbsp;&lt;BR /&gt;On top your own event loop may blocked (during EventProcess) on some actions in Creo, for example if the user edit parameters.&amp;nbsp;&lt;BR /&gt;That’s all my 2 Cents based on your questions or assumptions &lt;span class="lia-unicode-emoji" title=":dizzy_face:"&gt;😵&lt;/span&gt;‍&lt;span class="lia-unicode-emoji" title=":dizzy:"&gt;💫&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Oct 2025 09:39:45 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-run-tasks-in-background-Creo-Object-Toolkit-Java/m-p/1036882#M14517</guid>
      <dc:creator>RPN</dc:creator>
      <dc:date>2025-10-04T09:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to run tasks in background (Creo Object Toolkit - Java)?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-run-tasks-in-background-Creo-Object-Toolkit-Java/m-p/1039589#M14540</link>
      <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/998103"&gt;@GS_14113977&lt;/a&gt;&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to see if you got the help you needed.&lt;/P&gt;
&lt;P&gt;If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.&lt;BR /&gt;Of course, if you have more to share on your issue, please pursue the conversation. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Anurag&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 07:45:51 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-run-tasks-in-background-Creo-Object-Toolkit-Java/m-p/1039589#M14540</guid>
      <dc:creator>anursingh</dc:creator>
      <dc:date>2025-10-22T07:45:51Z</dc:date>
    </item>
  </channel>
</rss>

