public NextActivityKey SetRoleToSlave( WorkflowExecutionContext context, ActivityParameterDictionary parameters) { _syncManager.ScannerRole = ScannerRole.Slave; if (!_syncManager.IsRemoteScannerConnected) { return(BpcNextActivityKeys.No); } _scannerManager.SetIndicator(CommonActivity.SYNCHRONIZATION_INDICATOR_TEXT); _logger.LogVerbose(Message.WorkflowSlaveWaitForRemoteScannerRoleDefined); context.Sleep(300); while (true) { context.WaitOne(_remoteScannerRoleDefined); switch (_remoteScannerRole) { case ScannerRole.Slave: return(BpcNextActivityKeys.No); case ScannerRole.Master: return(BpcNextActivityKeys.Yes); case ScannerRole.RemoteScannerMasterToo: break; case ScannerRole.Failed: return(BpcNextActivityKeys.No); } _logger.LogVerbose(Message.WorkflowSlaveWaitForRemoteScannerRoleDefined); context.Sleep(1000); } }
public NextActivityKey Mock( WorkflowExecutionContext context, ActivityParameterDictionary parameters) { _logger.LogInfo(Message.Common_Information, parameters.GetParamValue("Text", "-")); context.Sleep(TimeSpan.FromMilliseconds(500)); return(context.DefaultNextActivityKey); }
public NextActivityKey Mock( WorkflowExecutionContext context, ActivityParameterDictionary parameters) { _logger.LogInfo(Message.Common_Information, parameters.GetParamValue("Text", "-")); context.Sleep(TimeSpan.FromMilliseconds(500)); return context.DefaultNextActivityKey; }
public NextActivityKey SyncWorkflowWithMasterScanner( WorkflowExecutionContext context, ActivityParameterDictionary parameters) { _scannerManager.SetIndicator(CommonActivity.SYNCHRONIZATION_INDICATOR_TEXT); _logger.LogVerbose(Message.WorkflowWaitForSynchronizationWithMaster); context.Sleep(Timeout.Infinite); return(context.DefaultNextActivityKey); }
private NextActivityKey SayPhraseAndExit( WorkflowExecutionContext context, ActivityParameterDictionary parameters, string exitTypeParamName) { SayPhrase(context, parameters); var exitType = parameters.GetParamValue(exitTypeParamName, ApplicationExitType.RestartApplication); CoreApplication.Instance.Exit(exitType); context.Sleep(Timeout.Infinite); return(context.DefaultNextActivityKey); }
public NextActivityKey Synchronize( WorkflowExecutionContext context, ActivityParameterDictionary parameters) { _logger.LogInfo(Message.WorkflowStartSynchronization); _scannerManager.SetIndicator(CommonActivity.SYNCHRONIZATION_INDICATOR_TEXT); _syncManager.StartStateSynchronization(true); var synchronizationSucceeded = _syncManager.WaitForSynchronizationFinished(context); if (!synchronizationSucceeded) { return(BpcNextActivityKeys.No); } var res = _workflowManager.GoToStateActivity(); if (res) { context.Sleep(Timeout.Infinite); } return(BpcNextActivityKeys.Yes); }
public NextActivityKey SyncWorkflowWithMasterScanner( WorkflowExecutionContext context, ActivityParameterDictionary parameters) { _scannerManager.SetIndicator(CommonActivity.SYNCHRONIZATION_INDICATOR_TEXT); _logger.LogVerbose(Message.WorkflowWaitForSynchronizationWithMaster); context.Sleep(Timeout.Infinite); return context.DefaultNextActivityKey; }
private NextActivityKey SayPhraseAndExit( WorkflowExecutionContext context, ActivityParameterDictionary parameters, string exitTypeParamName) { SayPhrase(context, parameters); var exitType = parameters.GetParamValue(exitTypeParamName, ApplicationExitType.RestartApplication); CoreApplication.Instance.Exit(exitType); context.Sleep(Timeout.Infinite); return context.DefaultNextActivityKey; }