Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Launching a "RunAs" Task from a Wizard
Launching a "RunAs" Task from a Wizard [message #21851] Sat, 13 September 2008 11:18 Go to next message
Karl Philipp is currently offline Karl PhilippFriend
Messages: 2
Registered: July 2009
Junior Member
I would like to integrate an available RunAs task (called "oaw workflow",
BTW) in a wizard I currently implementing, that is the call of this task
shall have the same effect to the eclipse project as the task would have
manually launched by a user.

In this context:

1. Can I identify how the "RunAS Oaw workflow" entry is attached
to the underlying code (oaw plugin)?
That is, I need the method call that is represented by "RunAS Oaw
workflow".
I guess that the menu item "RunAs" is an extension point.

2. ...

Thanks in advance for your support
Re: Launching a "RunAs" Task from a Wizard [message #40443 is a reply to message #21851] Wed, 14 January 2009 15:24 Go to previous message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

This is a multi-part message in MIME format.
--------------000600030706050706080009
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

Look into the oAW source code. In the org.openarchitectureware.workflow
you'll find LaunchDelegate implementations that do what you need.
There's also code there that helps you understand how to call them. I
used something like the following:

ILaunchConfigurationType configType =
DebugPlugin.getDefault()
.getLaunchManager()
.getLaunchConfigurationType(
IWfLaunchConfigurationConstants.WORKFLOW_LAUNCH_CONFIGURATIO N_TYPE_ID);
ILaunchConfigurationWorkingCopy launchConfig =
configType.newInstance(null, "generate.oaw");
launchConfig.setAttribute(
IWfLaunchConfigurationConstants.ATTR_OAW_WORKFLOW_FILE,
workflowFile.getFullPath().toString());
launchConfig.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
project.getName());

/*
* Wait for build jobs here. For some reason, whenever I am not
* debugging this code, DebugUITools run into a NullPointerException
* when trying to do the waiting themselves
*
* This workaround code was copied from WorkflowLaunchDelegate.launch()
*/
Job[] autoBuildJobs;
Job[] manBuildJobs;
do {
autoBuildJobs = Job.getJobManager().find(
ResourcesPlugin.FAMILY_AUTO_BUILD);
manBuildJobs = Job.getJobManager().find(
ResourcesPlugin.FAMILY_MANUAL_BUILD);
} while (autoBuildJobs.length > 0 || manBuildJobs.length > 0);

DebugUITools.launch(launchConfig, "run");


Notice, that this will trigger the workflow in a separate launch; that
is in a separate Job. I have still to figure out how to wait till its done.

Regards,

Steffen

Karl Philipp wrote:
> I would like to integrate an available RunAs task (called "oaw
> workflow", BTW) in a wizard I currently implementing, that is the call
> of this task shall have the same effect to the eclipse project as the
> task would have manually launched by a user.
>
> In this context:
>
> 1. Can I identify how the "RunAS Oaw workflow" entry is attached
> to the underlying code (oaw plugin)?
> That is, I need the method call that is represented by "RunAS Oaw
> workflow".
> I guess that the menu item "RunAs" is an extension point.
>
> 2. ...
>
> Thanks in advance for your support
>
>

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
Phone +44 (01524) 510354
WWW http://www.steffen-zschaler.de/

--
Consider submitting to ECMDA-FA 2009, the 5th European Conference on
Model-Driven Architecture Foundations and Applications.
http://www.ecmda-fa.org/

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09


--------------000600030706050706080009
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
Look into the oAW source code. In the org.openarchitectureware.workflow
you'll find LaunchDelegate implementations that do what you need.
There's also code there that helps you understand how to call them. I
used something like the following:<br>
<br>
<blockquote>
<pre>ILaunchConfigurationType configType =
DebugPlugin.getDefault()
.getLaunchManager()
.getLaunchConfigurationType(
IWfLaunchConfigurationConstants.WORKFLOW_LAUNCH_CONFIGURATIO N_TYPE_ID);
ILaunchConfigurationWorkingCopy launchConfig =
configType.newInstance(null, "generate.oaw");
launchConfig.setAttribute(
IWfLaunchConfigurationConstants.ATTR_OAW_WORKFLOW_FILE,
workflowFile.getFullPath().toString());
launchConfig.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
project.getName());

/*
* Wait for build jobs here. For some reason, whenever I am not
* debugging this code, DebugUITools run into a NullPointerException
* when trying to do the waiting themselves
*
* This workaround code was copied from WorkflowLaunchDelegate.launch()
*/
Job[] autoBuildJobs;
Job[] manBuildJobs;
do {
autoBuildJobs = Job.getJobManager().find(
ResourcesPlugin.FAMILY_AUTO_BUILD);
manBuildJobs = Job.getJobManager().find(
ResourcesPlugin.FAMILY_MANUAL_BUILD);
} while (autoBuildJobs.length &gt; 0 || manBuildJobs.length &gt; 0);

DebugUITools.launch(launchConfig, "run");
</pre>
</blockquote>
Notice, that this will trigger the workflow in a separate launch; that
is in a separate Job. I have still to figure out how to wait till its
done.<br>
<br>
Regards,<br>
<br>
Steffen<br>
<br>
Karl Philipp wrote:
<blockquote
cite="mid:ab5cc0f38aa7b88c28e8af6e13016798$1@www.eclipse.org"
type="cite">I would like to integrate an available RunAs task (called
"oaw workflow", BTW) in a wizard I currently implementing, that is the
call of this task shall have the same effect to the eclipse project as
the task would have manually launched by a user.
<br>
<br>
In this context:
<br>
<br>
1. Can I identify how the "RunAS Oaw workflow" entry is attached
<br>
Re: Launching a "RunAs" Task from a Wizard [message #588252 is a reply to message #21851] Wed, 14 January 2009 15:24 Go to previous message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000600030706050706080009
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

Look into the oAW source code. In the org.openarchitectureware.workflow
you'll find LaunchDelegate implementations that do what you need.
There's also code there that helps you understand how to call them. I
used something like the following:

ILaunchConfigurationType configType =
DebugPlugin.getDefault()
.getLaunchManager()
.getLaunchConfigurationType(
IWfLaunchConfigurationConstants.WORKFLOW_LAUNCH_CONFIGURATIO N_TYPE_ID);
ILaunchConfigurationWorkingCopy launchConfig =
configType.newInstance(null, "generate.oaw");
launchConfig.setAttribute(
IWfLaunchConfigurationConstants.ATTR_OAW_WORKFLOW_FILE,
workflowFile.getFullPath().toString());
launchConfig.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
project.getName());

/*
* Wait for build jobs here. For some reason, whenever I am not
* debugging this code, DebugUITools run into a NullPointerException
* when trying to do the waiting themselves
*
* This workaround code was copied from WorkflowLaunchDelegate.launch()
*/
Job[] autoBuildJobs;
Job[] manBuildJobs;
do {
autoBuildJobs = Job.getJobManager().find(
ResourcesPlugin.FAMILY_AUTO_BUILD);
manBuildJobs = Job.getJobManager().find(
ResourcesPlugin.FAMILY_MANUAL_BUILD);
} while (autoBuildJobs.length > 0 || manBuildJobs.length > 0);

DebugUITools.launch(launchConfig, "run");


Notice, that this will trigger the workflow in a separate launch; that
is in a separate Job. I have still to figure out how to wait till its done.

Regards,

Steffen

Karl Philipp wrote:
> I would like to integrate an available RunAs task (called "oaw
> workflow", BTW) in a wizard I currently implementing, that is the call
> of this task shall have the same effect to the eclipse project as the
> task would have manually launched by a user.
>
> In this context:
>
> 1. Can I identify how the "RunAS Oaw workflow" entry is attached
> to the underlying code (oaw plugin)?
> That is, I need the method call that is represented by "RunAS Oaw
> workflow".
> I guess that the menu item "RunAs" is an extension point.
>
> 2. ...
>
> Thanks in advance for your support
>
>

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
Phone +44 (01524) 510354
WWW http://www.steffen-zschaler.de/

--
Consider submitting to ECMDA-FA 2009, the 5th European Conference on
Model-Driven Architecture Foundations and Applications.
http://www.ecmda-fa.org/

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09


--------------000600030706050706080009
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
Look into the oAW source code. In the org.openarchitectureware.workflow
you'll find LaunchDelegate implementations that do what you need.
There's also code there that helps you understand how to call them. I
used something like the following:<br>
<br>
<blockquote>
<pre>ILaunchConfigurationType configType =
DebugPlugin.getDefault()
.getLaunchManager()
.getLaunchConfigurationType(
IWfLaunchConfigurationConstants.WORKFLOW_LAUNCH_CONFIGURATIO N_TYPE_ID);
ILaunchConfigurationWorkingCopy launchConfig =
configType.newInstance(null, "generate.oaw");
launchConfig.setAttribute(
IWfLaunchConfigurationConstants.ATTR_OAW_WORKFLOW_FILE,
workflowFile.getFullPath().toString());
launchConfig.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
project.getName());

/*
* Wait for build jobs here. For some reason, whenever I am not
* debugging this code, DebugUITools run into a NullPointerException
* when trying to do the waiting themselves
*
* This workaround code was copied from WorkflowLaunchDelegate.launch()
*/
Job[] autoBuildJobs;
Job[] manBuildJobs;
do {
autoBuildJobs = Job.getJobManager().find(
ResourcesPlugin.FAMILY_AUTO_BUILD);
manBuildJobs = Job.getJobManager().find(
ResourcesPlugin.FAMILY_MANUAL_BUILD);
} while (autoBuildJobs.length &gt; 0 || manBuildJobs.length &gt; 0);

DebugUITools.launch(launchConfig, "run");
</pre>
</blockquote>
Notice, that this will trigger the workflow in a separate launch; that
is in a separate Job. I have still to figure out how to wait till its
done.<br>
<br>
Regards,<br>
<br>
Steffen<br>
<br>
Karl Philipp wrote:
<blockquote
cite="mid:ab5cc0f38aa7b88c28e8af6e13016798$1@www.eclipse.org"
type="cite">I would like to integrate an available RunAs task (called
"oaw workflow", BTW) in a wizard I currently implementing, that is the
call of this task shall have the same effect to the eclipse project as
the task would have manually launched by a user.
<br>
<br>
In this context:
<br>
<br>
1. Can I identify how the "RunAS Oaw workflow" entry is attached
<br>
Previous Topic:How to exclude some plugins from a headless build?
Next Topic:Exported RCP application no longer starts
Goto Forum:
  


Current Time: Wed Apr 24 23:48:36 GMT 2024

Powered by FUDForum. Page generated in 0.03517 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top