Tabnine Logo
DecisionDefinitionEntity
Code IndexAdd Tabnine to your IDE (free)

How to use
DecisionDefinitionEntity
in
org.camunda.bpm.engine.impl.dmn.entity.repository

Best Java code snippets using org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionEntity (Showing top 20 results out of 315)

origin: camunda/camunda-bpm-platform

public DecisionDefinitionEntity getPreviousDefinition() {
 DecisionDefinitionEntity previousDecisionDefinition = null;
 String previousDecisionDefinitionId = getPreviousDecisionDefinitionId();
 if (previousDecisionDefinitionId != null) {
  previousDecisionDefinition = loadDecisionDefinition(previousDecisionDefinitionId);
  if (previousDecisionDefinition == null) {
   resetPreviousDecisionDefinitionId();
   previousDecisionDefinitionId = getPreviousDecisionDefinitionId();
   if (previousDecisionDefinitionId != null) {
    previousDecisionDefinition = loadDecisionDefinition(previousDecisionDefinitionId);
   }
  }
 }
 return previousDecisionDefinition;
}
origin: camunda/camunda-bpm-platform

public void checkReadDecisionDefinition(DecisionDefinitionEntity decisionDefinition) {
 if (decisionDefinition != null && !getTenantManager().isAuthenticatedTenant(decisionDefinition.getTenantId())) {
  throw LOG.exceptionCommandWithUnauthorizedTenant("get the decision definition '"+ decisionDefinition.getId() + "'");
 }
}
origin: camunda/camunda-bpm-platform

@Override
protected DmnDecisionImpl createDmnElement() {
 return new DecisionDefinitionEntity();
}
origin: camunda/camunda-bpm-platform

@Override
protected DmnDecisionImpl createFromDecision(DmnElementTransformContext context, Decision decision) {
 DecisionDefinitionEntity decisionDefinition = (DecisionDefinitionEntity) super.createFromDecision(context, decision);
 String category = context.getModelInstance().getDefinitions().getNamespace();
 decisionDefinition.setCategory(category);
 decisionDefinition.setHistoryTimeToLive(ParseUtil.parseHistoryTimeToLive(decision.getCamundaHistoryTimeToLiveString()));
 decisionDefinition.setVersionTag(decision.getVersionTag());
 return decisionDefinition;
}
origin: camunda/camunda-bpm-platform

@Override
protected List<DecisionDefinitionEntity> transformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Properties properties) {
 List<DecisionDefinitionEntity> decisions = new ArrayList<DecisionDefinitionEntity>();
 // get the decisions from the deployed drd instead of parse the DMN again
 DecisionRequirementsDefinitionEntity deployedDrd = findDeployedDrdForResource(deployment, resource.getName());
 if (deployedDrd == null) {
  throw LOG.exceptionNoDrdForResource(resource.getName());
 }
 Collection<DmnDecision> decisionsOfDrd = deployedDrd.getDecisions();
 for (DmnDecision decisionOfDrd : decisionsOfDrd) {
  DecisionDefinitionEntity decisionEntity = (DecisionDefinitionEntity) decisionOfDrd;
  if (DecisionRequirementsDefinitionDeployer.isDecisionRequirementsDefinitionPersistable(deployedDrd)) {
   decisionEntity.setDecisionRequirementsDefinitionId(deployedDrd.getId());
   decisionEntity.setDecisionRequirementsDefinitionKey(deployedDrd.getKey());
  }
  decisions.add(decisionEntity);
 }
 if (!DecisionRequirementsDefinitionDeployer.isDecisionRequirementsDefinitionPersistable(deployedDrd)) {
  deployment.removeArtifact(deployedDrd);
 }
 return decisions;
}
origin: camunda/camunda-bpm-platform

public void checkUpdateDecisionDefinition(DecisionDefinitionEntity decisionDefinition) {
 getAuthorizationManager().checkAuthorization(UPDATE, DECISION_DEFINITION, decisionDefinition.getKey());
}
origin: camunda/camunda-bpm-platform

@Test
public void getPreviousDecisionDefinitionWithTenantId() {
 testRule.deployForTenant(TENANT_ONE, DMN);
 testRule.deployForTenant(TENANT_ONE, DMN);
 testRule.deployForTenant(TENANT_ONE, DMN);
 testRule.deployForTenant(TENANT_TWO, DMN);
 testRule.deployForTenant(TENANT_TWO, DMN);
 List<DecisionDefinition> latestDefinitions = repositoryService.createDecisionDefinitionQuery()
  .latestVersion()
  .orderByTenantId()
  .asc()
  .list();
 DecisionDefinitionEntity previousDefinitionTenantOne = getPreviousDefinition((DecisionDefinitionEntity) latestDefinitions.get(0));
 DecisionDefinitionEntity previousDefinitionTenantTwo = getPreviousDefinition((DecisionDefinitionEntity) latestDefinitions.get(1));
 assertThat(previousDefinitionTenantOne.getVersion(), is(2));
 assertThat(previousDefinitionTenantOne.getTenantId(), is(TENANT_ONE));
 assertThat(previousDefinitionTenantTwo.getVersion(), is(1));
 assertThat(previousDefinitionTenantTwo.getTenantId(), is(TENANT_TWO));
}
origin: camunda/camunda-bpm-platform

@Override
public void checkUpdateDecisionDefinitionById(String decisionDefinitionId) {
 if (getTenantManager().isTenantCheckEnabled()) {
  DecisionDefinitionEntity decisionDefinition = findLatestDecisionDefinitionById(decisionDefinitionId);
  if (decisionDefinition != null && !getTenantManager().isAuthenticatedTenant(decisionDefinition.getTenantId())) {
   throw LOG.exceptionCommandWithUnauthorizedTenant("update the decision definition '"+ decisionDefinitionId + "'");
  }
 }
}
origin: camunda/camunda-bpm-platform

public String getPreviousDecisionDefinitionId() {
 ensurePreviousDecisionDefinitionIdInitialized();
 return previousDecisionDefinitionId;
}
origin: OrienteerBAP/Orienteer

@Statement
public String selectPreviousDecisionDefinitionId(OPersistenceSession session, ListQueryParameterObject parameter) {
  Map<String, String> params = (Map<String, String>) parameter.getParameter();
  String key = params.get("key");
  String tenantId = params.get("tenantId");
  String version = params.get("version");
  String query = "select distinct RES.* from " + getSchemaClass() + " where RES.key = " + key;
  query += tenantId != null ? " and tenantId = " + tenantId : " and tenantId is null";
  query += " and RES.version = (select max(version) from " + getSchemaClass() + " where key = " + key;
  query += tenantId != null ? " and tenantId = " + tenantId : " and tenantId is null";
  query += " and version < " + version + ")";
  return querySingle(session, query).getPreviousDecisionDefinitionId();
}
origin: camunda/camunda-bpm-platform

@Override
protected DmnDecisionImpl createFromDecision(DmnElementTransformContext context, Decision decision) {
 DecisionDefinitionEntity decisionDefinition = (DecisionDefinitionEntity) super.createFromDecision(context, decision);
 String category = context.getModelInstance().getDefinitions().getNamespace();
 decisionDefinition.setCategory(category);
 decisionDefinition.setHistoryTimeToLive(ParseUtil.parseHistoryTimeToLive(decision.getCamundaHistoryTimeToLiveString()));
 decisionDefinition.setVersionTag(decision.getVersionTag());
 return decisionDefinition;
}
origin: camunda/camunda-bpm-platform

@Override
protected List<DecisionDefinitionEntity> transformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Properties properties) {
 List<DecisionDefinitionEntity> decisions = new ArrayList<DecisionDefinitionEntity>();
 // get the decisions from the deployed drd instead of parse the DMN again
 DecisionRequirementsDefinitionEntity deployedDrd = findDeployedDrdForResource(deployment, resource.getName());
 if (deployedDrd == null) {
  throw LOG.exceptionNoDrdForResource(resource.getName());
 }
 Collection<DmnDecision> decisionsOfDrd = deployedDrd.getDecisions();
 for (DmnDecision decisionOfDrd : decisionsOfDrd) {
  DecisionDefinitionEntity decisionEntity = (DecisionDefinitionEntity) decisionOfDrd;
  if (DecisionRequirementsDefinitionDeployer.isDecisionRequirementsDefinitionPersistable(deployedDrd)) {
   decisionEntity.setDecisionRequirementsDefinitionId(deployedDrd.getId());
   decisionEntity.setDecisionRequirementsDefinitionKey(deployedDrd.getKey());
  }
  decisions.add(decisionEntity);
 }
 if (!DecisionRequirementsDefinitionDeployer.isDecisionRequirementsDefinitionPersistable(deployedDrd)) {
  deployment.removeArtifact(deployedDrd);
 }
 return decisions;
}
origin: camunda/camunda-bpm-platform

public void checkReadDecisionDefinition(DecisionDefinitionEntity decisionDefinition) {
 getAuthorizationManager().checkAuthorization(READ, DECISION_DEFINITION, decisionDefinition.getKey());
}
origin: org.camunda.bpm/camunda-engine

@Test
public void getPreviousDecisionDefinitionWithTenantId() {
 testRule.deployForTenant(TENANT_ONE, DMN);
 testRule.deployForTenant(TENANT_ONE, DMN);
 testRule.deployForTenant(TENANT_ONE, DMN);
 testRule.deployForTenant(TENANT_TWO, DMN);
 testRule.deployForTenant(TENANT_TWO, DMN);
 List<DecisionDefinition> latestDefinitions = repositoryService.createDecisionDefinitionQuery()
  .latestVersion()
  .orderByTenantId()
  .asc()
  .list();
 DecisionDefinitionEntity previousDefinitionTenantOne = getPreviousDefinition((DecisionDefinitionEntity) latestDefinitions.get(0));
 DecisionDefinitionEntity previousDefinitionTenantTwo = getPreviousDefinition((DecisionDefinitionEntity) latestDefinitions.get(1));
 assertThat(previousDefinitionTenantOne.getVersion(), is(2));
 assertThat(previousDefinitionTenantOne.getTenantId(), is(TENANT_ONE));
 assertThat(previousDefinitionTenantTwo.getVersion(), is(1));
 assertThat(previousDefinitionTenantTwo.getTenantId(), is(TENANT_TWO));
}
origin: camunda/camunda-bpm-platform

@Override
public void checkUpdateDecisionDefinitionById(String decisionDefinitionId) {
 if (getTenantManager().isTenantCheckEnabled()) {
  DecisionDefinitionEntity decisionDefinition = findLatestDecisionDefinitionById(decisionDefinitionId);
  if (decisionDefinition != null && !getTenantManager().isAuthenticatedTenant(decisionDefinition.getTenantId())) {
   throw LOG.exceptionCommandWithUnauthorizedTenant("update the decision definition '"+ decisionDefinitionId + "'");
  }
 }
}
origin: camunda/camunda-bpm-platform

public String getPreviousDecisionDefinitionId() {
 ensurePreviousDecisionDefinitionIdInitialized();
 return previousDecisionDefinitionId;
}
origin: camunda/camunda-bpm-platform

public DecisionDefinitionEntity getPreviousDefinition() {
 DecisionDefinitionEntity previousDecisionDefinition = null;
 String previousDecisionDefinitionId = getPreviousDecisionDefinitionId();
 if (previousDecisionDefinitionId != null) {
  previousDecisionDefinition = loadDecisionDefinition(previousDecisionDefinitionId);
  if (previousDecisionDefinition == null) {
   resetPreviousDecisionDefinitionId();
   previousDecisionDefinitionId = getPreviousDecisionDefinitionId();
   if (previousDecisionDefinitionId != null) {
    previousDecisionDefinition = loadDecisionDefinition(previousDecisionDefinitionId);
   }
  }
 }
 return previousDecisionDefinition;
}
origin: org.camunda.bpm/camunda-engine

@Override
protected DmnDecisionImpl createFromDecision(DmnElementTransformContext context, Decision decision) {
 DecisionDefinitionEntity decisionDefinition = (DecisionDefinitionEntity) super.createFromDecision(context, decision);
 String category = context.getModelInstance().getDefinitions().getNamespace();
 decisionDefinition.setCategory(category);
 decisionDefinition.setHistoryTimeToLive(ParseUtil.parseHistoryTimeToLive(decision.getCamundaHistoryTimeToLiveString()));
 decisionDefinition.setVersionTag(decision.getVersionTag());
 return decisionDefinition;
}
origin: camunda/camunda-bpm-platform

public void checkReadDecisionDefinition(DecisionDefinitionEntity decisionDefinition) {
 if (decisionDefinition != null && !getTenantManager().isAuthenticatedTenant(decisionDefinition.getTenantId())) {
  throw LOG.exceptionCommandWithUnauthorizedTenant("get the decision definition '"+ decisionDefinition.getId() + "'");
 }
}
origin: org.camunda.bpm/camunda-engine

@Override
protected List<DecisionDefinitionEntity> transformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Properties properties) {
 List<DecisionDefinitionEntity> decisions = new ArrayList<DecisionDefinitionEntity>();
 // get the decisions from the deployed drd instead of parse the DMN again
 DecisionRequirementsDefinitionEntity deployedDrd = findDeployedDrdForResource(deployment, resource.getName());
 if (deployedDrd == null) {
  throw LOG.exceptionNoDrdForResource(resource.getName());
 }
 Collection<DmnDecision> decisionsOfDrd = deployedDrd.getDecisions();
 for (DmnDecision decisionOfDrd : decisionsOfDrd) {
  DecisionDefinitionEntity decisionEntity = (DecisionDefinitionEntity) decisionOfDrd;
  if (DecisionRequirementsDefinitionDeployer.isDecisionRequirementsDefinitionPersistable(deployedDrd)) {
   decisionEntity.setDecisionRequirementsDefinitionId(deployedDrd.getId());
   decisionEntity.setDecisionRequirementsDefinitionKey(deployedDrd.getKey());
  }
  decisions.add(decisionEntity);
 }
 if (!DecisionRequirementsDefinitionDeployer.isDecisionRequirementsDefinitionPersistable(deployedDrd)) {
  deployment.removeArtifact(deployedDrd);
 }
 return decisions;
}
org.camunda.bpm.engine.impl.dmn.entity.repositoryDecisionDefinitionEntity

Most used methods

  • getPreviousDecisionDefinitionId
  • getTenantId
  • <init>
  • ensurePreviousDecisionDefinitionIdInitialized
  • getId
  • getKey
  • loadDecisionDefinition
    Returns the cached version if exists; does not update the entity from the database in that case
  • resetPreviousDecisionDefinitionId
  • setCategory
  • setDecisionRequirementsDefinitionId
  • setDecisionRequirementsDefinitionKey
  • setHistoryTimeToLive
  • setDecisionRequirementsDefinitionKey,
  • setHistoryTimeToLive,
  • setVersionTag,
  • getVersion

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • String (java.lang)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JTextField (javax.swing)
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now