コード例 #1
0
        public static WatsonWorkspaceCreate CreateInstance(LexiconWorkspace workspace)
        {
            WatsonWorkspaceCreate instance = CreateInstance <WatsonWorkspaceCreate>();

            instance.workspace = workspace;
            return(instance);
        }
コード例 #2
0
        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);
        }