+ /**
+ * Create a policy instance from the current loop element model.
+ *
+ * @return A Policy object.
+ * @throws IOException in case of failure when creating an operational policy
+ */
+ public Policy createPolicyInstance(Loop loop, ToscaConverterWithDictionarySupport toscaConverter)
+ throws IOException {
+ if (LoopElementModel.MICRO_SERVICE_TYPE.equals(this.getLoopElementType())) {
+ return new MicroServicePolicy(loop, loop.getModelService(), this, toscaConverter);
+ }
+ else if (LoopElementModel.OPERATIONAL_POLICY_TYPE.equals(this.getLoopElementType())) {
+ return new OperationalPolicy(loop, loop.getModelService(), this, toscaConverter);
+ } else {
+ return null;
+ }
+ }
+