Package org.eclipse.emf.mwe.core.lib
Class AbstractWorkflowComponent
java.lang.Object
org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent
- All Implemented Interfaces:
WorkflowComponent
,WorkflowComponentWithID
,IWorkflowComponent
- Direct Known Subclasses:
AbstractWorkflowAdvice
,AbstractWorkflowComponent2
,FileCopy
,WorkflowComponentWithModelSlot
public abstract class AbstractWorkflowComponent
extends Object
implements WorkflowComponentWithID, IWorkflowComponent
Base class useful for implementing custom WorkflowComponents.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkRequiredConfigProperty
(String configPropertyName, Object configPropertyValue, Issues issues) Utility method that can be used in methodcheckConfiguration
to check required properties.protected Mwe2Bridge
Returns the component's name.Returns the containing component if there is one.getId()
Returns the ID of the component.Returns the location in the source file that invokes the current component.Returns the log message,final void
invoke
(WorkflowContext ctx, ProgressMonitor monitor, Issues issues) Invokes the component.void
invoke
(IWorkflowContext ctx) protected abstract void
invokeInternal
(WorkflowContext ctx, ProgressMonitor monitor, Issues issues) Internal method for component execution.void
void
void
setContainer
(CompositeComponent container) Sets the containing component.void
Sets the ID of the workflow component.void
setLocation
(Location location) Sets the location in the source file that invokes the current component.void
setSkipOnErrors
(boolean skipOnErrors) Sets if the current component should be skipped if previous components caused errors.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.emf.mwe.core.WorkflowComponent
checkConfiguration
-
Constructor Details
-
AbstractWorkflowComponent
public AbstractWorkflowComponent()
-
-
Method Details
-
checkRequiredConfigProperty
public void checkRequiredConfigProperty(String configPropertyName, Object configPropertyValue, Issues issues) Utility method that can be used in methodcheckConfiguration
to check required properties. IfconfigPropertyValue
isnull
or a blank string then this method will add an error issue.- Parameters:
configPropertyName
- Name of the checked config property.configPropertyValue
- The config property value.issues
- The Issues instance.
-
getComponentName
Returns the component's name. Overridable by custom components.- Specified by:
getComponentName
in interfaceWorkflowComponent
- Returns:
- simple class name by default
- Since:
- 4.3.1
-
getContainer
Description copied from interface:WorkflowComponent
Returns the containing component if there is one.- Specified by:
getContainer
in interfaceWorkflowComponent
- Returns:
- The containing component if any
-
getId
Description copied from interface:WorkflowComponentWithID
Returns the ID of the component.- Specified by:
getId
in interfaceWorkflowComponentWithID
- Returns:
- the component ID
- See Also:
-
getLocation
Description copied from interface:WorkflowComponent
Returns the location in the source file that invokes the current component.- Specified by:
getLocation
in interfaceWorkflowComponent
- Returns:
- the location
- See Also:
-
getLogMessage
Description copied from interface:WorkflowComponentWithID
Returns the log message,- Specified by:
getLogMessage
in interfaceWorkflowComponentWithID
- Returns:
- the log message
- See Also:
-
invoke
Description copied from interface:WorkflowComponent
Invokes the component.- Specified by:
invoke
in interfaceWorkflowComponent
- Parameters:
ctx
- current workflow contextmonitor
- implementors should provide some feedback about the progress using this monitor- See Also:
-
setContainer
Description copied from interface:WorkflowComponent
Sets the containing component.- Specified by:
setContainer
in interfaceWorkflowComponent
- Parameters:
container
- the containing component- See Also:
-
setId
Description copied from interface:WorkflowComponentWithID
Sets the ID of the workflow component.- Specified by:
setId
in interfaceWorkflowComponentWithID
- Parameters:
id
- the ID- See Also:
-
setLocation
Description copied from interface:WorkflowComponent
Sets the location in the source file that invokes the current component.- Specified by:
setLocation
in interfaceWorkflowComponent
- Parameters:
location
- the location- See Also:
-
setSkipOnErrors
public void setSkipOnErrors(boolean skipOnErrors) Sets if the current component should be skipped if previous components caused errors.- Parameters:
skipOnErrors
- iftrue
, the current component is skipped if errors have occurred, iffalse
, the component is not skipped.
-
invokeInternal
Internal method for component execution.- Parameters:
ctx
- the workflow contextmonitor
- the progress monitorissues
- container of execution issues
-
getBridge
-
preInvoke
public void preInvoke()- Specified by:
preInvoke
in interfaceIWorkflowComponent
-
invoke
- Specified by:
invoke
in interfaceIWorkflowComponent
-
postInvoke
public void postInvoke()- Specified by:
postInvoke
in interfaceIWorkflowComponent
-