Skip to main content
3-Newcomer
October 3, 2025
Solved

How to run tasks in background (Creo Object Toolkit - Java)?

  • October 3, 2025
  • 2 replies
  • 651 views

We are working on building a Creo application using Object Toolkit Java.

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.

 

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.

The result is same for all modality types for a dialog - MODAL, MODELESS and WORKING.

 

Sample code snippet:

 
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(() -> {
 // Background tasks

 // Destroy dialog once background task is complete
 uifcComponent.DestroyDialog(UPLOAD_DIALOG, UPLOAD_DIALOG);
}, "thread_name");
backgroundThread.setDaemon(true);
backgroundThread.start();
 
Is there a way to keep the UI active and display some progress using animated gif while something is running in background?

 

cc: @RJ_11007702 

Best answer by RPN

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. 
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. 
On top your own event loop may blocked (during EventProcess) on some actions in Creo, for example if the user edit parameters. 
That’s all my 2 Cents based on your questions or assumptions πŸ˜΅β€πŸ’«

 

2 replies

RPN18-OpalAnswer
18-Opal
October 4, 2025

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. 
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. 
On top your own event loop may blocked (during EventProcess) on some actions in Creo, for example if the user edit parameters. 
That’s all my 2 Cents based on your questions or assumptions πŸ˜΅β€πŸ’«

 

Community Manager
October 22, 2025

Hi @GS_14113977,

 

I wanted to see if you got the help you needed.

If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation.  

 

Thanks,
Anurag