Failed in open OpenFileDialog from an activity.

Oct 11, 2010 at 12:37 AM

Hi, there

I have built a number of activites which pop up GUIs, they work pretty good.

Recently, I built an activity which called OpenFileDialog directly. It also worked.

Then I moved these codes into an independent project and referred this project into the activity. 

When I ran this workflow again, the dialog did not appear. The workflow was just waiting there. (the workflow has been set as Interactvie mode)

However, when I ran this workflow under debug mode by clicking DEBUG button instead of RUN button, this time, the dialog showed up.  Then again, I ran it again by clicking RUN button,  the dialog cannot pop up.

Is there anyone who knows the possible reason?

Another question is we know Non-Interactive workflows run under System account. Do we have a simple way to check if the workflow is running under interactvie mode when we try to run a GUI actvity?

Many thanks






Oct 11, 2010 at 12:26 PM


<<Is there anyone who knows the possible reason?>>
Problem: When the dialog pops up, the owner of the window will be the console application (where the workflow is hosted). So, there might be a possibility that the Workflow composer window is selected and the file dialog which is opened is hidden behind the composer window.
So you can use “Alt+Tab” key combination to go through all the open windows and see if the dialog is opened or not.

If the file dialog is not opened, then can you please send the code for the activity and the project to and 

<<Do we have a simple way to check if the workflow is running under interactive mode when we try to run a GUI activity>>
Yes. The details of the workflow can be accessed using the following approaches:

Approach 1:
You can view the type of the workflow using Trident management studio:
Follow the below to view the type of the workflow

  • Open Management studio
  • Click on Registry manager
  • In the workflow section select the workflow which you need to get the type
  • Then check the type filed in the main panel.

Approach 2:
The details about the Workflow can be accessed from your SQL database back-end.
You can run the following SQL query on the Trident DB to retrieve information about all the workflows running under Interactive mode:
Select * from Activitys where IsInteractive = 1

Please let us know if this answers your questions.
Trident Support Team

Oct 11, 2010 at 11:11 PM
Edited Oct 11, 2010 at 11:22 PM

Many thanks

Problem 1. :  Yes, it hides behind.

                    Do we have a way to bring the dialog upfront?

Problem 2:   I apologize I did not make the question clear.  My question is that  how the activity itself can easily check ifr the workflow that it sits is interactive, when the activity is being executed.



Oct 13, 2010 at 6:59 AM
You can use the following code in the execute method of the activity to check if the workflow is interactive or not.
Context ctx = Context.Get();
ctx.WFInstance.Activity.IsInteractive; // Specifies if the workflow is Interactive or not.
Context type is declared in the Microsoft.Research.TridentAPI assembly. So for using this Context type you need to refer Microsoft.Research.TridentAPI to the activity library project.
Please let us know if this helps in answering your question.
Trident Support Team
Oct 13, 2010 at 10:53 PM

I cannot find Context type in Microsoft.Research.TridentAPI . It only contaisn BaseTypeInitializer, InstanceAPI and TypeProviderHelper.

Are we using the same assmebly?

Many thanks


Oct 14, 2010 at 9:41 AM
You are correct TridentAPI does not contain Context type. But it could be found in TridentContext.dll.
You can find this assembly in Program Files\Microsoft Project Trident - A Scientific Workflow Workbench\Libraries\TridentContext.dll once you have installed trident.
Please let us know if this answers your question.
Trident Support Team
Oct 15, 2010 at 2:03 AM

Thanks. It is working now.

BTW, do we have a way bring the OpenFileDialog upfront?



Oct 15, 2010 at 10:52 AM
Edited Oct 15, 2010 at 4:29 PM

As of now there is no way to bring the pop-up dialog upfront in Trident.
Please let us know if you have further questions/issues.
Trident Support Team

Oct 28, 2010 at 3:05 PM


Can you please let us know if our response helped in answering your questions?

Trident Support Team

Jan 25, 2011 at 1:29 PM


We have not heard back from you for a long time and we hope this means your question has been answered. We are marking the thread as closed.

Please let us know in case you have any further questions/concerns.

Trident Support Team