+ /**
+ * Constructor with tosca converter.
+ *
+ * @param loop The loop instance
+ * @param service The service model object
+ * @param loopElementModel The loop element model from which this microservice instance is created
+ * @param toscaConverter The tosca converter that will used to convert the tosca policy model
+ */
+ public MicroServicePolicy(Loop loop, Service service, LoopElementModel loopElementModel,
+ ToscaConverterWithDictionarySupport toscaConverter) {
+ this(Policy.generatePolicyName("MICROSERVICE", service.getName(), service.getVersion(),
+ RandomStringUtils.randomAlphanumeric(3), RandomStringUtils.randomAlphanumeric(3)),
+ loopElementModel.getPolicyModels().first(), false,
+ toscaConverter.convertToscaToJsonSchemaObject(
+ loopElementModel.getPolicyModels().first().getPolicyModelTosca(),
+ loopElementModel.getPolicyModels().first().getPolicyModelType()),
+ loopElementModel, null, null);
+ }
+