Sync with latest code 36/308736/2 accepted/tizen/unified/20240404.021353
authorSejun Park <sejun79.park@samsung.com>
Fri, 29 Mar 2024 08:59:45 +0000 (17:59 +0900)
committerSejun Park <sejun79.park@samsung.com>
Fri, 29 Mar 2024 09:01:57 +0000 (18:01 +0900)
Sync Commit ID : a34b5458a5eff86f01ffd0d96248b545cbb21269

Change-Id: I5c49e9f75aa3cb89377ef6ff633c0d2bb322f27e

25 files changed:
capi/mmi-workflow.h
setup_linux_build.sh
src/common/mmi-communication-message.h
src/mmi-cli/mmi-cli-node-tester.cpp
src/mmi-cli/mmi-cli.cpp
src/mmi-manager/mmi-ipc-ecore.cpp
src/mmi-manager/mmi-ipc-tidl.cpp
src/mmi-manager/mmi-ipc-tidl.h
src/mmi-manager/mmi-node-prototype-manager.cpp
src/mmi-manager/mmi-plugin-module-proxy.cpp
src/mmi-manager/mmi-workflow-instance-manager.cpp
src/mmi/meson.build
src/mmi/mmi-attribute.cpp
src/mmi/mmi-ipc-ecore.cpp
src/mmi/mmi-ipc-tidl.cpp
src/mmi/mmi-ipc-tidl.h
src/mmi/mmi-plugin-storage.cpp
src/mmi/mmi-primitive-value.cpp
src/mmi/mmi-workflow-instance.cpp
src/mmi/mmi-workflow-script-common.h [new file with mode: 0755]
src/mmi/mmi-workflow-script-generator.h [new file with mode: 0755]
src/mmi/mmi-workflow-script-parser.h
src/mmi/mmi-workflow-script.cpp
tests/mmi-manager/plugin-module-registry/mmi-plugin-module-registry-tests.cpp
tidl/mmi.tidl

index dfcf666bd31ed94c736b6e9e11e0c294e7748254..d4e97d158e297edb6740fc43eb739ef769843530 100644 (file)
@@ -154,6 +154,9 @@ int mmi_workflow_create_from_script(const char *script, mmi_workflow_h *workflow
 /* Create a workflow prototype from a script file */
 int mmi_workflow_create_from_script_file(const char *script_path, mmi_workflow_h *workflow);
 
+/* Generate a workflow script from a workflow prototype */
+int mmi_workflow_generate_script(mmi_workflow_h workflow, const char **script);
+
 /* Destroy a workflow prototype */
 int mmi_workflow_destroy(mmi_workflow_h workflow);
 
@@ -170,11 +173,8 @@ typedef void (*mmi_workflow_output_cb)(mmi_workflow_instance_h instance, const c
 /* Instantiate a workflow from a workflow prototype */
 int mmi_standard_workflow_instance_create(mmi_standard_workflow_type_e type, mmi_workflow_instance_h *instance);
 
-/* Instantiate a workflow from a workflow script */
-int mmi_custom_workflow_instance_create_from_script(const char *workflow_script, mmi_workflow_instance_h *instance);
-
-/* Instantiate a workflow from a workflow script file */
-int mmi_custom_workflow_instance_create_from_script_file(const char *workflow_script_path, mmi_workflow_instance_h *instance);
+/* Instantiate a workflow from a custom workflow prototype */
+int mmi_custom_workflow_instance_create(mmi_workflow_h workflow, mmi_workflow_instance_h *instance);
 
 /* Destroy a workflow instance */
 int mmi_workflow_instance_destroy(mmi_workflow_instance_h instance);
index bf10d425aaaa207e3c2ab7e8f60df8bc6277aa45..b65bd0c2aa4e0f8890580117961568743d249f08 100755 (executable)
@@ -2,4 +2,5 @@ meson setup --prefix=/usr/local/mmi \
        --bindir /usr/local/mmi/bin \
        --libdir /usr/local/mmi/lib \
        --datadir /usr/local/mmi/share \
+       --buildtype debug \
        ./linux_build
index 12b83df293c19614b1d68b0054e615877e88655a..4f434c25989196055974b47169e1a0999d78fb0a 100644 (file)
@@ -64,7 +64,6 @@ struct ClientMessage : public Message {
 struct ClientMessageWorkflowInstanceCreate : public ClientMessage {
     ClientMessageWorkflowInstanceCreate() : ClientMessage{CLIENT_MESSAGE_TYPE::WORKFLOW_INSTANCE_CREATE} {}
     mmi_standard_workflow_type_e workflow_type{MMI_STANDARD_WORKFLOW_NONE};
-    bool script_from_file{false};
     std::string script_info;
     int local_workflow_instance_id{0};
     void *user_data{nullptr};
index c0d659e35df9603217b4630d0bb0cd2355bd937f..b6cabd3dfe3f563ad04c973bcecd2052c73eb672 100644 (file)
@@ -461,7 +461,7 @@ void Program::port_instance_output_handler(mmi_port_instance_h port, mmi_data_h
 }
 
 void Program::load_module(std::string path) {
-    mmi_plugin_module_event_handler_info_s module_event_handler_info{nullptr, };
+    mmi_plugin_module_event_handler_info_s module_event_handler_info{{nullptr}, {nullptr}};
     module_event_handler_info.port_instance_output_handler = port_instance_output_handler;
 
     mmi_plugin_storage_set_plugin_module_event_handler(module_event_handler_info, nullptr);
index 80b5a14edd212cdc10feaa7c78bd61e6e9ff4983..c0b137f79d7e7e49970eb33e1b2cad4d66379229 100644 (file)
@@ -66,7 +66,9 @@ MATCH.CANDIDATES as COMMANDS
 MATCH.COMMAND as MATCHED_CANDIDATE
         )";
         std::cout << "Creating instance of script : " << std::endl << script << std::endl;
-        mmi_custom_workflow_instance_create_from_script(script.c_str(), &m_instance);
+        mmi_workflow_h workflow;
+        mmi_workflow_create_from_script(script.c_str(), &workflow);
+        mmi_custom_workflow_instance_create(workflow, &m_instance);
         mmi_workflow_instance_set_output_callback(m_instance, "COMMAND",
             [](mmi_workflow_instance_h instance, const char *name, mmi_data_h data, void *user_data) {
                 std::cout << "OUTPUT data received : " << std::string(name ? name : "") << std::endl;
@@ -80,7 +82,7 @@ MATCH.COMMAND as MATCHED_CANDIDATE
         }
 
         std::cout << "Creating instance of script with path : " << path << std::endl;
-        mmi_custom_workflow_instance_create_from_script_file(path.c_str(), &m_instance);
+        //mmi_custom_workflow_instance_create_from_script_file(path.c_str(), &m_instance);
         mmi_workflow_instance_set_output_callback(m_instance, "COMMAND",
             [](mmi_workflow_instance_h instance, const char *name, mmi_data_h data, void *user_data) {
                 std::cout << "OUTPUT data received : " << std::string(name ? name : "") << std::endl;
index 2119e62b94ae9be71a872a589f3a0f854404a172..90c9e990a7722754da2900168455af5f04590f4b 100644 (file)
@@ -188,7 +188,6 @@ void CommunicationChannelEcoreIPC::on_client_message(Ecore_Ipc_Client *client, v
             struct workflow_instance_create_payload {
                 int local_workflow_instance_id;
                 mmi_standard_workflow_type_e workflow_type;
-                bool script_from_file;
                 size_t script_info_size;
             } payload;
             if (data_size < sizeof(CLIENT_MESSAGE_TYPE) + sizeof(payload)) {
@@ -200,7 +199,6 @@ void CommunicationChannelEcoreIPC::on_client_message(Ecore_Ipc_Client *client, v
             message.sender = sender;
             message.local_workflow_instance_id = payload.local_workflow_instance_id;
             message.workflow_type = payload.workflow_type;
-            message.script_from_file = payload.script_from_file;
             message.script_info = std::string(
                 (const char*)((unsigned char*)(data) +
                     sizeof(CLIENT_MESSAGE_TYPE) + sizeof(payload)),
index c66ae2875cc967bab57c4be7d7ead8db242c187f..b17179d0b13546e796e7f3dc59414936ef9f6f27 100644 (file)
@@ -178,7 +178,7 @@ void CommunicationChannelTIDL::on_terminate(rpc_port_stub_mmi_context_h context,
 }
 
 int CommunicationChannelTIDL::workflow_instance_create(rpc_port_stub_mmi_context_h context,
-        int local_workflow_instance_id, int workflow_type, bool script_from_file,
+        int local_workflow_instance_id, int workflow_type,
         const char *script_info, void *user_data) {
     CommunicationChannelTIDL *channel = static_cast<CommunicationChannelTIDL*>(user_data);
 
@@ -190,7 +190,6 @@ int CommunicationChannelTIDL::workflow_instance_create(rpc_port_stub_mmi_context
     msg.sender = sender;
     msg.local_workflow_instance_id = local_workflow_instance_id;
     msg.workflow_type = static_cast<mmi_standard_workflow_type_e>(workflow_type);
-    msg.script_from_file = script_from_file;
     msg.script_info = script_info ? std::string{script_info} : std::string();
 
     return notify_message_received(channel, static_cast<Message*>(&msg));
index c569c6b3a0d81efc5df70dcc313b206384867679..04757931dc7d2999f00acb60091f32e404ad596a 100644 (file)
@@ -50,7 +50,7 @@ private:
     static void on_terminate(rpc_port_stub_mmi_context_h context, void *user_data);
 
     static int workflow_instance_create(rpc_port_stub_mmi_context_h context,
-        int local_workflow_instance_id, int workflow_type, bool script_from_file, const char *script_info, void *user_data);
+        int local_workflow_instance_id, int workflow_type, const char *script_info, void *user_data);
     static int workflow_instance_destroy(rpc_port_stub_mmi_context_h context,
         int local_workflow_instance_id, void *user_data);
     static int workflow_instance_set_attribute(rpc_port_stub_mmi_context_h context,
index 0b9f01881f93308603a0c04d807a9832fc94546e..09c3bae04477aa1e1cdb1f175002195a8e29817d 100644 (file)
@@ -96,15 +96,15 @@ std::shared_ptr<NodePrototype> NodePrototypeHelper::create_node_prototype(mmi_no
             size_t name_length = 0;
             mmi_port_get_name(port, &name, &name_length);
 
-            mmi_port_type_e type;
-            mmi_port_get_type(port, &type);
+            mmi_port_type_e port_type;
+            mmi_port_get_type(port, &port_type);
 
             mmi_data_type_e data_type;
             mmi_port_get_data_type(port, &data_type);
 
             PortInfo port_info;
             port_info.name = name;
-            port_info.port_type = type;
+            port_info.port_type = port_type;
             port_info.data_type = data_type;
             prototype->add_port_info(port_info);
         }
index 36afcb67628651d3d063133731be796d34f79dc4..05c65aa91641cc0c81b105966babc233f90bad06 100644 (file)
@@ -63,7 +63,7 @@ static void switch_node_event_handler(mmi_node_instance_h node, const char *cont
 PluginModuleProxySharedLibrary::PluginModuleProxySharedLibrary(
     const mmi_plugin_module_identifier plugin_module_identifier) :
     m_plugin_module_identifier(plugin_module_identifier) {
-    mmi_plugin_module_event_handler_info_s module_event_handler_info{nullptr, };
+    mmi_plugin_module_event_handler_info_s module_event_handler_info{{nullptr}, {nullptr}};
     module_event_handler_info.port_instance_output_handler = port_instance_output_handler;
     module_event_handler_info.switch_node_event_handler = switch_node_event_handler;
 
@@ -176,10 +176,10 @@ mmi_plugin_module_workflow_list_s PluginModuleProxySharedLibrary::load_workflow_
         _D("workflow_info[%zu].node_info_count: %zu", i, workflow_info->node_info_count);
         for (size_t j = 0;j < workflow_info->node_info_count;j++) {
             mmi_workflow_node_info_s *node_info = &(workflow_info->node_infos[j]);
-            mmi_node_type_e type;
-            mmi_node_get_type(workflow_info->node_infos[j].node, &type);
+            mmi_node_type_e node_type;
+            mmi_node_get_type(workflow_info->node_infos[j].node, &node_type);
             _D("workflow_info[%zu].node_info[%zu].name: %s", i, j, node_info->name);
-            _D("workflow_info[%zu].node_info[%zu].type: %d", i, j, type);
+            _D("workflow_info[%zu].node_info[%zu].type: %d", i, j, node_type);
         }
 
         _D("workflow_info[%zu].link_info_count: %zu", i, workflow_info->link_info_count);
index 672f19eb4b76b0386798bf86e032d2fb5805f7d4..a78b94f51cee4a73188370172996aede7ee1fae3 100644 (file)
@@ -195,11 +195,7 @@ void WorkflowInstanceManager::handle_create(
 
         if (message->workflow_type == MMI_STANDARD_WORKFLOW_NONE) {
             mmi_workflow_h workflow = nullptr;
-            if (message->script_from_file) {
-                mmi_workflow_create_from_script_file(message->script_info.c_str(), &workflow);
-            } else {
-                mmi_workflow_create_from_script(message->script_info.c_str(), &workflow);
-            }
+            mmi_workflow_create_from_script(message->script_info.c_str(), &workflow);
 
             std::shared_ptr<IWorkflowPrototypeStore> prototype_store = 
                 std::make_shared<WorkflowPrototypeScriptStore>();
index 8a83424dd1c1a881b17580305c2f81554af29c27..aee102e8cd30010966f6ce2661153ecc9dc5f944 100644 (file)
@@ -48,6 +48,7 @@ mmi_include_dirs = include_directories(
        '.',
        '../common',
        '../../capi',
+       '../../external',
        mmi_extra_include_dir,
        )
 
index e230ce8961ab5689143188d85566d06124974f70..22d8176fd813af6e5847be3a4b4dc4b47c2a904f 100644 (file)
@@ -269,7 +269,7 @@ int mmi_attribute_create_string_array(const char *name, const char *strings[], s
 
     for (size_t i = 0; i < count; i++) {
         mmi_primitive_value_h element = nullptr;
-        int ret = mmi_primitive_value_create_string(strings[i], &element);
+        ret = mmi_primitive_value_create_string(strings[i], &element);
         if (MMI_ERROR_NONE != ret) {
             _E("[ERROR] Fail to allocate memory for array attribute");
             mmi_primitive_value_destroy(array);
index ca7b9e890a2e363eb2894c6e24f779ce843acef8..3bfbcf382931cc03dde366b37582ca3e2c987e23 100644 (file)
@@ -53,12 +53,10 @@ int CommunicationChannelEcoreIPC::send(Message *message) {
             struct workflow_instance_create_payload {
                 int local_workflow_instance_id;
                 mmi_standard_workflow_type_e workflow_type;
-                bool script_from_file;
                 size_t script_info_size;
             } payload;
             payload.local_workflow_instance_id = subclass->local_workflow_instance_id;
             payload.workflow_type = subclass->workflow_type;
-            payload.script_from_file = subclass->script_from_file;
             payload.script_info_size = subclass->script_info.size();
             size_t byte_size = sizeof(CLIENT_MESSAGE_TYPE) + sizeof(payload);
             byte_size += payload.script_info_size;
index 20c431cf6e958a699ef0ab2bdfedc85a83041e66..c2842269d91596189bf27d3f02123c8a609f2eb9 100644 (file)
@@ -158,7 +158,7 @@ int CommunicationChannelTIDL::send(Message *message) {
     case CLIENT_MESSAGE_TYPE::WORKFLOW_INSTANCE_CREATE: {
         auto subclass = static_cast<ClientMessageWorkflowInstanceCreate*>(message);
         workflow_instance_create(subclass->local_workflow_instance_id, subclass->workflow_type,
-            subclass->script_from_file, subclass->script_info, subclass->user_data);
+            subclass->script_info, subclass->user_data);
     }
     break;
     case CLIENT_MESSAGE_TYPE::WORKFLOW_INSTANCE_DESTROY: {
@@ -218,7 +218,7 @@ int CommunicationChannelTIDL::retry_connection(rpc_port_proxy_mmi_h h) {
 }
 
 int CommunicationChannelTIDL::workflow_instance_create(int local_workflow_instance_id,
-    mmi_standard_workflow_type_e workflow_type, bool script_from_file, std::string script_info, void *user_data) {
+    mmi_standard_workflow_type_e workflow_type, std::string script_info, void *user_data) {
     LOGI("Creating workflow instance of type (%d) for id (%d)",
          workflow_type, local_workflow_instance_id);
 
@@ -238,7 +238,7 @@ int CommunicationChannelTIDL::workflow_instance_create(int local_workflow_instan
     }
 
     int ret = rpc_port_proxy_mmi_invoke_workflow_instance_create(
-                  rpc_h, local_workflow_instance_id, workflow_type, script_from_file, script_info.c_str());
+                  rpc_h, local_workflow_instance_id, workflow_type, script_info.c_str());
     if (RPC_PORT_ERROR_NONE != ret) {
         LOGE("Failed to create workflow instance(%d)\n", ret);
         return MMI_ERROR_OPERATION_FAILED;
@@ -298,7 +298,7 @@ int CommunicationChannelTIDL::workflow_instance_set_attribute(int local_workflow
 
     if (false == is_connected()) {
         LOGE("Try to connect again");
-        int ret = retry_connection(rpc_h);
+        ret = retry_connection(rpc_h);
         if (RPC_PORT_ERROR_NONE != ret) {
             LOGE("Fail to retry connection(%d)", ret);
             return MMI_ERROR_OPERATION_FAILED;
@@ -313,7 +313,7 @@ int CommunicationChannelTIDL::workflow_instance_set_attribute(int local_workflow
     bundle_add_byte(encoded, "data", attribute_bytes, attribute_byte_size);
 
     if (encoded) {
-        int ret = rpc_port_proxy_mmi_invoke_workflow_instance_set_attribute(rpc_h, local_workflow_instance_id, encoded);
+        ret = rpc_port_proxy_mmi_invoke_workflow_instance_set_attribute(rpc_h, local_workflow_instance_id, encoded);
         bundle_free(encoded);
 
         if (RPC_PORT_ERROR_NONE != ret) {
@@ -342,7 +342,7 @@ int CommunicationChannelTIDL::workflow_instance_emit_signal(int local_workflow_i
 
     if (false == is_connected()) {
         LOGE("Try to connect again");
-        int ret = retry_connection(rpc_h);
+        ret = retry_connection(rpc_h);
         if (RPC_PORT_ERROR_NONE != ret) {
             LOGE("Fail to retry connection(%d)", ret);
             return MMI_ERROR_OPERATION_FAILED;
@@ -389,7 +389,7 @@ int CommunicationChannelTIDL::workflow_instance_emit_signal(int local_workflow_i
     }
 
     if (encoded) {
-        int ret = rpc_port_proxy_mmi_invoke_workflow_instance_emit_signal(rpc_h, local_workflow_instance_id, encoded);
+        ret = rpc_port_proxy_mmi_invoke_workflow_instance_emit_signal(rpc_h, local_workflow_instance_id, encoded);
         bundle_free(encoded);
 
         if (RPC_PORT_ERROR_NONE != ret) {
@@ -420,7 +420,7 @@ int CommunicationChannelTIDL::workflow_instance_feed_data(
 
     if (false == is_connected()) {
         LOGE("Try to connect again");
-        int ret = retry_connection(rpc_h);
+        ret = retry_connection(rpc_h);
         if (RPC_PORT_ERROR_NONE != ret) {
             LOGE("Fail to retry connection(%d)", ret);
             return MMI_ERROR_OPERATION_FAILED;
@@ -438,7 +438,7 @@ int CommunicationChannelTIDL::workflow_instance_feed_data(
     bundle_add_byte(encoded, "data", data_bytes, data_size);
 
     if (encoded) {
-        int ret = rpc_port_proxy_mmi_invoke_workflow_instance_feed_data(rpc_h,
+        ret = rpc_port_proxy_mmi_invoke_workflow_instance_feed_data(rpc_h,
             local_workflow_instance_id, node_name.c_str(), port_name.c_str(), encoded);
         bundle_free(encoded);
 
index 9d242141ab68e11e82dea5a8460293ebe2a30004..f1a061e533e29c102efad42fce5fc4e0cfa26705 100644 (file)
@@ -39,7 +39,7 @@ public:
 
 private:
     int workflow_instance_create(int local_workflow_instance_id, mmi_standard_workflow_type_e workflow_type,
-        bool script_from_file, std::string script_info, void *user_data);
+        std::string script_info, void *user_data);
     int workflow_instance_destroy(int local_workflow_instance_id);
     int workflow_instance_set_attribute(int local_workflow_instance_id, mmi_attribute_h attribute);
     int workflow_instance_emit_signal(int local_workflow_instance_id, mmi_signal_h signal);
index b9aa92f5db3171cfa0510efe3e52121021dbef45..6b1002f0ca5addd084735fa6b928fb8b976b477e 100644 (file)
@@ -62,7 +62,7 @@ mmi_node_instance_h mmi_plugin_storage_find_node_instance_by_port_instance(mmi_p
     return g_plugin_storage_impl.find_node_instance_by_port_instance(port_instance);
 }
 
-static mmi_plugin_module_event_handler_info_s g_event_handler_info{nullptr, };
+static mmi_plugin_module_event_handler_info_s g_event_handler_info{{nullptr}, {nullptr}};
 static void* g_event_handler_user_data = nullptr;
 
 void mmi_plugin_storage_set_plugin_module_event_handler(
index 645a3d1ebd4d8f28140aa7ea0ace522210ebfac7..0c2ddc9f2fa18be16ed4217d22be67a2f4ffebbe 100644 (file)
@@ -507,10 +507,10 @@ int mmi_primitive_value_from_bytes(unsigned char *bytes, size_t size, mmi_primit
 
             if (failed) {
                 /* Since we are in a while loop, value->data should also be freed */
-                size_t num_elements = value->datalen / sizeof(mmi_primitive_value_h);
+                num_elements = value->datalen / sizeof(mmi_primitive_value_h);
                 for (size_t i = 0; i < num_elements; i++) {
-                    auto element = get_element_pointer_in_array(value, i);
-                    mmi_primitive_value_destroy(*element);
+                    auto element_ = get_element_pointer_in_array(value, i);
+                    mmi_primitive_value_destroy(*element_);
                 }
                 free(value->data);
                 free(value);
index b434ebf7a002e98fcb29e71eb0b72fc3647408ac..2c97e359becd711fa3deba3c32b25a81fd1f3eb2 100644 (file)
@@ -30,6 +30,8 @@
 #include "mmi-log.h"
 #include "mmi-workflow-instance-manager.h"
 
+#include "mmi-workflow-script-generator.h"
+
 using namespace mmi;
 using namespace mmi::communication;
 
@@ -68,45 +70,9 @@ MMI_API int mmi_standard_workflow_instance_create(mmi_standard_workflow_type_e t
     return MMI_ERROR_NONE;
 }
 
-MMI_API int mmi_custom_workflow_instance_create_from_script(const char *workflow_script, mmi_workflow_instance_h *instance)
-{
-    if (nullptr == instance || nullptr == workflow_script) {
-        LOGE("[ERROR] parameter is null");
-        return MMI_ERROR_INVALID_PARAMETER;
-    }
-
-    WorkflowInstanceManager *workflow_instance_manager = g_mmi_client_manager.get_workflow_instance_manager();
-    if (nullptr == workflow_instance_manager) {
-        LOGE("[ERROR] Failed to get workflow instance manager");
-        return MMI_ERROR_OPERATION_FAILED;
-    }
-
-    WorkflowInstance *workflow_instance = workflow_instance_manager->create();
-    if (workflow_instance) {
-        *instance = static_cast<void*>(workflow_instance);
-
-        std::shared_ptr<CommunicationChannelClient> channel = g_mmi_client_manager.get_communication_channel();
-        if (channel) {
-            ClientMessageWorkflowInstanceCreate msg;
-            msg.local_workflow_instance_id =
-                workflow_instance->get_local_workflow_instance_id();
-            msg.workflow_type = MMI_STANDARD_WORKFLOW_NONE;
-            msg.script_from_file = false;
-            msg.script_info = std::string{workflow_script};
-            msg.user_data = workflow_instance;
-
-            channel->send(&msg);
-        }
-    } else {
-        return MMI_ERROR_OUT_OF_MEMORY;
-    }
-
-    return MMI_ERROR_NONE;
-}
-
-MMI_API int mmi_custom_workflow_instance_create_from_script_file(const char *workflow_script_path, mmi_workflow_instance_h *instance)
+MMI_API int mmi_custom_workflow_instance_create(mmi_workflow_h workflow, mmi_workflow_instance_h *instance)
 {
-    if (nullptr == instance || nullptr == workflow_script_path) {
+    if (nullptr == workflow || nullptr == instance) {
         LOGE("[ERROR] parameter is null");
         return MMI_ERROR_INVALID_PARAMETER;
     }
@@ -123,12 +89,12 @@ MMI_API int mmi_custom_workflow_instance_create_from_script_file(const char *wor
 
         std::shared_ptr<CommunicationChannelClient> channel = g_mmi_client_manager.get_communication_channel();
         if (channel) {
+            WorkflowScriptGenerator generator;
             ClientMessageWorkflowInstanceCreate msg;
             msg.local_workflow_instance_id =
                 workflow_instance->get_local_workflow_instance_id();
             msg.workflow_type = MMI_STANDARD_WORKFLOW_NONE;
-            msg.script_from_file = true;
-            msg.script_info = std::string{workflow_script_path};
+            msg.script_info = generator.generate(workflow);
             msg.user_data = workflow_instance;
 
             channel->send(&msg);
diff --git a/src/mmi/mmi-workflow-script-common.h b/src/mmi/mmi-workflow-script-common.h
new file mode 100755 (executable)
index 0000000..81f3e42
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *               http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+
+#ifndef __MMI_WORKFLOW_SCRIPT_COMMON_H__
+#define __MMI_WORKFLOW_SCRIPT_COMMON_H__
+
+#include <string>
+#include <vector>
+
+enum class WorkflowScriptSection {
+    NONE,
+    WORKFLOW_INFO,
+    NODE_LIST,
+    LINK_LIST,
+    ATTRIBUTE_LIST,
+    OUTPUT_LIST,
+};
+
+typedef struct {
+    WorkflowScriptSection section;
+    std::string name;
+} WorkflowScriptSectionName;
+
+struct WorkflowScriptHelper {
+    std::vector<WorkflowScriptSectionName> section_names{
+        {WorkflowScriptSection::WORKFLOW_INFO, "@workflow"},
+        {WorkflowScriptSection::NODE_LIST, "@node-list"},
+        {WorkflowScriptSection::LINK_LIST, "@link-list"},
+        {WorkflowScriptSection::ATTRIBUTE_LIST, "@attribute-list"},
+        {WorkflowScriptSection::OUTPUT_LIST, "@output-list"},
+    };
+};
+#endif /* __MMI_WORKFLOW_SCRIPT_COMMON_H__ */
\ No newline at end of file
diff --git a/src/mmi/mmi-workflow-script-generator.h b/src/mmi/mmi-workflow-script-generator.h
new file mode 100755 (executable)
index 0000000..6cdd272
--- /dev/null
@@ -0,0 +1,243 @@
+/*
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *               http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+
+#ifndef __MMI_WORKFLOW_SCRIPT_GENERATOR_H__
+#define __MMI_WORKFLOW_SCRIPT_GENERATOR_H__
+
+#include "mmi-log.h"
+#include "mmi-node-source.h"
+#include "mmi-node-processor.h"
+#include "mmi-node-logic.h"
+#include "mmi-node-controller.h"
+#include "mmi-node-action.h"
+#include "mmi-node-custom.h"
+#include "mmi-workflow-script-common.h"
+
+#include "magic_enum/magic_enum.hpp"
+
+class WorkflowScriptGenerator {
+public:
+    WorkflowScriptGenerator() {
+    }
+    virtual ~WorkflowScriptGenerator() {
+    }
+
+    std::string generate_workflow_info_section(mmi_workflow_s *workflow) {
+        std::string section_script;
+        auto found_section_name = std::find_if(
+            m_workflow_script_helper.section_names.begin(),
+            m_workflow_script_helper.section_names.end(),
+            [](WorkflowScriptSectionName section_name) { return section_name.section == WorkflowScriptSection::WORKFLOW_INFO; });
+        if (found_section_name != m_workflow_script_helper.section_names.end()) {
+            section_script += found_section_name->name + "\n";
+            /* If the workflow type is NONE, leave the name part */
+            if (workflow->type != MMI_STANDARD_WORKFLOW_NONE) {
+                section_script += "name : " + std::string(magic_enum::enum_name(workflow->type)) + "\n";
+            }
+        }
+        return section_script;
+    }
+    std::string generate_node_list_section(mmi_workflow_s *workflow) {
+        std::string section_script;
+        auto found_section_name = std::find_if(
+            m_workflow_script_helper.section_names.begin(),
+            m_workflow_script_helper.section_names.end(),
+            [](WorkflowScriptSectionName section_name) { return section_name.section == WorkflowScriptSection::NODE_LIST; });
+        if (found_section_name != m_workflow_script_helper.section_names.end()) {
+            section_script += found_section_name->name + "\n";
+            for (size_t index = 0;index < workflow->node_info_count;index++) {
+                std::string name = std::string(workflow->node_infos[index].name);
+                mmi_node_h node = workflow->node_infos[index].node;
+                mmi_node_type_e node_type;
+                mmi_node_get_type(node, &node_type);
+                switch (node_type) {
+                    case MMI_NODE_TYPE_NONE: {
+                        _E("Error : Node Type is NONE");
+                    }
+                    break;
+                    case MMI_NODE_TYPE_SOURCE: {
+                        mmi_node_source_type_e node_source_type;
+                        mmi_node_get_source_type(node, &node_source_type);
+                        auto type_name = std::string(magic_enum::enum_name(node_source_type));
+
+                        const std::string node_source_prefix = "MMI_NODE_SOURCE_TYPE_";
+                        std::string::size_type pos = type_name.find(node_source_prefix);
+                        if (pos!= std::string::npos) {
+                            type_name.erase(pos, node_source_prefix.length());
+                        }
+
+                        section_script += "[Source] " + type_name + " as " + name + "\n";
+                    }
+                    break;
+                    case MMI_NODE_TYPE_PROCESSOR: {
+                        mmi_node_processor_type_e node_process_type;
+                        mmi_node_get_processor_type(node, &node_process_type);
+                        auto type_name = std::string(magic_enum::enum_name(node_process_type));
+
+                        const std::string node_processor_prefix = "MMI_NODE_PROCESSOR_TYPE_";
+                        std::string::size_type pos = type_name.find(node_processor_prefix);
+                        if (pos!= std::string::npos) {
+                            type_name.erase(pos, node_processor_prefix.length());
+                        }
+
+                        section_script += "[Processor] " + type_name + " as " + name + "\n";
+                    }
+                    break;
+                    case MMI_NODE_TYPE_LOGIC: {
+                        mmi_node_logic_type_e node_logic_type;
+                        mmi_node_get_logic_type(node, &node_logic_type);
+                        auto type_name = std::string(magic_enum::enum_name(node_logic_type));
+
+                        const std::string node_logic_prefix = "MMI_NODE_LOGIC_TYPE_";
+                        std::string::size_type pos = type_name.find(node_logic_prefix);
+                        if (pos!= std::string::npos) {
+                            type_name.erase(pos, node_logic_prefix.length());
+                        }
+
+                        section_script += "[Logic] " + type_name + " as " + name + "\n";
+                    }
+                    break;
+                    case MMI_NODE_TYPE_CONTROLLER: {
+                        mmi_node_controller_type_e node_controller_type;
+                        mmi_node_get_controller_type(node, &node_controller_type);
+                        auto type_name = std::string(magic_enum::enum_name(node_controller_type));
+
+                        const std::string node_controller_prefix = "MMI_NODE_CONTROLLER_TYPE_";
+                        std::string::size_type pos = type_name.find(node_controller_prefix);
+                        if (pos!= std::string::npos) {
+                            type_name.erase(pos, node_controller_prefix.length());
+                        }
+
+                        section_script += "[Controller] " + type_name + " as " + name + "\n";
+                    }
+                    break;
+                    case MMI_NODE_TYPE_ACTION: {
+                        mmi_node_action_type_e node_action_type;
+                        mmi_node_get_action_type(node, &node_action_type);
+                        auto type_name = std::string(magic_enum::enum_name(node_action_type));
+
+                        const std::string node_action_prefix = "MMI_NODE_ACTION_TYPE_";
+                        std::string::size_type pos = type_name.find(node_action_prefix);
+                        if (pos!= std::string::npos) {
+                            type_name.erase(pos, node_action_prefix.length());
+                        }
+
+                        section_script += "[Action] " + type_name + " as " + name + "\n";
+                    }
+                    break;
+                    case MMI_NODE_TYPE_CUSTOM: {
+                        const char *custom_type_id = nullptr;
+                        mmi_node_get_custom_type(node, &custom_type_id);
+                        if (custom_type_id) {
+                            section_script += "[Custom] " + std::string(custom_type_id) + " as " + name + "\n";
+                        }
+                    }
+                    break;
+                }
+            }
+        }
+
+        return section_script;
+    }
+    std::string generate_link_list_section(mmi_workflow_s *workflow) {
+        std::string section_script;
+        auto found_section_name = std::find_if(
+            m_workflow_script_helper.section_names.begin(),
+            m_workflow_script_helper.section_names.end(),
+            [](WorkflowScriptSectionName section_name) { return section_name.section == WorkflowScriptSection::LINK_LIST; });
+        if (found_section_name != m_workflow_script_helper.section_names.end()) {
+            section_script += found_section_name->name + "\n";
+            for (size_t i = 0; i < workflow->link_info_count; i++) {
+                section_script +=
+                    std::string(workflow->link_infos[i].from_node_name) +
+                    "." +
+                    std::string(workflow->link_infos[i].from_port_name) +
+                    " -> " +
+                    std::string(workflow->link_infos[i].to_node_name) +
+                    "." +
+                    std::string(workflow->link_infos[i].to_port_name) +
+                    "\n";
+            }
+        }
+        return section_script;
+    }
+    std::string generate_attribute_list_section(mmi_workflow_s *workflow) {
+        std::string section_script;
+        auto found_section_name = std::find_if(
+            m_workflow_script_helper.section_names.begin(),
+            m_workflow_script_helper.section_names.end(),
+            [](WorkflowScriptSectionName section_name) { return section_name.section == WorkflowScriptSection::ATTRIBUTE_LIST; });
+        if (found_section_name != m_workflow_script_helper.section_names.end()) {
+            section_script += found_section_name->name + "\n";
+            for (size_t i = 0; i < workflow->attribute_assignment_info_count; i++) {
+                section_script +=
+                    std::string(workflow->attribute_assignment_infos[i].target_node_name) +
+                    "." +
+                    std::string(workflow->attribute_assignment_infos[i].target_attribute_name) +
+                    " as " +
+                    std::string(workflow->attribute_assignment_infos[i].attribute_name) +
+                    "\n";
+            }
+        }
+        return section_script;
+    }
+    std::string generate_output_list_section(mmi_workflow_s *workflow) {
+        std::string section_script;
+        auto found_section_name = std::find_if(
+            m_workflow_script_helper.section_names.begin(),
+            m_workflow_script_helper.section_names.end(),
+            [](WorkflowScriptSectionName section_name) { return section_name.section == WorkflowScriptSection::OUTPUT_LIST; });
+        if (found_section_name != m_workflow_script_helper.section_names.end()) {
+            section_script += found_section_name->name + "\n";
+            for (size_t i = 0; i < workflow->output_assignment_info_count; i++) {
+                section_script +=
+                    std::string(workflow->output_assignment_infos[i].from_node_name) +
+                    "." +
+                    std::string(workflow->output_assignment_infos[i].from_port_name) +
+                    " as " +
+                    std::string(workflow->output_assignment_infos[i].output_name) +
+                    "\n";
+            }
+        }
+        return section_script;
+    }
+
+    std::string generate(mmi_workflow_h workflow) {
+        std::string script;
+
+        mmi_workflow_s *workflow_ptr = static_cast<mmi_workflow_s*>(workflow);
+
+        script += generate_workflow_info_section(workflow_ptr);
+        script += "\n";
+        script += generate_node_list_section(workflow_ptr);
+        script += "\n";
+        script += generate_link_list_section(workflow_ptr);
+        script += "\n";
+        script += generate_attribute_list_section(workflow_ptr);
+        script += "\n";
+        script += generate_output_list_section(workflow_ptr);
+        script += "\n";
+
+        return script;
+    }
+
+private:
+    WorkflowScriptHelper m_workflow_script_helper;
+};
+
+#endif //__MMI_WORKFLOW_SCRIPT_GENERATOR_H__
index 0f0b1700c825a9d2fb5934d3aa138beb9af0540c..de58678868cf217136008821625cc9a14cf15188 100644 (file)
 #include "mmi-node-controller.h"
 #include "mmi-node-action.h"
 #include "mmi-node-custom.h"
+#include "mmi-workflow-script-common.h"
 
-enum class WorkflowScriptSection {
-    NONE,
-    WORKFLOW_INFO,
-    NODE_LIST,
-    LINK_LIST,
-    ATTRIBUTE_LIST,
-    OUTPUT_LIST,
-};
+#include "magic_enum/magic_enum.hpp"
 
 typedef struct {
     WorkflowScriptSection section;
     std::regex pattern;
 } WorkflowScriptSectionPattern;
 
-typedef struct {
-    WorkflowScriptSection section;
-    std::string name;
-} WorkflowScriptSectionName;
-
 typedef struct {
     mmi_standard_workflow_type_e type;
     std::string name;
@@ -103,40 +92,134 @@ static inline void trim(std::string &s) {
 class WorkflowScriptParser {
 public:
     WorkflowScriptParser() {
-        m_section_names.push_back({WorkflowScriptSection::WORKFLOW_INFO, "@workflow"});
-        m_section_names.push_back({WorkflowScriptSection::NODE_LIST, "@node-list"});
-        m_section_names.push_back({WorkflowScriptSection::LINK_LIST, "@link-list"});
-        m_section_names.push_back({WorkflowScriptSection::ATTRIBUTE_LIST, "@attribute-list"});
-        m_section_names.push_back({WorkflowScriptSection::OUTPUT_LIST, "@output-list"});
-
         m_section_patterns.push_back({WorkflowScriptSection::WORKFLOW_INFO, std::regex("^name : ([a-zA-Z_]+)$")});
         m_section_patterns.push_back({WorkflowScriptSection::NODE_LIST, std::regex("^\\[([a-zA-Z]+)\\] ([a-zA-Z_\\-.]+) as ([a-zA-Z0-9_]+)$")});
         m_section_patterns.push_back({WorkflowScriptSection::LINK_LIST, std::regex("^([a-zA-Z0-9_.]+) -> ([a-zA-Z0-9_.]+)$")});
         m_section_patterns.push_back({WorkflowScriptSection::ATTRIBUTE_LIST, std::regex("^([a-zA-Z0-9_.]+) as ([a-zA-Z0-9_]+)$")});
         m_section_patterns.push_back({WorkflowScriptSection::OUTPUT_LIST, std::regex("^([a-zA-Z0-9_.]+) as ([a-zA-Z0-9_]+)$")});
 
-        m_standard_workflow_names.push_back({MMI_STANDARD_WORKFLOW_WAKEUPLESS_COMMAND, "WAKEUPLESS_COMMAND"});
-        m_standard_workflow_names.push_back({MMI_STANDARD_WORKFLOW_VOICE_TOUCH, "VOICE_TOUCH"});
-        m_standard_workflow_names.push_back({MMI_STANDARD_WORKFLOW_USER_RECOGNITION, "USER_RECOGNITION"});
-
-        m_node_source_names.push_back({MMI_NODE_SOURCE_TYPE_MIC_AMBIENT, "MIC_AMBIENT"});
-        m_node_source_names.push_back({MMI_NODE_SOURCE_TYPE_CAMERA, "CAMERA"});
-
-        m_node_processor_names.push_back({MMI_NODE_PROCESSOR_TYPE_ASR, "ASR"});
-        m_node_processor_names.push_back({MMI_NODE_PROCESSOR_TYPE_VIDEO_CONVERTER, "VIDEO_CONVERTER"});
-        m_node_processor_names.push_back({MMI_NODE_PROCESSOR_TYPE_FACE_RECOGNITION, "FACE_RECOGNITION"});
-        m_node_processor_names.push_back({MMI_NODE_PROCESSOR_TYPE_SPEAKER_RECOGNITION, "SPEAKER_RECOGNITION"});
-
-        m_node_logic_names.push_back({MMI_NODE_LOGIC_TYPE_FIXED_STRING_MATCH, "FIXED_STRING_MATCH"});
-        m_node_logic_names.push_back({MMI_NODE_LOGIC_TYPE_USER_COMPARISON, "USER_COMPARISON"});
-
-        m_node_controller_names.push_back({MMI_NODE_CONTROLLER_TYPE_SWITCH, "SWITCH"});
+        int loop;
+        bool found;
+
+        loop = 0;
+        found = true;
+        const std::string standard_workflow_prefix = "MMI_STANDARD_WORKFLOW_";
+        do {
+            auto workflow_type = magic_enum::enum_cast<mmi_standard_workflow_type_e>(loop);
+            if (workflow_type.has_value()) {
+                auto workflow_name = std::string(magic_enum::enum_name(workflow_type.value()));
+                std::string::size_type pos = workflow_name.find(standard_workflow_prefix);
+                if (pos!= std::string::npos) {
+                    workflow_name.erase(pos, standard_workflow_prefix.length());
+                }
+                m_standard_workflow_names.push_back(
+                    {static_cast<mmi_standard_workflow_type_e>(loop), workflow_name});
+            } else {
+                found = false;
+            }
+            loop++;
+        } while(found);
+
+        loop = 0;
+        found = true;
+        const std::string node_source_prefix = "MMI_NODE_SOURCE_TYPE_";
+        do {
+            auto node_type = magic_enum::enum_cast<mmi_node_source_type_e>(loop);
+            if (node_type.has_value()) {
+                auto node_name = std::string(magic_enum::enum_name(node_type.value()));
+                std::string::size_type pos = node_name.find(node_source_prefix);
+                if (pos!= std::string::npos) {
+                    node_name.erase(pos, node_source_prefix.length());
+                }
+                m_node_source_names.push_back(
+                    {static_cast<mmi_node_source_type_e>(loop), node_name});
+            } else {
+                found = false;
+            }
+            loop++;
+        } while(found);
+
+        loop = 0;
+        found = true;
+        const std::string node_processor_prefix = "MMI_NODE_PROCESSOR_TYPE_";
+        do {
+            auto node_type = magic_enum::enum_cast<mmi_node_processor_type_e>(loop);
+            if (node_type.has_value()) {
+                auto node_name = std::string(magic_enum::enum_name(node_type.value()));
+                std::string::size_type pos = node_name.find(node_processor_prefix);
+                if (pos!= std::string::npos) {
+                    node_name.erase(pos, node_processor_prefix.length());
+                }
+                m_node_processor_names.push_back(
+                    {static_cast<mmi_node_processor_type_e>(loop), node_name});
+            } else {
+                found = false;
+            }
+            loop++;
+        } while(found);
+
+        loop = 0;
+        found = true;
+        const std::string node_logic_prefix = "MMI_NODE_LOGIC_TYPE_";
+        do {
+            auto node_type = magic_enum::enum_cast<mmi_node_logic_type_e>(loop);
+            if (node_type.has_value()) {
+                auto node_name = std::string(magic_enum::enum_name(node_type.value()));
+                std::string::size_type pos = node_name.find(node_logic_prefix);
+                if (pos!= std::string::npos) {
+                    node_name.erase(pos, node_logic_prefix.length());
+                }
+                m_node_logic_names.push_back(
+                    {static_cast<mmi_node_logic_type_e>(loop), node_name});
+            } else {
+                found = false;
+            }
+            loop++;
+        } while(found);
+
+        loop = 0;
+        found = true;
+        const std::string node_controller_prefix = "MMI_NODE_CONTROLLER_TYPE_";
+        do {
+            auto node_type = magic_enum::enum_cast<mmi_node_controller_type_e>(loop);
+            if (node_type.has_value()) {
+                auto node_name = std::string(magic_enum::enum_name(node_type.value()));
+                std::string::size_type pos = node_name.find(node_controller_prefix);
+                if (pos!= std::string::npos) {
+                    node_name.erase(pos, node_controller_prefix.length());
+                }
+                m_node_controller_names.push_back(
+                    {static_cast<mmi_node_controller_type_e>(loop), node_name});
+            } else {
+                found = false;
+            }
+            loop++;
+        } while(found);
+
+        loop = 0;
+        found = true;
+        const std::string node_action_prefix = "MMI_NODE_ACTION_TYPE_";
+        do {
+            auto node_type = magic_enum::enum_cast<mmi_node_action_type_e>(loop);
+            if (node_type.has_value()) {
+                auto node_name = std::string(magic_enum::enum_name(node_type.value()));
+                std::string::size_type pos = node_name.find(node_action_prefix);
+                if (pos!= std::string::npos) {
+                    node_name.erase(pos, node_action_prefix.length());
+                }
+                m_node_action_names.push_back(
+                    {static_cast<mmi_node_action_type_e>(loop), node_name});
+            } else {
+                found = false;
+            }
+            loop++;
+        } while(found);
     }
     virtual ~WorkflowScriptParser() {
     }
 
     bool process_section_declaration(const std::string &line) {
-        for (auto &section_name : m_section_names) {
+        for (auto &section_name : m_workflow_script_helper.section_names) {
             if (line == section_name.name) {
                 m_current_section = section_name.section;
                 LOGD("section changed to %d, [%s]", static_cast<int>(m_current_section), line.c_str());
@@ -480,11 +563,11 @@ private:
         delete workflow_s;
     }
 
+    WorkflowScriptHelper m_workflow_script_helper;
     WorkflowScriptSection m_current_section{WorkflowScriptSection::NONE};
 
     std::regex m_section_declaration_regex{"^@[a-zA-Z0-9_-]+$"};
 
-    std::vector<WorkflowScriptSectionName> m_section_names;
     std::vector<WorkflowScriptSectionPattern> m_section_patterns;
 
     std::vector<StandardWorkflowName> m_standard_workflow_names;
@@ -500,7 +583,6 @@ private:
     std::string m_node_action_identifier{"Action"};
     std::vector<StandardNodeActionName> m_node_action_names;
     std::string m_node_custom_identifier{"Custom"};
-
 };
 
-#endif /* __MMI_WORKFLOW_SCRIPT_PARSER_H__ */
+#endif /* __MMI_WORKFLOW_SCRIPT_PARSER_H__ */
\ No newline at end of file
index b3de785c963947c2a29eb7a4bf6b309eea2f4b95..02c57c008e5e9ca0832703e04e3358246e0d5fb4 100644 (file)
@@ -21,6 +21,7 @@
 #include "mmi-workflow.h"
 
 #include "mmi-workflow-script-parser.h"
+#include "mmi-workflow-script-generator.h"
 
 #include <fstream>
 #include <sstream>
@@ -80,3 +81,16 @@ MMI_API int mmi_workflow_create_from_script_file(const char *script_path, mmi_wo
     return MMI_ERROR_NONE;
 }
 
+MMI_API int mmi_workflow_generate_script(mmi_workflow_h workflow, const char **script) {
+    if (workflow == nullptr || script == nullptr) {
+        LOGE("[ERROR] Invalid parameter");
+        return MMI_ERROR_INVALID_PARAMETER;
+    }
+
+    WorkflowScriptGenerator generator;
+    std::string generated = generator.generate(workflow);
+
+    *script = strdup(generated.c_str());
+
+    return MMI_ERROR_NONE;
+}
index 45093c4a3c0498bb0529a23b17287689a5008810..dfdd760f721a9c6fbc4a52c0144d17ccd40f0685 100644 (file)
@@ -171,10 +171,10 @@ TEST_F(PluginModuleRegistryTest, PluginModuleProxyProperlyDestroyedWhenGoesOutOf
                                  PluginModuleInfo{mmi_plugin_module_type_e::SHARED_LIBRARY, "dummy.so"});
         ASSERT_NE(nullptr, plugin_module);
 
-        std::map<PluginModuleRegistry_Derived::plugin_module_map_key, std::weak_ptr<IPluginModuleProxy>>& plugin_modules = registry.get_plugin_modules();
-        auto it = plugin_modules.find(std::make_pair(mmi_plugin_module_type_e::SHARED_LIBRARY, "dummy.so"));
+        std::map<PluginModuleRegistry_Derived::plugin_module_map_key, std::weak_ptr<IPluginModuleProxy>>& another_plugin_modules = registry.get_plugin_modules();
+        auto it = another_plugin_modules.find(std::make_pair(mmi_plugin_module_type_e::SHARED_LIBRARY, "dummy.so"));
 
-        ASSERT_NE(plugin_modules.end(), it);
+        ASSERT_NE(another_plugin_modules.end(), it);
         ASSERT_EQ(1, it->second.use_count());
     }
 
index d3ec98efef2a91a0be804e1490efff5e9a020ac6..07f7ea344a8d038f54ae83e0341abe840e270518 100644 (file)
@@ -1,7 +1,7 @@
 interface mmi {
        void result_cb(string source_name, bundle data) delegate;
 
-       int workflow_instance_create(in int local_workflow_instance_id, in int workflow_type, in bool script_from_file, in string script_info);
+       int workflow_instance_create(in int local_workflow_instance_id, in int workflow_type, in string script_info);
        int workflow_instance_destroy(in int local_workflow_instance_id);
        int workflow_instance_set_attribute(in int local_workflow_instance_id, in bundle attribute);
        int workflow_instance_emit_signal(in int local_workflow_instance_id, in bundle signal);