cancel
Showing results for 
Search instead for 
Did you mean: 

Two different DM Custom View Plugins are mistakenly combined

MaxSte
Explorer
0 Kudos
1,330

Hello everyone,

At the moment DM is presenting us with a small challenge.

We have developed a custom view plugin that we want to use not just once in the POD, but twice. The plugin displays data that is read from the custom fields and is controlled with configuration options.

Since it is not allowed in the POD Designer to assign an app twice, we have tried to create a second deployment using various settings in order to get an almost identical second plugin into the POD. But a new name and a new namespace do not seem to be enough.

The problem now is that it is apparently not entirely clear when a plugin counts as a separate plugin.

We have tried the following and failed. DM recognizes both plugins in the POD Designer, but ultimately acts as if they were the same, although the name, the namespace, the folder structure, the deployment URL and the entry in the “Manage Service Registry” are different.

Question:
How does DM recognize a difference between the plugins?
Where is the limit, when the DM recognizes a plugin as independent?
At the moment it seems that similarly named plugins like "peggingGraph" & "peggingGraph2" are not possible.


Appendix:

POD Designer shows properties of one plugin, although the second is different.
When we try to drag and drop it in the POD, we get the standard error message "Plugin already in use".

MaxSte_3-1723794119384.png

Manage Service Registry different:

MaxSte_2-1723794038753.png

MaxSte_5-1723794205271.png

MaxSte_4-1723794168815.png

Deployed are two different services:

MaxSte_1-1723794005267.png

 

 

SAP Digital Manufacturing 
@ManoelCostaif possible, please refer to a developer, thanks

 

Accepted Solutions (1)

Accepted Solutions (1)

Kevin_Hunter
Product and Topic Expert
Product and Topic Expert

Hi MaxSte,

There are few incorrect statements in your question so let me see if I can clear them up for you. 😎 Firstly yes you are allowed to have multiple instances of the same plugin in a POD at the same time however you have to enable a configuration in your custom plugin to allow that to happen. If you go to your components.json file in the designer folder you will see there is a setting called "allowMultipleInstances" which is false by default, set this to true and you can have as many instances of the same plugin as you want.

Secondly the name of the plugin that is displayed in the POD designer doesnt come from the application namespace or from the name that you give it in the service registry, it uses the "title" inside the i18n/builder.properties file and from your screenshots and description I would guess that its the same in both your applications so the POD framework thinks its the same app.

Hope this info helps you.

Thanks

Kevin

PS if you are using my yoman generator tool to create your blank plugin in the first place you will find that one of the questions it asks is do you want to support multiple instances 😉

MaxSte
Explorer
0 Kudos

Hi Kevin, thanks for your quick reply.

Of course we use your Yoeman tool which does a great job 👍
To help future beginners I would recommend documenting the attribute somewhere to clarify what it is for. In my research I have not found anything on this topic in the official documentation. In the Developer's Guide it is used a few times in code snippets but is always “false” and is never explained further. Even though the attribute name sounds descriptive, a clarification would always help me.

You have already correctly identified the problem with the second point. The problem is that the same text is displayed in the POD Designer, but these are two completely different plugins (with different i18n/builder.properties), which should have nothing to do with each other. DM is therefore incorrectly merging the Plugins here. Our test case above was that we created two plugins with the Yoeman generator. One plugin is called “peggingGraph” and one “peggingGraphZwo”. Two plugins with different names, namespaces, builder.properties, ID's etc. Nevertheless, only one text is displayed in the POD Designer (sometimes the text from the builder.properties of the first plugin is displayed, sometimes from the second). As a result, only one plugin can be added at a time in the Designer.
=> So two different plugins that are incorrectly combined

thanks, Max

Ricardofs
Explorer
0 Kudos

Hi Kevin,

Is it possible to have the same plugin available in the POD Designer twice, so I can have a stable version of my custom plugin in one POD and a test version in another?

Thanks,
Ricardo

Kevin_Hunter
Product and Topic Expert
Product and Topic Expert
0 Kudos
Yes you can. There are two ways i can think of doing this. The first is the same as the original poster, create two independent plugins with different names , eg pluginProd & pluginDev. Or if you only want one plugin then add a switch into the configuration page then in the controller add logic into your code to execute either the production code or the dev code. I would recommend using 2 plugins otherwise when you deploy new dev code you will lose the production plugin as well until the app restarts.
Ricardofs
Explorer
0 Kudos

Hi Kevin, Thanks for your fast reply.

Can we have two plugins with the same namespace and  path because the code is the same, but with different URL since they are deployed in different cloud foundry spaces?

I tested this and can only see one plugin at a time. When both services are registered, only one shows up in the Pod Designer. If I remove the visible one, the other one becomes visible. And they have different names

Thanks, Ricardo

Answers (0)