Package lumis.portal.interactiveprocess
Class Process
- java.lang.Object
-
- lumis.portal.interactiveprocess.Process
-
- All Implemented Interfaces:
java.io.Serializable
,IProcess
public class Process extends java.lang.Object implements java.io.Serializable, IProcess
A portal interactive process.- Since:
- 7.1.0
- Version:
- $Revision$ $Date$
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IStepOutcome
executeNextStep()
Executes the next step of this process and returns the outcome.java.util.Date
getCreationDate()
Returns the creationDate.java.lang.String
getId()
Returns the identifier of this process.java.lang.Integer
getLastExecutedStep()
Returns the last executed step.java.util.Date
getLastExecutedStepDate()
Returns the lastExecutedStepDate.IStep
getNextStep()
Returns the next step to be executed.java.lang.String
getOwner()
Returns the owner of this process.java.lang.String
getOwnerUser()
Returns the owner user identifier of this process.IProcessCallbackHandler
getProcessCallbackHandler()
Converts the Process Callback Handler from bytes to object and returns it.ProcessState
getState()
Returns the process state.java.util.List<IStep>
getSteps()
Returns an unmodifiable list of the steps.java.lang.String
getTitle()
Returns the title of this process.IStepOutcome
ignoreNextStep()
Ignores the next step of this process.void
stop()
Stops the process.boolean
tryToExecuteUntilTheEnd()
Tries to execute the process until the end.
-
-
-
Method Detail
-
executeNextStep
public IStepOutcome executeNextStep() throws PortalException
Description copied from interface:IProcess
Executes the next step of this process and returns the outcome. If the next step is the last one and the outcome isStepOutcomeStatus.SUCCESS
this process (and all of it's steps) will be removed.
This method creates and uses its own transaction.
If the next step is the last one and this process has acallback handler
, theprocess completed callback
will be invoked.- Specified by:
executeNextStep
in interfaceIProcess
- Returns:
- the outcome of the next step.
- Throws:
ProcessNotOwnedException
- if the process has been taken by other user.PortalException
- if other error occur.
-
ignoreNextStep
public IStepOutcome ignoreNextStep() throws PortalException
Description copied from interface:IProcess
Ignores the next step of this process. If the next step is the last one this process (and all of it's steps) will be removed.
This method creates and uses its own transaction.
If the next step is the last one and this process has acallback handler
, theprocess completed callback
will be invoked.- Specified by:
ignoreNextStep
in interfaceIProcess
- Throws:
MandatoryStepIgnoredException
- if the next step is a mandatory one.ProcessNotOwnedException
- if the process has been taken by other user.PortalException
- if other error occur.
-
tryToExecuteUntilTheEnd
public boolean tryToExecuteUntilTheEnd() throws PortalException, java.lang.InterruptedException
Description copied from interface:IProcess
Tries to execute the process until the end. If an error occur an exception is raised.
This method execute each step in a separate transaction.
If this process has acallback handler
, theprocess completed callback
will be invoked.- Specified by:
tryToExecuteUntilTheEnd
in interfaceIProcess
- Returns:
- Whether the process has ended or not. If the process hasn't ended, it means that some error has occurred.
- Throws:
PortalException
java.lang.InterruptedException
-
getLastExecutedStepDate
public java.util.Date getLastExecutedStepDate()
Returns the lastExecutedStepDate.- Returns:
- the lastExecutedStepDate
- Since:
- 7.1.0
-
getCreationDate
public java.util.Date getCreationDate()
Returns the creationDate.- Returns:
- the creationDate
- Since:
- 7.1.0
-
getTitle
public java.lang.String getTitle()
Description copied from interface:IProcess
Returns the title of this process.
-
getId
public java.lang.String getId()
Returns the identifier of this process.
-
getNextStep
public IStep getNextStep()
Returns the next step to be executed. If there isn't any other step to be executed,null
will be returned.- Returns:
- the next step to be executed.
- Since:
- 7.1.0
-
getOwnerUser
public java.lang.String getOwnerUser()
Description copied from interface:IProcess
Returns the owner user identifier of this process.- Specified by:
getOwnerUser
in interfaceIProcess
- Returns:
- the owner user identifier of this process.
-
getOwner
public java.lang.String getOwner()
Description copied from interface:IProcess
Returns the owner of this process.
-
getSteps
public java.util.List<IStep> getSteps()
Description copied from interface:IProcess
Returns an unmodifiable list of the steps.
-
getState
public ProcessState getState()
Description copied from interface:IProcess
Returns the process state.
-
getLastExecutedStep
public java.lang.Integer getLastExecutedStep() throws PortalException
Description copied from interface:IProcess
Returns the last executed step.- Specified by:
getLastExecutedStep
in interfaceIProcess
- Returns:
- the last executed step
- Throws:
PortalException
-
stop
public void stop() throws PortalException
Description copied from interface:IProcess
Stops the process. The process will stop running and it will be removed. Then, if this process has acallback handler
, theprocess stopped callback
will be invoked.It is possible that this process can not be stopped with proper cleanup and inconsistent states may happen. Do not use it unless you know what you are doing.
- Specified by:
stop
in interfaceIProcess
- Throws:
ProcessNotOwnedException
- if the process has been taken by other user.PortalException
- if other error occur.
-
getProcessCallbackHandler
public IProcessCallbackHandler getProcessCallbackHandler() throws PortalException
Converts the Process Callback Handler from bytes to object and returns it.- Returns:
- Process Callback Handler object.
- Throws:
PortalException
- if any error occurs during the process.- Since:
- 7.1.0
-
-