Ejemplo n.º 1
0
        /// <summary>
        /// Registers routes for interacting with machines.
        /// </summary>
        /// <param name="configurationRepositoryContextFactory">The repository context factory.</param>
        /// <param name="stateMachineFactory">The state machine factory.</param>
        /// <param name="logger"></param>
        public InstancesModule(
            REstateConfiguration configuration,
            StateEngineFactory stateEngineFactory,
            IPlatformLogger logger)
            : base(configuration, "/machines", claim => claim.Type == "claim" && claim.Value == "operator")
        {
            Logger             = logger;
            StateEngineFactory = stateEngineFactory;

            GetMachineState();

            IsInState();

            GetAvailableTriggers();

            FireTrigger();

            GetMachineDiagram();

            GetMachineDrawing();

            GetMachineMetadata();

            DeleteMachine();
        }
Ejemplo n.º 2
0
 public DirectChronoConsumer(
     IChronoRepositoryFactory repositoryFactory,
     TriggerSchedulerFactory triggerSchedulerFactory,
     IPlatformLogger logger,
     StateEngineFactory stateEngineFactory)
     : base(repositoryFactory, triggerSchedulerFactory, logger)
 {
     StateEngineFactory = stateEngineFactory;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Registers routes for defining new machines.
        /// </summary>
        /// <param name="configurationRepositoryContextFactory">The repository context factory.</param>
        /// <param name="stateMachineFactory">The state machine factory.</param>
        /// <param name="logger"></param>
        public SchematicsModule(
            REstateConfiguration configuration,
            StateEngineFactory stateEngineFactory,
            IPlatformLogger logger)
            : base(configuration, "/schematics", claim => claim.Type == "claim" && claim.Value == "schematicBuilder")
        {
            Logger             = logger;
            StateEngineFactory = stateEngineFactory;

            GetSchematic();

            GetSchematicDiagram();

            GetSchematicDrawing();

            CreateSchematic();

            ListSchematics();

            InstantiateMachine();

            PreviewDiagram();
        }
Ejemplo n.º 4
0
        protected override Task Initialize(string apiKey)
        {
            StateEngine = StateEngineFactory.GetStateEngine(apiKey);

            return(Task.CompletedTask);
        }