Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying completed workflow instances by datetime range #181

Open
vincentgiraud opened this issue Nov 3, 2021 · 2 comments
Open

Querying completed workflow instances by datetime range #181

vincentgiraud opened this issue Nov 3, 2021 · 2 comments
Labels
enhancement New feature or request scope-graphql Related to the GraphQL API

Comments

@vincentgiraud
Copy link

vincentgiraud commented Nov 3, 2021

Support querying completed workflow instances by datetime range. e.g. For processes and variables on a particular day.

{
  processInstances (stateIn: [COMPLETED], minStartTime: "2021-11-02T00:00:00.000Z", maxEndTime: "2021-11-02T23:59:59.999Z") {
  	nodes {
          state
          startTime
          endTime
          variables {
          name
          value
      }
    }
  }
}
@saig0 saig0 added enhancement New feature or request scope-graphql Related to the GraphQL API labels Nov 5, 2021
@vincentgiraud
Copy link
Author

vincentgiraud commented Jan 20, 2022

Hello @saig0,

I've added minStartTime and maxEndTime properties to processInstances function and graphqls files.

After some progress, I've now bumped into this error:

2022-01-20 21:47:58.875 ERROR 8805 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'graphQLServletRegistrationBean' defined in class path resource [graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLServletRegistrationBean' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphQLHttpServlet' defined in class path resource [graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLHttpServlet' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphQLServletConfiguration' defined in class path resource [graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLServletConfiguration' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'invocationInputFactory' defined in class path resource [graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'invocationInputFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphQLSchemaProvider' defined in class path resource [graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLSchemaProvider' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphQLSchema' defined in class path resource [graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLSchema' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'schemaParser' defined in class path resource [graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'schemaParser' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'timerResolver' defined in URL [jar:file:/Users/vincentgiraud/.m2/repository/io/zeebe/zeeqs/graphql-api/2.1.2-SNAPSHOT/graphql-api-2.1.2-SNAPSHOT.jar!/io/zeebe/zeeqs/graphql/resolvers/type/TimerResolver.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processInstanceRepository' defined in io.zeebe.zeeqs.data.repository.ProcessInstanceRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List io.zeebe.zeeqs.data.repository.ProcessInstanceRepository.findByProcessDefinitionKeyAndStateIn(long,java.lang.String,java.lang.String,java.util.List,org.springframework.data.domain.Pageable)! Reason: Failed to create query for method public abstract java.util.List io.zeebe.zeeqs.data.repository.ProcessInstanceRepository.findByProcessDefinitionKeyAndStateIn(long,java.lang.String,java.lang.String,java.util.List,org.springframework.data.domain.Pageable)! Operator IN on state requires a Collection argument, found class java.lang.String in method public abstract java.util.List io.zeebe.zeeqs.data.repository.ProcessInstanceRepository.findByProcessDefinitionKeyAndStateIn(long,java.lang.String,java.lang.String,java.util.List,org.springframework.data.domain.Pageable).; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List io.zeebe.zeeqs.data.repository.ProcessInstanceRepository.findByProcessDefinitionKeyAndStateIn(long,java.lang.String,java.lang.String,java.util.List,org.springframework.data.domain.Pageable)! Operator IN on state requires a Collection argument, found class java.lang.String in method public abstract java.util.List io.zeebe.zeeqs.data.repository.ProcessInstanceRepository.findByProcessDefinitionKeyAndStateIn(long,java.lang.String,java.lang.String,java.util.List,org.springframework.data.domain.Pageable).

@saig0
Copy link
Contributor

saig0 commented Jan 28, 2022

@vincentgiraud it's a long root cause 😅

It seems that the signature of the method ProcessInstanceRepository.findByProcessDefinitionKeyAndStateIn() changed. Spring complains that the second argument is not a collection (i.e. a list). Instead, it is a string. On master, the second argument is a list.

Note that the arguments are applied as they are defined by the method name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request scope-graphql Related to the GraphQL API
Projects
None yet
Development

No branches or pull requests

2 participants