import org.camunda.bpm.application.PreUndeploy;
import org.camunda.bpm.application.ProcessApplicationInfo;
import org.camunda.bpm.engine.ProcessEngine;
+import org.camunda.bpm.engine.RepositoryService;
+import org.camunda.bpm.engine.repository.Deployment;
import org.camunda.bpm.engine.repository.DeploymentBuilder;
+import org.camunda.bpm.engine.repository.ProcessDefinition;
import org.onap.logging.filter.spring.MDCTaskDecorator;
import org.onap.so.bpmn.common.DefaultToShortClassNameBeanNameGenerator;
import org.onap.so.db.catalog.beans.Workflow;
@Value("${mso.async.queue-capacity}")
private int queueCapacity;
+ @Value("${mso.bpmn-history-ttl:14}")
+ private Integer bpmnHistoryTtl;
+
private static final String LOGS_DIR = "logs_dir";
private static final String BPMN_SUFFIX = ".bpmn";
private static final String SDC_SOURCE = "sdc";
@PostConstruct
public void postConstruct() {
try {
- DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService().createDeployment();
+ RepositoryService repositoryService = processEngine.getRepositoryService();
+ DeploymentBuilder deploymentBuilder = repositoryService.createDeployment();
deployCustomWorkflows(deploymentBuilder);
+ setBpmnTTL(repositoryService, bpmnHistoryTtl);
} catch (Exception e) {
logger.warn("Unable to invoke deploymentBuilder ", e);
}
logger.warn("Unable to deploy custom workflows ", e);
}
}
+
+ private void setBpmnTTL(RepositoryService repositoryService, Integer ttl) {
+ List<Deployment> deployments = repositoryService.createDeploymentQuery().list();
+ for (Deployment deployment : deployments) {
+ List<ProcessDefinition> processDefinitions =
+ repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).list();
+ for (ProcessDefinition processDefinition : processDefinitions) {
+ if (!ttl.equals(processDefinition.getHistoryTimeToLive())) {
+ logger.info("Setting ttl {} for processdefinition {}", ttl, processDefinition.getName());
+ repositoryService.updateProcessDefinitionHistoryTimeToLive(processDefinition.getId(), ttl);
+ }
+ }
+ }
+ }
}
- vfModules attached to a vnf instance (create, delete)
- vnfs attached to a service instance (create, delete)
- orchestrationRequests (get)
+- CNF healthCheck
links:
- :ref:`delete_vnf`
- :ref:`get_orchestration_request_by_id`
- :ref:`get_orchestration_request_all`
-
+- :ref:`healthCheck`
.. _create_service_instance:
+-------------------------+------------------+-------------------------------------------------+
|percentProgress |String |percentage of progress |
+-------------------------+------------------+-------------------------------------------------+
+
+.. _healthCheck:
+
+CNF healthCheck
+++++++++++++++++
+
++--------------------+---------------------------------------------------------------------------------------------------------------+
+|Interface Definition|Description |
++====================+===============================================================================================================+
+|URI |/onap/so/infra/serviceInstantiation/v7/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/healthcheck |
++--------------------+---------------------------------------------------------------------------------------------------------------+
+|Operation Type |POST |
++--------------------+---------------------------------------------------------------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+---------------------------------------------------------------------------------------------------------------+
+
+Request Headers:
+
++-------------------+---------+-----------------------------------------------------------------------------------------+
+|Header Name |Required |Description |
++===================+=========+=========================================================================================+
+|Authorization |Y |Base64 encoded username:password |
++-------------------+---------+-----------------------------------------------------------------------------------------+
+
+Request Body:
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestDetails Object
+
++---------------------+-------------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=====================+=========================+=================================================+
+|modelInfo |modelInfo Object |Content of modelInfo object. |
++---------------------+-------------------------+-------------------------------------------------+
+|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. |
++---------------------+-------------------------+-------------------------------------------------+
+|requestInfo |requestInfo Object |Content of requestInfo object. |
++---------------------+-------------------------+-------------------------------------------------+
+|relatedInstanceList |List |Content of relatedInstanceList. |
++---------------------+-------------------------+-------------------------------------------------+
+
+ModelInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|ModelType |String |Type of model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelInvariantId |String |The Model Invariant Id. |
++-------------------------+------------------+-------------------------------------------------+
+|ModelNameVersionId |String |The modelname Version Id |
++-------------------------+------------------+-------------------------------------------------+
+|ModelName |String |Name of the Model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelVersion |String |Version of the model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelCustomization Name |String |The Model Customization name |
++-------------------------+------------------+-------------------------------------------------+
+
+CloudConfiguration Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
++-------------------------+------------------+-------------------------------------------------+
+|tenantId |String |Name of the Subscriber |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|InstanceName |String |The instance Name |
++-------------------------+------------------+-------------------------------------------------+
+|Source |String |source of the request |
++-------------------------+------------------+-------------------------------------------------+
+|SuppressRollback |Boolean |SuppressRollback |
++-------------------------+------------------+-------------------------------------------------+
+
+relatedInstance List
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|relatedInstance |Object |relatedInstance Object |
++-------------------------+------------------+-------------------------------------------------+
+
+relatedInstance List
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|instanceId |String |instanceId |
++-------------------------+------------------+-------------------------------------------------+
+|modelInfo |Object |Content of modelInfo object. |
++-------------------------+------------------+-------------------------------------------------+
+|instanceName |String |Name of the instance |
++-------------------------+------------------+-------------------------------------------------+
\ No newline at end of file