在MobileFirst Platform Adapters中定义全局变量

时间:2022-04-21 22:09:24

Suppose I have a MobileFirst Adapter implementation like this;

假设我有像这样的MobileFirst Adapter实现;

var count = 0;
function doStuff() {

}

Is the count value the same throughout the MobileFirst server (and other client apps)? Or are they maintained per client (i.e safe to use)?

整个MobileFirst服务器(和其他客户端应用程序)的计数值是否相同?或者他们是否按客户维护(即安全使用)?

1 个解决方案

#1


Variables defined in an adapter are not available in/shareable with other adapters.

适配器中定义的变量在其他适配器中不可用/可共享。

If you'd like to share this variable, what you can do is send the data to another adapter via an action called "adapter mashup". This is explained in the following tutorial: Advanced adapter usage and mashup. This is not ideal for all cases, so make sure it fits yours.

如果您想共享此变量,您可以做的是通过名为“adapter mashup”的操作将数据发送到另一个适配器。以下教程将对此进行说明:高级适配器使用和mashup。这并非适用于所有情况,因此请确保它适合您的情况。

#1


Variables defined in an adapter are not available in/shareable with other adapters.

适配器中定义的变量在其他适配器中不可用/可共享。

If you'd like to share this variable, what you can do is send the data to another adapter via an action called "adapter mashup". This is explained in the following tutorial: Advanced adapter usage and mashup. This is not ideal for all cases, so make sure it fits yours.

如果您想共享此变量,您可以做的是通过名为“adapter mashup”的操作将数据发送到另一个适配器。以下教程将对此进行说明:高级适配器使用和mashup。这并非适用于所有情况,因此请确保它适合您的情况。