Class DmnDeploymentHelper

java.lang.Object
org.flowable.dmn.engine.impl.deployer.DmnDeploymentHelper

public class DmnDeploymentHelper extends Object
Methods for working with deployments. Much of the actual work of DmnDeployer is done by orchestrating the different pieces of work this class does; by having them here, we allow other deployers to make use of them.
  • Constructor Details

    • DmnDeploymentHelper

      public DmnDeploymentHelper()
  • Method Details

    • verifyDecisionTablesDoNotShareKeys

      public void verifyDecisionTablesDoNotShareKeys(Collection<DecisionEntity> decisionTables)
      Verifies that no two decisions share the same key, to prevent database unique index violation.
      Throws:
      FlowableException - if any two decisions have the same key
    • copyDeploymentValuesToDecisions

      public void copyDeploymentValuesToDecisions(DmnDeploymentEntity deployment, List<DecisionEntity> decisions)
      Updates all the decision entities to match the deployment's values for tenant, engine version, and deployment id.
    • setResourceNamesOnDecisions

      public void setResourceNamesOnDecisions(ParsedDeployment parsedDeployment)
      Updates all the decision entities to have the correct resource names.
    • getMostRecentVersionOfDecision

      public DecisionEntity getMostRecentVersionOfDecision(DecisionEntity decision)
      Gets the most recent persisted decision that matches this one for tenant and key. If none is found, returns null. This method assumes that the tenant and key are properly set on the decision entity.
    • getPersistedInstanceOfDecision

      public DecisionEntity getPersistedInstanceOfDecision(DecisionEntity decision)
      Gets the persisted version of the already-deployed decision. Note that this is different from getMostRecentVersionOfDecision(org.flowable.dmn.engine.impl.persistence.entity.DecisionEntity) as it looks specifically for a decision that is already persisted and attached to a particular deployment, rather than the latest version across all deployments.
    • createAndPersistNewDiagramsIfNeeded

      public void createAndPersistNewDiagramsIfNeeded(ParsedDeployment parsedDeployment, DecisionRequirementsDiagramHelper decisionRequirementsDiagramHelper)
      Creates new diagrams for decisions if the deployment is new, the decision in question supports it, and the engine is configured to make new diagrams. When this method creates a new diagram, it also persists it via the ResourceEntityManager and adds it to the resources of the deployment.
    • setDecisionDefinitionDiagramNames

      protected void setDecisionDefinitionDiagramNames(ParsedDeployment parsedDeployment)
      Updates all the decision entities to have the correct diagram resource name. Must be called after createAndPersistNewDiagramsAsNeeded to ensure that any newly-created diagrams already have their resources attached to the deployment.