congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Path (java.nio.file)
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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