com.flexive.shared.interfaces
Interface StepEngine

All Known Subinterfaces:
StepEngineLocal

public interface StepEngine

The StepEngine class represents a step instance within a workflow

Author:
Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at), Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Method Summary
 long createStep(Step step)
          Creates a step in a workflow.
 java.util.List<StepPermission> loadAllStepsForUser(long userId)
          Returns all steps that a user has some kind of access to, combined with the the permissions for the user on the step.
 void removeStep(long stepId)
          Removes a step defined by its unique id.
 void removeSteps(long workflowId)
          Removes all steps within a workflow.
 void updateStep(long stepId, long aclId, int position)
          Updates a step specified by its unique id.
 

Method Detail

createStep

long createStep(Step step)
                throws FxApplicationException
Creates a step in a workflow.

The caller must be within ROLE_WORKFLOWMANAGEMENT.
No Exception is thrown if the step already exists within the workflow.
If a unique target step is needed and not defined it will be created using the provided aclId.

Parameters:
step - the step to be created
Returns:
the unique id of the new step
Throws:
FxApplicationException - TODO
FxCreateException - if the creation of the step failed
FxNoAccessException - if the caller lacks the permissions to create the step

loadAllStepsForUser

java.util.List<StepPermission> loadAllStepsForUser(long userId)
                                                   throws FxApplicationException
Returns all steps that a user has some kind of access to, combined with the the permissions for the user on the step.

The function does not check id the specified user exists, it will return an empty result for non existing entries.
Only GLOBAL_SUPERVISOR may call this function for all users, other users may only query themselfs.

Parameters:
userId - the user to get the steps for
Returns:
a array holding all Steps with its ACLs for the user
Throws:
FxApplicationException - TODO
FxLoadException - if the load failed
FxNoAccessException - if the calling user may not load the requested steps

removeSteps

void removeSteps(long workflowId)
                 throws FxApplicationException
Removes all steps within a workflow.

The caller has to be within ROLE_WORKFLOWMANAGEMENT.

Parameters:
workflowId - the workflow id
Throws:
FxApplicationException - TODO
FxNoAccessException - if the caller lacks the permissions to remove the steps
FxNotFoundException - if the workflow does not exist
FxRemoveException - if the remove failed

removeStep

void removeStep(long stepId)
                throws FxApplicationException
Removes a step defined by its unique id.

The caller has to be within ROLE_WORKFLOWMANAGEMENT.
The function does not throw a Exception if the step does not exist.

Parameters:
stepId - the unique step id
Throws:
FxApplicationException - TODO
FxNoAccessException - if the caller lacks the permissions to remove the steps
FxRemoveException - if the remove failed
FxEntryInUseException - if the step is needed by another step as unique target can connot be removed

updateStep

void updateStep(long stepId,
                long aclId,
                int position)
                throws FxApplicationException
Updates a step specified by its unique id.

The caller must be within ROLE_WORKFLOWMANAGEMENT.

Parameters:
stepId - the step to update
aclId - the ACL of the step
position - the new position (1-based)
Throws:
FxApplicationException - TODO
FxUpdateException - if the update of the step failed
FxNoAccessException - if the caller lacks the permissions to create the step
FxNotFoundException - if the step does not exist
Since:
3.1