cz.cuni.mff.procasor.procases
Class ProcaseTasks

java.lang.Object
  extended bycz.cuni.mff.procasor.procases.ProcaseTasks

public class ProcaseTasks
extends java.lang.Object

Interface for the cz.cuni.mff.procasor.procases package. Provides simple access to all of its functionality, namely use case to Pro-case transformation and UML State Machine derivation.

Author:
michal

Method Summary
static java.lang.String generateBehaviorProtocol(UseCaseModel model)
          Creates a behavior protocol for a use case model of an entity.
static java.lang.String generateIndentedProcase(UseCase useCase, java.lang.String indentation)
          Generates Pro-case for the given use case, uses the given indentation.
static java.lang.String generateProcase(UseCase useCase)
          Generates Pro-case for the given use case.
static java.lang.String generateUMLStateMachine(Entity entity, UseCase useCase)
          Creates a UML State Machine for the given use case
static java.lang.String generateUMLStateMachines(Project project, java.io.Writer writer)
          Writes UML State Machines for all use cases in the project.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generateProcase

public static java.lang.String generateProcase(UseCase useCase)
                                        throws cz.cuni.mff.procasor.procases.ProcaseDerivationException,
                                               cz.cuni.mff.procasor.procases.UseCaseUnfitException
Generates Pro-case for the given use case.

Parameters:
useCase - the use case to be transformed
Returns:
Pro-case expression for the given use case. The expression is pretty-printed.
Throws:
cz.cuni.mff.procasor.procases.ProcaseDerivationException - when the transformation fails
cz.cuni.mff.procasor.procases.UseCaseUnfitException - if the use case is invalid or its semantic information is not complete

generateIndentedProcase

public static java.lang.String generateIndentedProcase(UseCase useCase,
                                                       java.lang.String indentation)
                                                throws cz.cuni.mff.procasor.procases.ProcaseDerivationException,
                                                       cz.cuni.mff.procasor.procases.UseCaseUnfitException
Generates Pro-case for the given use case, uses the given indentation. Useful when the Pro-case expression will be placed into an indented text.

Parameters:
useCase - the use case to be transformed
indentation - every line of the Pro-case will be prefixed with this string
Returns:
Pro-case expression for the given use case. The expression is pretty-printed.
Throws:
cz.cuni.mff.procasor.procases.ProcaseDerivationException - when the transformation fails
cz.cuni.mff.procasor.procases.UseCaseUnfitException - if the use case is invalid or its semantic information is not complete

generateUMLStateMachines

public static java.lang.String generateUMLStateMachines(Project project,
                                                        java.io.Writer writer)
                                                 throws java.io.IOException
Writes UML State Machines for all use cases in the project.

Parameters:
project - Project to be transformed
writer - Writer that will be used for the output
Returns:
listing of problems encountered in the process
Throws:
java.io.IOException - if an error occures while writing the result to the output

generateUMLStateMachine

public static java.lang.String generateUMLStateMachine(Entity entity,
                                                       UseCase useCase)
                                                throws cz.cuni.mff.procasor.procases.UseCaseUnfitException
Creates a UML State Machine for the given use case

Parameters:
entity - Entity the use case belongs to
useCase - Use case that will be transformed
Returns:
The resulting UML State Machine
Throws:
cz.cuni.mff.procasor.procases.UseCaseUnfitException - if the use case is invalid or its semantic information is not complete

generateBehaviorProtocol

public static java.lang.String generateBehaviorProtocol(UseCaseModel model)
                                                 throws cz.cuni.mff.procasor.procases.UseCaseExpressionCorruptException
Creates a behavior protocol for a use case model of an entity. Uses the models use case expression and replaces use case names with their Pro-cases.

Parameters:
model - use case model that will be transformed
Returns:
The resulting behavior protocol, pretty printed
Throws:
cz.cuni.mff.procasor.procases.UseCaseExpressionCorruptException - when use case expression of the given model is invalid