Class QuestionImpl
- java.lang.Object
-
- org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity<E,I>
-
- org.silverpeas.core.persistence.datasource.model.jpa.BasicJpaEntity<QuestionImpl,UniqueIntegerIdentifier>
-
- org.silverpeas.core.workflow.engine.instance.QuestionImpl
-
- All Implemented Interfaces:
Serializable
,IdentifiableEntity
,Question
@Entity public class QuestionImpl extends BasicJpaEntity<QuestionImpl,UniqueIntegerIdentifier> implements Question
A Question object represents a question asked for the instance- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
QuestionImpl()
QuestionImpl(ProcessInstance processInstance, String questionText, String fromState, String targetState, User fromUser, User toUser)
a Question object is build from - its content, - the source state name, - the target state name - and the instance where the question was asked
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
answer(String responseText)
Answer this questionboolean
equals(Object o)
State
getFromState()
Get the state where the question was askedString
getFromStateName()
Get the state where the question was askedUser
getFromUser()
Get the user who asked the questionString
getFromUserId()
Get the id of user who asked the questionProcessInstance
getProcessInstance()
Get the process instance where the question was askedDate
getQuestionDate()
Get the date when question was askedString
getQuestionText()
Get the question contentDate
getResponseDate()
Get the date when question was askedString
getResponseText()
Get the response contentState
getTargetState()
Get the destination state for the questionString
getTargetStateName()
Get the destination state for the questionUser
getToUser()
Get the user who received the questionString
getToUserId()
Get the id of user who received the questionint
hashCode()
boolean
hasResponse()
Is a response was sent to this questionboolean
isRelevant()
Has this question been answered and taken in account, if yes, so it's not relevant anymore (return false)void
setFromStateName(String fromState)
Set the state where the question was askedvoid
setFromUserId(String fromUserId)
Set the id of user who asked the questionvoid
setProcessInstance(ProcessInstance processInstance)
Set the process instance where the question was askedvoid
setQuestionDate(Date questionDate)
Set the date when question was askedvoid
setQuestionText(String questionText)
Set the question contentvoid
setRelevant(boolean relevant)
Set the relevant status of this questionvoid
setResponseDate(Date responseDate)
Set the date when question was askedvoid
setResponseText(String responseText)
Set the response contentvoid
setTargetStateName(String targetState)
Set the destination state for the questionvoid
setToUserId(String toUserId)
Set the id of user who received the question-
Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.BasicJpaEntity
performBeforePersist, performBeforeRemove, performBeforeUpdate
-
Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity
getId, getNativeId, isPersisted, setId
-
-
-
-
Method Detail
-
getProcessInstance
public ProcessInstance getProcessInstance()
Get the process instance where the question was asked- Specified by:
getProcessInstance
in interfaceQuestion
-
setProcessInstance
public void setProcessInstance(ProcessInstance processInstance)
Set the process instance where the question was asked
-
getFromStateName
public String getFromStateName()
Get the state where the question was asked
-
getFromState
public State getFromState()
Get the state where the question was asked- Specified by:
getFromState
in interfaceQuestion
-
setFromStateName
public void setFromStateName(String fromState)
Set the state where the question was asked
-
getTargetStateName
public String getTargetStateName()
Get the destination state for the question
-
getTargetState
public State getTargetState()
Get the destination state for the question- Specified by:
getTargetState
in interfaceQuestion
-
setTargetStateName
public void setTargetStateName(String targetState)
Set the destination state for the question
-
getQuestionText
public String getQuestionText()
Get the question content- Specified by:
getQuestionText
in interfaceQuestion
-
setQuestionText
public void setQuestionText(String questionText)
Set the question content
-
getResponseText
public String getResponseText()
Get the response content- Specified by:
getResponseText
in interfaceQuestion
-
setResponseText
public void setResponseText(String responseText)
Set the response content
-
answer
public void answer(String responseText)
Answer this question
-
setFromUserId
public void setFromUserId(String fromUserId)
Set the id of user who asked the question
-
getFromUserId
public String getFromUserId()
Get the id of user who asked the question
-
getFromUser
public User getFromUser() throws WorkflowException
Get the user who asked the question- Specified by:
getFromUser
in interfaceQuestion
- Throws:
WorkflowException
-
setToUserId
public void setToUserId(String toUserId)
Set the id of user who received the question
-
getToUserId
public String getToUserId()
Get the id of user who received the question
-
getToUser
public User getToUser() throws WorkflowException
Get the user who received the question- Specified by:
getToUser
in interfaceQuestion
- Throws:
WorkflowException
-
getQuestionDate
public Date getQuestionDate()
Get the date when question was asked- Specified by:
getQuestionDate
in interfaceQuestion
-
setQuestionDate
public void setQuestionDate(Date questionDate)
Set the date when question was asked
-
getResponseDate
public Date getResponseDate()
Get the date when question was asked- Specified by:
getResponseDate
in interfaceQuestion
-
setResponseDate
public void setResponseDate(Date responseDate)
Set the date when question was asked
-
hasResponse
public boolean hasResponse()
Is a response was sent to this question- Specified by:
hasResponse
in interfaceQuestion
-
isRelevant
public boolean isRelevant()
Has this question been answered and taken in account, if yes, so it's not relevant anymore (return false)- Specified by:
isRelevant
in interfaceQuestion
-
setRelevant
public void setRelevant(boolean relevant)
Set the relevant status of this question
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractJpaEntity<QuestionImpl,UniqueIntegerIdentifier>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractJpaEntity<QuestionImpl,UniqueIntegerIdentifier>
-
-