Class BookParentChildWhatIfSubmitter
- java.lang.Object
-
- com.activeviam.risk.ref.parentchild.submitter.BookParentChildWhatIfSubmitter
-
public class BookParentChildWhatIfSubmitter extends Object
The BookParentChildWhatIfSubmitter service is the main way for the Parent Child Service to interact with and submit what-if submissions to the what-if engine. This submitter currently interacts with the WhatIf restful service. The primary reason for this is to combine the pipeline for what-if submissions. Later on when the WhatIf framework will provide a more generic service then we would call on that instead of the WhatIf restful service.
-
-
Field Summary
Fields Modifier and Type Field Description protected com.qfs.store.IDatastore
datastore
protected org.springframework.core.env.Environment
env
static String
PUSH_NEW_BRANCH_PARENTCHILD_BOOK_TASK
static String
PUSH_NEW_BRANCH_WITH_CHANGES_PARENTCHILD_BOOK_TASK
static String
PUSH_PARENTCHILD_BOOK_DEFINITION
static String
PUSH_PARENTCHILD_BOOK_TASK
protected com.activeviam.tools.whatif.core.WhatIfDatastoreSubmissionManager
submissionManager
protected com.activeviam.tools.whatif.core.WhatIfWorkflow
whatIfWorkflow
-
Constructor Summary
Constructors Constructor Description BookParentChildWhatIfSubmitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<ParentChildWhatIfDefinition.ParentChildKey,ParentChildNode<?>>
generatetParentChildMap(List<ParentChildNode<?>> parentChildTree)
void
submitBranchFromTree(String definition, List<ParentChildNode<?>> flatParentChildTree, String user, String branch, LocalDate asOfDate)
This method provides a way to persist new branches created through the parent child service.void
submitTreeUpdateForBranch(String submission, List<ParentChildNode<?>> flatParentChildTree, String user, String branch, LocalDate asOfDate)
This method provides a way to persist data changes on a currently existing branch through the parent child service.
-
-
-
Field Detail
-
PUSH_NEW_BRANCH_PARENTCHILD_BOOK_TASK
public static final String PUSH_NEW_BRANCH_PARENTCHILD_BOOK_TASK
- See Also:
- Constant Field Values
-
PUSH_NEW_BRANCH_WITH_CHANGES_PARENTCHILD_BOOK_TASK
public static final String PUSH_NEW_BRANCH_WITH_CHANGES_PARENTCHILD_BOOK_TASK
- See Also:
- Constant Field Values
-
PUSH_PARENTCHILD_BOOK_TASK
public static final String PUSH_PARENTCHILD_BOOK_TASK
- See Also:
- Constant Field Values
-
PUSH_PARENTCHILD_BOOK_DEFINITION
public static final String PUSH_PARENTCHILD_BOOK_DEFINITION
- See Also:
- Constant Field Values
-
datastore
@Autowired protected com.qfs.store.IDatastore datastore
-
whatIfWorkflow
@Autowired protected com.activeviam.tools.whatif.core.WhatIfWorkflow whatIfWorkflow
-
env
@Autowired protected org.springframework.core.env.Environment env
-
submissionManager
@Autowired protected com.activeviam.tools.whatif.core.WhatIfDatastoreSubmissionManager submissionManager
-
-
Method Detail
-
submitBranchFromTree
public void submitBranchFromTree(String definition, List<ParentChildNode<?>> flatParentChildTree, String user, String branch, LocalDate asOfDate) throws ParentChildWhatIfException
This method provides a way to persist new branches created through the parent child service. Branches created through the parent child service may also persist new data by providing a non-empty flattened tree. The parentChildTree provided is assumed to ready "as is" and needs no additional checks to verify if a user can modify data within the tree. The only thing stopping the provided tree from being fully persisted if its corresponding nodes don't exist in the datastore. In that instance we don't provide a way for users to create new data and the node will be ignored. This method interacts with the what-if rest service as the what-if rest service provides a good pipeline for doing security checks and necessary manager operations to keep track of tasks submitted. This method throws a ParentChildWhatIfException if a user is forbidden from performing a what-if submission or if there was an internal error with the what-if pipeline. If a null or empty definition name is provided then the default task name: "New Branch" will be used if the map provided is empty or if not then "New Branch" will be used instead. Submission will be named: "New Branch Reorginization" if changes- Parameters:
definition
- The optional definition name. If null will use the defaults.flatParentChildTree
- The tree meant to be persisted. Assumed "as is" and no verification will be performed.user
- The user to perform this action for. Can be forbidden from doing the action.branch
- The branch to persist the tree on.asOfDate
- The asOfDate to persist the tree on.- Throws:
ParentChildWhatIfException
- Indicates there was an error with persisting on the what-if engine. Can be an internal error or authorization issue.ParentChildWhatIfException
- An exception thrown from the WhatIf engine. Can be a user authorization or internally thrown exception.
-
submitTreeUpdateForBranch
public void submitTreeUpdateForBranch(String submission, List<ParentChildNode<?>> flatParentChildTree, String user, String branch, LocalDate asOfDate) throws ParentChildWhatIfException
This method provides a way to persist data changes on a currently existing branch through the parent child service. The parentChildTree provided is assumed to ready "as is" and needs no additional checks to verify if a user can modify data within the tree. The only thing stopping the provided tree from being fully persisted if its corresponding nodes don't exist in the datastore. In that instance we don't provide a way for users to create new data and the node will be ignored. This method interacts with the what-if rest service as the what-if rest service provides a good pipeline for doing security checks and necessary manager operations to keep track of tasks submitted. This method throws a ParentChildWhatIfException if a user is forbidden from performing a what-if submission or if there was an internal error with the what-if pipeline. If a null or empty definition name is provided then the default task name: "Simple Reorganization" will be used instead. Submission will be named: "Hierarchy Reorganization".- Parameters:
submission
- The optional submission name. If null will use the defaults.flatParentChildTree
- The tree ment to be persisted. Assumed "as is" and no verification will be performed.user
- The user to perform this action for. Can be forbidden from doing the action.branch
- The branch to persist the tree on.asOfDate
- The asOfDate to persist the tree on.- Throws:
ParentChildWhatIfException
- Indicates there was an error with persisting on the what-if engine. Can be an internal error or authorization issue.ParentChildWhatIfException
- An exception thrown from the WhatIf engine. Can be a user authorization or internally thrown exception.
-
generatetParentChildMap
protected Map<ParentChildWhatIfDefinition.ParentChildKey,ParentChildNode<?>> generatetParentChildMap(List<ParentChildNode<?>> parentChildTree)
-
-