We have a custom ArcGIS Pro Command (addin) in a Workflow Manager Server step not working.
How could we debug or see whatever logs?
Solved
You should add to Module file following code
Please see the following sample for configuration needed for custom add-in to run during open pro project items step:
/// <summary>
/// Override this method to allow execution of DAML commands specified in this module.
/// This is needed to run commands using the Open Pro Project Items step.
/// </summary>
/// <param name="id">The DAML control identifier.</param>
/// <returns>A user defined function that will execute asynchronously when invoked.</returns>
protected override Func<Task> ExecuteCommand(string id)
{
return () => QueuedTask.Run(() =>
{
try
{
// Run the command specified by the id
IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper(id);
ICommand command = wrapper as ICommand;
if ((command != null) && command.CanExecute(null))
command.Execute(null);
}
catch (Exception e)
{
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show($"ERROR: {e}", "Error running command");
}
});
}
Solved! Go to Solution.
@StefanDieters1 It is solved. I updated the main topic
Hi,
If you have code of custom add-in, it is the same as debugging add-in. Start add-in debugging from Visual Studio. Place breakpoint inside Custom Command OnClick() method. Then execute workflow.
@GKmieliauskas thank you for your answer.
The point is we cannot hit the breakpoint. An addin in not called at all.
We might be missing some setting when designing our workflow step and our addin.
1. Make a copy of your workflow.
2. Delete all steps in your workflow which goes after your add-in calling and your add-in calling step.
3. Execute your new workflow.
4. Execute your add-in from ArcGIS Pro ribbon by pressing it's button.
I am having a similar issue.
Using the Open Pro Items step under Pro 3.2 Enterprise 11.2 I attempt to run a custom Pro command.
The Open Pro Open step works fine, opening a map, but the command is not run: nothing happens.
I know the add-in command works. I can run it from the ribbon.
The Add-In command is a button with a On Click to trigger its action.
Is there some restriction on the type of commands that can be run?
What is supposed to happen?
@StefanDieters1 It is solved. I updated the main topic
Thanks in another spot
That's it.
Now have my test addin being run when I Open Pro Project Command.
Thanks