Esempio n. 1
0
        public static WatsonIntentSyncAll CreateInstance(LexiconWorkspace workspace)
        {
            WatsonIntentSyncAll instance = CreateInstance <WatsonIntentSyncAll>();

            instance.workspace = workspace;
            return(instance);
        }
        public void SyncWatsonConversation(LexiconWorkspace workspace, WorkspaceSyncData syncData)
        {
            workspace.WatsonConversationManager.IsSyncing  = true;
            workspace.WatsonConversationManager.SyncStatus = "Syncing";

            WatsonSyncQueue syncQueue = ScriptableObject.CreateInstance <WatsonSyncQueue>();

            syncQueue.workspace = workspace;
            syncQueue.syncData  = syncData;

            if (string.IsNullOrEmpty(workspace.WatsonConversationManager.WorkspaceId))
            {
                syncQueue.Enqueue(WatsonWorkspaceCreate.CreateInstance(workspace));
            }

            syncQueue.Enqueue(WatsonIntentSyncAll.CreateInstance(workspace));
            syncQueue.Enqueue(WatsonEntitySyncAll.CreateInstance(workspace));

            syncQueue.OnCompleteAction = WatsonCompleteConversationSync.CreateInstance(workspace);
            syncQueue.OnQueueFinished += CleanUp;

            syncQueue.Process();

            watsonConversationSyncQueues.Add(syncQueue);
        }