Package de.scoopgmbh.copper

Examples of de.scoopgmbh.copper.WorkflowVersion$Comparator


      wfMapLatest.put(wfClass.getName(), wfClass); // workflow is always accessible by its name
     
      WorkflowDescription wfDesc = wfClass.getAnnotation(WorkflowDescription.class);
      if (wfDesc != null) {
        final String alias = wfDesc.alias();
        final WorkflowVersion version = new WorkflowVersion(wfDesc.majorVersion(), wfDesc.minorVersion(), wfDesc.patchLevelVersion());
        wfMapVersioned.put(createAliasName(alias, version), wfClass);
       
        WorkflowVersion existingLatest = latest.get(alias);
        if (existingLatest == null || version.isLargerThan(existingLatest)) {
          wfMapLatest.put(alias, wfClass);
          latest.put(alias, version);
        }
       
View Full Code Here


  public WorkflowVersion findLatestMajorVersion(String wfName, long majorVersion) {
    final List<WorkflowVersion> versionsList = volatileState.wfVersions.get(wfName);
    if (versionsList == null)
      return null;

    WorkflowVersion rv = null;
    for (WorkflowVersion v : versionsList) {
      if (v.getMajorVersion() > majorVersion) {
        break;
      }
      rv = v;
View Full Code Here

  public WorkflowVersion findLatestMinorVersion(String wfName, long majorVersion, long minorVersion) {
    final List<WorkflowVersion> versionsList = volatileState.wfVersions.get(wfName);
    if (versionsList == null)
      return null;

    WorkflowVersion rv = null;
    for (WorkflowVersion v : versionsList) {
      if ((v.getMajorVersion() > majorVersion) || (v.getMajorVersion() == majorVersion && v.getMinorVersion() > minorVersion)) {
        break;
      }
      rv = v;
View Full Code Here

  @Test
  public void testFindLatest() throws Exception {
    final ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"transient-engine-application-context.xml", "SimpleTransientEngineTest-application-context.xml"});
    try {
      final WorkflowRepository repo = context.getBean(WorkflowRepository.class);
      WorkflowVersion v = repo.findLatestMajorVersion(VersionTestWorkflowDef.NAME, 9);
      assertEquals(new WorkflowVersion(9, 3, 1), v);
     
      v = repo.findLatestMinorVersion(VersionTestWorkflowDef.NAME, 9, 1);
      assertEquals(new WorkflowVersion(9, 1, 1), v);
    }
    finally {
      context.close();
    }
  }
View Full Code Here

    ProcessingEngine engine = _engine;

    try {
      final BlockingResponseReceiver<String> brr = new BlockingResponseReceiver<String>();
      final WorkflowInstanceDescr<BlockingResponseReceiver<String>> descr = new WorkflowInstanceDescr<BlockingResponseReceiver<String>>(VersionTestWorkflowDef.NAME);
      descr.setVersion(new WorkflowVersion(1, 0, 1));
      descr.setData(brr);

      engine.run(descr);

      brr.wait4response(5000);
View Full Code Here

TOP

Related Classes of de.scoopgmbh.copper.WorkflowVersion$Comparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.