Class BTDataCollectionCheckGlobalExpressions
java.lang.Object
overit.geocall.bl.BusinessTask<CheckerEvent<DataCollectionCheckGlobalExpressionsInput>>
overit.geocallapp.utilities.core.bl.common.check.checker.task.AbstractCheckerBusinessTask<DataCollectionCheckGlobalExpressionsInput>
overit.geocallapp.wfm.core.bl.datacollection.globalexpressions.task.BTDataCollectionCheckGlobalExpressions
- All Implemented Interfaces:
Serializable,Tool
@Event(DataCollectionCheckGlobalExpressionsEvent.class)
public class BTDataCollectionCheckGlobalExpressions
extends AbstractCheckerBusinessTask<DataCollectionCheckGlobalExpressionsInput>
Business task in order to check the global expressions defined inside
When the
DataCollectionTemplate. When the
DataCollectionCheckGlobalExpressionsEvent is launched
the BT notices the call and checks the global expressions basing on the event's input. Visibility:
- node expressions that belong to the same current user's operation center
- Since:
- 22.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<CheckIssue> checkExpressionsSyntax(DataCollectionGlobalExpression globalExpression, Boolean evaluateGlobalExpression, DataCollectionNodeExpressionsEvaluator expressionsEvaluator) Checks the expression syntax.protected List<CheckIssue> checkNotExistingReferences(DataCollectionGlobalExpression globalExpression, Set<DataCollectionNodeExpressionsToken> tokens, Set<DataCollectionNodeExpressionsToken> availableTokens) Checks if there are not existing references.protected List<CheckIssue> computeCheckIssues(DataCollectionCheckGlobalExpressionsInput input, PoolKit poolKit) Computes check issues.protected Set<DataCollectionNodeExpressionsToken> getAvailableTokens(TreeModel<DataCollectionNode> treeModel, DataCollectionNodeExpressionsEvaluator expressionsEvaluator) Returns the available tokens.getClassProperties(Class<? extends DataCollectionNodeExpressionsGrammarKeyword> grammarKeywordClass) Returns the class properties.protected DataCollectionNodeExpressionsEvaluatorgetExpressionsEvaluator(TreeModel<DataCollectionNode> treeModel, Boolean evaluateGlobalExpressions, DataCollectionSheetInstance sheetInstance, PoolKit poolKit) Returns the expressions evaluator.protected Set<DataCollectionNodeExpressionsToken> getReferencedTokens(String globalExpression) Returns the referenced tokens.protected static Stream<DataCollectionNodeExpressionsToken> getTokenStream(String keywordName, Class<? extends DataCollectionNodeExpressionsGrammarKeyword> grammarKeywordClass) Returns the token stream.Methods inherited from class overit.geocallapp.utilities.core.bl.common.check.checker.task.AbstractCheckerBusinessTask
addCheckIssuesToCheckResult, body, initCheckResultMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTDataCollectionCheckGlobalExpressions
public BTDataCollectionCheckGlobalExpressions()
-
-
Method Details
-
computeCheckIssues
protected List<CheckIssue> computeCheckIssues(DataCollectionCheckGlobalExpressionsInput input, PoolKit poolKit) throws DAException, DAValidateException Computes check issues.- Specified by:
computeCheckIssuesin classAbstractCheckerBusinessTask<DataCollectionCheckGlobalExpressionsInput>- Parameters:
input- theDataCollectionCheckGlobalExpressionsInputpoolKit- thePoolKit- Returns:
- a list of check issue elements of type CheckIssue
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getExpressionsEvaluator
protected DataCollectionNodeExpressionsEvaluator getExpressionsEvaluator(TreeModel<DataCollectionNode> treeModel, Boolean evaluateGlobalExpressions, DataCollectionSheetInstance sheetInstance, PoolKit poolKit) Returns the expressions evaluator.- Parameters:
treeModel- theTreeModelevaluateGlobalExpressions- true if the result of the expression must be evaluated, false otherwisesheetInstance- theDataCollectionSheetInstance, only used forDataCollectionNodeExpressionsSheetEvaluatorpoolKit- thePoolKit- Returns:
- the expressions evaluator
-
getAvailableTokens
protected Set<DataCollectionNodeExpressionsToken> getAvailableTokens(TreeModel<DataCollectionNode> treeModel, DataCollectionNodeExpressionsEvaluator expressionsEvaluator) Returns the available tokens.- Parameters:
treeModel- theTreeModelexpressionsEvaluator- theDataCollectionNodeExpressionsEvaluator- Returns:
- the available tokens
-
getTokenStream
protected static Stream<DataCollectionNodeExpressionsToken> getTokenStream(String keywordName, Class<? extends DataCollectionNodeExpressionsGrammarKeyword> grammarKeywordClass) Returns the token stream.- Parameters:
keywordName- the keyword namegrammarKeywordClass- the grammar keyword class- Returns:
- the token stream
-
getClassProperties
protected static List<String> getClassProperties(Class<? extends DataCollectionNodeExpressionsGrammarKeyword> grammarKeywordClass) Returns the class properties.- Parameters:
grammarKeywordClass- theClass<? extends DataCollectionNodeExpressionsGrammarKeyword>- Returns:
- a list of string elements of type String
-
getReferencedTokens
Returns the referenced tokens.- Parameters:
globalExpression- the global expression- Returns:
- the referenced tokens
-
checkNotExistingReferences
protected List<CheckIssue> checkNotExistingReferences(DataCollectionGlobalExpression globalExpression, Set<DataCollectionNodeExpressionsToken> tokens, Set<DataCollectionNodeExpressionsToken> availableTokens) Checks if there are not existing references.- Parameters:
globalExpression- theDataCollectionGlobalExpressiontokens- theSet<DataCollectionNodeExpressionsToken>availableTokens- theSet<DataCollectionNodeExpressionsToken>- Returns:
- a list of check issue elements of type CheckIssue
-
checkExpressionsSyntax
protected List<CheckIssue> checkExpressionsSyntax(DataCollectionGlobalExpression globalExpression, Boolean evaluateGlobalExpression, DataCollectionNodeExpressionsEvaluator expressionsEvaluator) Checks the expression syntax.- Parameters:
globalExpression- theDataCollectionGlobalExpressionevaluateGlobalExpression- true if the result of the expression must be evaluated, false otherwiseexpressionsEvaluator- theDataCollectionNodeExpressionsEvaluator- Returns:
- a list of check issue elements of type CheckIssue
-