public abstract class CommandExecutingJob<EventAtom> extends Job<EventAtom>
Modifier and Type | Class and Description |
---|---|
class |
CommandExecutingJob.JobExecutionHelper
Helper class for constructing the job execution from individual commands.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMMAND_EXECUTING_JOB_HELPER |
static java.lang.String |
EDITING_DOMAIN |
Constructor and Description |
---|
CommandExecutingJob(ActivationState enablingState,
EventAtomEditingDomainProvider<EventAtom> provider)
Create a new job that supports execution through commands by finding the editing
domain using the given provider and giving a
CommandExecutingJob.JobExecutionHelper for providing
the execution with a way to easily create commands and execute them. |
Modifier and Type | Method and Description |
---|---|
protected void |
execute(Activation<? extends EventAtom> activation,
Context context)
Executes the action on the activation using the supplied context.
|
protected abstract void |
executeCommands(CommandExecutingJob.JobExecutionHelper executionHelper)
Use the passed editing domain to instantiate and append commands to the supplied
CommandExecutingJob.JobExecutionHelper . |
protected org.eclipse.emf.edit.domain.EditingDomain |
findEditingDomain(Activation<? extends EventAtom> activation,
Context context)
This method is used to find a target that can be used for getting the
EditingDomain . |
protected void |
handleError(Activation<? extends EventAtom> activation,
java.lang.Exception exception,
Context context)
Called if the
Job.execute(org.eclipse.viatra.transformation.evm.api.Activation<? extends EventAtom>, org.eclipse.viatra.transformation.evm.api.Context) method has thrown an exception to allow jobs to handle their own errors. |
protected abstract void |
handleExecutableCommandError(CommandExecutingJob.JobExecutionHelper executionHelper,
java.lang.Exception exception)
This method will be called if any error happens during the execution.
|
getActivationState
public static final java.lang.String COMMAND_EXECUTING_JOB_HELPER
public static final java.lang.String EDITING_DOMAIN
public CommandExecutingJob(ActivationState enablingState, EventAtomEditingDomainProvider<EventAtom> provider)
CommandExecutingJob.JobExecutionHelper
for providing
the execution with a way to easily create commands and execute them.enablingState
- provider
- protected void execute(Activation<? extends EventAtom> activation, Context context)
Job
protected void handleError(Activation<? extends EventAtom> activation, java.lang.Exception exception, Context context)
Job
Job.execute(org.eclipse.viatra.transformation.evm.api.Activation<? extends EventAtom>, org.eclipse.viatra.transformation.evm.api.Context)
method has thrown an exception to allow jobs to handle their own errors.handleError
in class Job<EventAtom>
protected abstract void executeCommands(CommandExecutingJob.JobExecutionHelper executionHelper)
CommandExecutingJob.JobExecutionHelper
.executionHelper
- protected abstract void handleExecutableCommandError(CommandExecutingJob.JobExecutionHelper executionHelper, java.lang.Exception exception)
executionHelper
- exception
- protected org.eclipse.emf.edit.domain.EditingDomain findEditingDomain(Activation<? extends EventAtom> activation, Context context)
EditingDomain
.
It tries to retrieve the domain from the context, otherwise it tries to find an EObject parameter in
the event atom of the activation.activation
- context
-