Example #1
0
        public EditorViewModel(IProcessFacade process, IIoC ioc) : base(ioc)
        {
            _process = process;

            MessageBus.Subscribe <PageSelected>(async msg => await OnPageSelected(msg));
            MessageBus.Subscribe <NotebookSelected>(OnNotebookSelected);
            MessageBus.Subscribe <SectionSelected>(OnSectionSelected);
        }
Example #2
0
        public EditorViewModel(IProcessFacade process, IIoC ioc) : base(ioc)
        {
            _process = process;

            MessageBus.Subscribe<PageSelected>(async msg => await OnPageSelected(msg));
            MessageBus.Subscribe<NotebookSelected>(OnNotebookSelected);
            MessageBus.Subscribe<SectionSelected>(OnSectionSelected);
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Plugin"/> class.
 /// </summary>
 /// <param name="processFacade">The process facade.  Injection point for DI containers.</param>
 public Plugin(IProcessFacade processFacade)
 {
     _processFacade = processFacade;
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Plugin"/> class.
 /// </summary>
 /// <param name="processFacade">The process facade.  Injection point for DI containers.</param>
 public Plugin(IProcessFacade processFacade)
 {
     _processFacade = processFacade;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProcessController"/> class.
 /// </summary>
 /// <param name="logger">The logger used to write diagnostic information.</param>
 /// <param name="processFacade">The store to retrieve the user from.</param>
 /// <exception cref="ArgumentNullException">The <paramref name="logger"/> is <see langword="null"/>.</exception>
 /// <exception cref="ArgumentNullException">The data <paramref name="processFacade"/> is <see langword="null"/>.</exception>
 public ProcessController(IProcessFacade processFacade, ILogger <ProcessController> logger, IContextPersonStore contextPersonStore)
 {
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     _processFacade      = processFacade ?? throw new ArgumentNullException(nameof(processFacade));
     _contextPersonStore = contextPersonStore ?? throw new ArgumentNullException(nameof(contextPersonStore));
 }
Example #6
0
 public ProcessController(ILogger <ProcessController> logger, IProcessFacade processFacade)
 {
     _logger        = logger;
     _processFacade = processFacade;
 }
        public ApprovalsQuery(IProcessFacade processFacade, IProcessNodeStore processNodeStore)
        {
            #region Processes Example Query

            /*
             *  -------------Example Query----------------
             *  query GetProcesses($actorIdList: [String], $originatorIdList: [String],
             *                                              $beneficiaryIdList: [String],	$activityStateList: [String],
             *                                                  $processStateList: [String], $createDateStart: DateTime,
             *                                                  $createDateEnd: DateTime, $createDays: Int,
             *                                                  $lastDateStart: DateTime, $lastDateEnd: DateTime,
             *                                                  $lastDays: Int, $lastChangeDateRange: DateTime,
             *                                                  $documentTypeList: [String], $offset: Int, $limit:Int){
             *        processes(actorIdList: $actorIdList, originatorIdList: $originatorIdList,
             *                                      beneficiaryIdList: $beneficiaryIdList, activityStateList: $activityStateList,
             *                                      processStateList: $processStateList, createDateStart: $createDateStart,
             *                                      createDateEnd: $createDateEnd, createDays: $createDays,
             *                                      lastDateStart: $lastDateStart, lastDateEnd: $lastDateEnd,
             *                                      lastDays: $lastDays, lastChangeDateRange: $lastChangeDateRange,
             *                                      documentTypeList: $documentTypeList, offset: $offset, limit: $limit){
             *          processId
             *          processState
             *          processStatus
             *          documentId
             *          documentTypeName
             *          lastChangeHanfordId {
             *            employeeId
             *            lastName
             *            firstName
             *          }
             *          lastChangeDateTime
             *          createDateTime
             *          beneficiaryHanfordId {
             *            employeeId
             *            lastName
             *            firstName
             *          }
             *          processDefinitionId
             *        }
             *      }
             *
             *  ----------Query Variables----------
             *  {
             *    "beneficiaryIdList":  ["2002702"],
             *    "processStateList": ["PENDING"],
             *    "offset" : 0,
             *    "limit": 10
             *  }
             */
            #endregion

            FieldAsync <ListGraphType <ProcessGraph> >(
                name: "processes",
                description: "Retrieves all the filtered process",
                arguments: new QueryArguments
            {
                new QueryArgument <ListGraphType <StringGraphType> > {
                    Name = "actorIdList"
                },
                new QueryArgument <ListGraphType <StringGraphType> > {
                    Name = "originatorIdList"
                },
                new QueryArgument <ListGraphType <StringGraphType> > {
                    Name = "beneficiaryIdList"
                },
                new QueryArgument <ListGraphType <StringGraphType> > {
                    Name = "activityStateList"
                },
                new QueryArgument <ListGraphType <StringGraphType> > {
                    Name = "processStateList"
                },
                new QueryArgument <DateTimeGraphType> {
                    Name = "createDateStart"
                },
                new QueryArgument <DateTimeGraphType> {
                    Name = "createDateEnd"
                },
                new QueryArgument <IntGraphType> {
                    Name = "createDays"
                },
                new QueryArgument <DateTimeGraphType> {
                    Name = "lastDateStart"
                },
                new QueryArgument <DateTimeGraphType> {
                    Name = "lastDateEnd"
                },
                new QueryArgument <IntGraphType> {
                    Name = "lastDays"
                },
                new QueryArgument <DateTimeGraphType> {
                    Name = "lastChangeDateRange"
                },
                new QueryArgument <ListGraphType <StringGraphType> > {
                    Name = "documentTypeList"
                },

                new QueryArgument <IntGraphType> {
                    Name = "offset"
                },
                new QueryArgument <IntGraphType> {
                    Name = "limit"
                }
            },
                resolve: async(context) =>
            {
                var actorIdList       = context.GetArgument <List <string> >("actorIdList");
                var originatorIdList  = context.GetArgument <List <string> >("originatorIdList");
                var beneficiaryIdList = context.GetArgument <List <string> >("beneficiaryIdList");
                var activityStateList = context.GetArgument <List <string> >("activityStateList");
                var processStateList  = context.GetArgument <List <string> >("processStateList");
                var createDateStart   = context.GetArgument <DateTime?>("createDateStart");
                var createDateEnd     = context.GetArgument <DateTime?>("createDateEnd");
                var createDays        = context.GetArgument <int?>("createDays");
                var lastDateStart     = context.GetArgument <DateTime?>("lastDateStart");
                var lastDateEnd       = context.GetArgument <DateTime?>("lastDateEnd");
                var lastDays          = context.GetArgument <int?>("lastDays");

                var person = context.GetCurrentUser();
                var offset = context.GetArgument <int?>("offset");
                var limit  = context.GetArgument <int?>("limit");

                var processFilter = processFacade.GenerateProcessFilter(offset, limit, actorIdList, originatorIdList, beneficiaryIdList, null, activityStateList, createDateStart, createDateEnd, createDays, lastDateStart, lastDateEnd, lastDays, null, processStateList);

                return(await processFacade.SearchAsync(processFilter, person, offset, limit, context.CancellationToken));
            });

            #region Process Example Query

            /*
             * query processById {
             * processById(processId: 1480670) {
             *  processId
             *  processState
             *  processStatus
             *  beneficiaryHanfordId {
             *    employeeId
             *    lastName
             *    firstName
             *  }
             *  lastChangeDateTime
             *  createDateTime
             *  documentId
             *  documentTypeName
             *  processDefinitionId
             *  activities {
             *    actedActorId
             *    actedHanfordId {
             *      id
             *    }
             *    activityId
             *    activityName
             *    activityState
             *    activityStatus
             *    comment
             *    lastChangeDateTime
             *  }
             * }
             * }
             */

            #endregion

            FieldAsync <ProcessGraph>(
                name: "processById",
                description: "Retrieves the process with the given process Id.",
                arguments: new QueryArguments
            {
                new QueryArgument <IntGraphType> {
                    Name = "processId"
                },
            },
                resolve: async(context) =>
            {
                var processId = context.GetArgument <int>("processId");

                return((await processFacade.GetAsync(new List <int>()
                {
                    processId
                }, null, null, context.CancellationToken)).FirstOrDefault());
            });


            FieldAsync <ListGraphType <ProcessGraph> >(
                name: "processesByIds",
                description: "Retrieves the processes with the given process Ids.",
                arguments: new QueryArguments
            {
                new QueryArgument <ListGraphType <IntGraphType> > {
                    Name = "processIds"
                },
                new QueryArgument <IntGraphType> {
                    Name = "offset"
                },
                new QueryArgument <IntGraphType> {
                    Name = "limit"
                }
            },
                resolve: async(context) =>
            {
                var processIds = context.GetArgument <List <int> >("processIds");
                var offset     = context.GetArgument <int?>("offset");
                var limit      = context.GetArgument <int?>("limit");

                return(await processFacade.GetAsync(processIds, offset, limit, context.CancellationToken));
            });

            #region Processes' Nodes Example Query

            /*
             *  -------------Example Query----------------
             *  query GetProcessNodes($processIds: [Int]!, $offset: Int, $limit: Int) {
             *    processesNodes(processIds: $processIds, offset: $offset, limit: $limit){
             *      nodes{
             *        processId
             *        nodeName
             *        nodeLabel
             *        nodeDataType
             *        nodeValue
             *      }
             *    }
             *  }
             *
             *  ----------Query Variables----------
             *  {
             *    "processIds": [71953,71951,71950,71949,71947],
             *    "offset": 4,
             *    "limit": 3
             *  }
             */
            #endregion

            FieldAsync <PagedProcessNodeResultGraph>(
                name: "processesNodes",
                description: "Retrieves the process's nodes for each of the process in the given list of process Ids.",
                arguments: new QueryArguments
            {
                new QueryArgument <ListGraphType <IntGraphType> > {
                    Name = "processIds"
                },
                new QueryArgument <IntGraphType> {
                    Name = "offset"
                },
                new QueryArgument <IntGraphType> {
                    Name = "limit"
                }
            },
                resolve: async(context) =>
            {
                var processIds = context.GetArgument <List <int> >("processIds");
                var offset     = context.GetArgument <int?>("offset");
                var limit      = context.GetArgument <int?>("limit");

                var result = await processNodeStore.GetByIdsAsync(processIds, offset, limit, context.CancellationToken);

                return(new Connection <ProcessNodeResult>
                {
                    PageInfo = new PageInfo
                    {
                        Total = (int)result.Total,
                        Offset = result.Offset,
                        Limit = result.Limit
                    },
                    Nodes = result.Results
                });
            });
        }