use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class UserTaskAdminServiceImplTest method cleanup.
@After
public void cleanup() {
cleanupSingletonSessionId();
if (processInstanceId != null) {
try {
// let's abort process instance to leave the system in clear state
processService.abortProcessInstance(processInstanceId);
ProcessInstance pi = processService.getProcessInstance(processInstanceId);
Assertions.assertThat(pi).isNull();
} catch (ProcessInstanceNotFoundException e) {
// ignore it as it might already be completed/aborted
}
}
if (units != null && !units.isEmpty()) {
for (DeploymentUnit unit : units) {
try {
deploymentService.undeploy(unit);
} catch (Exception e) {
// do nothing in case of some failed tests to avoid next test to fail as well
}
}
units.clear();
}
close();
CountDownListenerFactory.clear();
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class DeploymentStore method getDeactivatedDeploymentUnits.
public Collection<DeploymentUnit> getDeactivatedDeploymentUnits() {
List<DeploymentUnit> activeDeployments = new ArrayList<DeploymentUnit>();
Map<String, Object> params = new HashMap<String, Object>();
List<Integer> states = new ArrayList<Integer>();
states.add(STATE_DEACTIVATED);
params.put("state", states);
List<DeploymentStoreEntry> deployments = commandService.execute(new QueryNameCommand<List<DeploymentStoreEntry>>("getDeploymentUnitsByState", params));
for (DeploymentStoreEntry entry : deployments) {
String sync = getEntryAttributes(entry.getAttributes()).get("sync");
// add to the deployable list only sync flag is set to true or does not exists (default)
if (sync == null || sync.equalsIgnoreCase("true")) {
DeploymentUnit unit = (DeploymentUnit) xstream.fromXML(entry.getDeploymentUnit());
((KModuleDeploymentUnit) unit).setActive(false);
activeDeployments.add(unit);
}
}
return activeDeployments;
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class DeploymentSynchronizer method onDeactivate.
@Override
public void onDeactivate(DeploymentEvent event) {
if (event != null && event.getDeployedUnit() != null) {
DeploymentUnit unit = event.getDeployedUnit().getDeploymentUnit();
deploymentStore.deactivateDeploymentUnit(unit);
logger.info("Deployment unit {} deactivated successfully", unit.getIdentifier());
}
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class DeploymentSynchronizer method onActivate.
@Override
public void onActivate(DeploymentEvent event) {
if (event != null && event.getDeployedUnit() != null) {
DeploymentUnit unit = event.getDeployedUnit().getDeploymentUnit();
deploymentStore.activateDeploymentUnit(unit);
logger.info("Deployment unit {} activated successfully", unit.getIdentifier());
}
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class DeploymentSynchronizer method onUnDeploy.
@Override
public void onUnDeploy(DeploymentEvent event) {
if (event != null && event.getDeployedUnit() != null) {
DeploymentUnit unit = event.getDeployedUnit().getDeploymentUnit();
deploymentStore.disableDeploymentUnit(unit);
entries.remove(unit.getIdentifier());
logger.info("Deployment unit {} removed successfully", unit.getIdentifier());
}
}
Aggregations