Class FormDefinitionDeploymentHelper
- java.lang.Object
-
- com.flowable.form.engine.impl.deployer.FormDefinitionDeploymentHelper
-
public class FormDefinitionDeploymentHelper extends Object
Methods for working with deployments. Much of the actual work ofFormDefinitionDeployer
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 Summary
Constructors Constructor Description FormDefinitionDeploymentHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyDeploymentValuesToForms(FormDeploymentEntity deployment, List<FormDefinitionEntity> formDefinitions)
Updates all the form entities to match the deployment's values for tenant, engine version, and deployment id.FormDefinitionEntity
getMostRecentVersionOfForm(FormDefinitionEntity formDefinition)
Gets the most recent persisted form that matches this one for tenant and key.FormDefinitionEntity
getPersistedInstanceOfFormDefinition(FormDefinitionEntity formDefinition)
Gets the persisted version of the already-deployed form.void
setResourceNamesOnFormDefinitions(ParsedDeployment parsedDeployment)
Updates all the form entities to have the correct resource names.void
verifyFormsDoNotShareKeys(Collection<FormDefinitionEntity> forms)
Verifies that no two forms share the same key, to prevent database unique index violation.
-
-
-
Method Detail
-
verifyFormsDoNotShareKeys
public void verifyFormsDoNotShareKeys(Collection<FormDefinitionEntity> forms)
Verifies that no two forms share the same key, to prevent database unique index violation.- Throws:
FlowableException
- if any two forms have the same key
-
copyDeploymentValuesToForms
public void copyDeploymentValuesToForms(FormDeploymentEntity deployment, List<FormDefinitionEntity> formDefinitions)
Updates all the form entities to match the deployment's values for tenant, engine version, and deployment id.
-
setResourceNamesOnFormDefinitions
public void setResourceNamesOnFormDefinitions(ParsedDeployment parsedDeployment)
Updates all the form entities to have the correct resource names.
-
getMostRecentVersionOfForm
public FormDefinitionEntity getMostRecentVersionOfForm(FormDefinitionEntity formDefinition)
Gets the most recent persisted form 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 form entity.
-
getPersistedInstanceOfFormDefinition
public FormDefinitionEntity getPersistedInstanceOfFormDefinition(FormDefinitionEntity formDefinition)
Gets the persisted version of the already-deployed form. Note that this is different fromgetMostRecentVersionOfForm(com.flowable.form.engine.impl.persistence.entity.FormDefinitionEntity)
as it looks specifically for a form that is already persisted and attached to a particular deployment, rather than the latest version across all deployments.
-
-