Git Product home page Git Product logo

joshlong-attic / activiti Goto Github PK

View Code? Open in Web Editor NEW

This project forked from activiti/activiti

1.0 1.0 3.0 50.22 MB

Activiti is a light-weight workflow and Business Process Management (BPM) Platform targeted at business people, developers and system admins. Its core is a super-fast and rock-solid BPMN 2 process engine for Java. It's open-source and distributed under the Apache license. Activiti runs in any Java application, on a server, on a cluster or in the cloud. It integrates perfectly with Spring, it is extremely lightweight and based on simple concepts.

Home Page: http://www.activiti.org

Java 80.64% JavaScript 18.51% CSS 0.83% Shell 0.02%

activiti's People

Contributors

alien11689 avatar aschrijver avatar balsarori avatar didxga avatar dimitrihautot avatar dmandalidis avatar dmitryfar avatar ejyanezp avatar frederikheremans avatar gokceng avatar gro-mar avatar henryyan avatar jakobtonn avatar jbarrez avatar joshlong avatar lsmall avatar marcus-nl avatar martin-grofcik avatar mikedias avatar ruromero avatar skay2k avatar smirzai avatar tiancheng2000 avatar tiesebarrell avatar tijsrademakers avatar tombaeyens avatar tstephen avatar wendelkerr avatar xuhuisheng avatar yocki avatar

Stargazers

 avatar

Watchers

 avatar

activiti's Issues

@ProcessVariable String systemId vs. @ProcessVariable("systemId") String systemId

@ProcessVariable String systemId vs. @ProcessVariable("systemId") String systemId.

Eg, we should take advantage of Spring's DefaultParameerNameDiscoverer which in turn makes the decision dynamically by checking the JDK version. NB that Java 8 supports native, safe, non-debug symbol oriented discovery of the class names and this in turn is also exposed through Spring 4's DefaultParameerNameDiscoverer.

make the registry responsible for all chosen/specified/configured process wait-states

The idea is that you should have a component so annotated:

@State ( "process", "state-id")
void handler ( Execution ex, @ProcessVariable long customerId ) {
   // maybe they inject other things that let them set process variables, update them, etc. 

  ex.continue() ;
} 

Optionally,they could specify which process only and let us infer it by convention and the name of the method:

@State( "process") 
public void handleCustomerServiceFulfllment ( ...) {  // method name begets state-id: "customer-service-fulfllment"
}

@EnableAutoConfiguration with Spring Boot and Activiti should be INSANELY useful out of the box

For example, it would be great if users could just stash process definitions in resources/processes/*xml and then inject a valid ProcessEngine if there's a PlatformTransactionManager, DataSource and so on to create the ProcessEngine in the context. Basically, it should automatically turn on @EnableActiviti for the user, and wire it to look for process definitions in that directory.

@State handlers

@ProcessHandler triggers support for POJO-centric wait-state handlers.

@Component 
@ProcessHandler("fulfillment") 
class FulfillmentComponent { 

     @State("request-to-external-webservice")
     public void makeRequestToExternalWebService ( Execution execution, @ProcessVariable long customerId){ 
        // ... 
     }

}

Wait-states may both be synchronous (e.g., the wait-state is entered and exited in the same transaction) or asynchronous (e.g., the wait-state is entered in one transaction, and then passivated to disk until such time as somebody signals the execution back into life).

I'm not sure how to handle this. Perhaps we could let the user return a Future<?> whenever the wait-state should be signaled asynchronously?

e.g.,

  // enter wait-state and sleep 
  Future<?> handlerResult = // invoke method 
  Object result = handlerResult.get() 
  // signal wait-state to continue processing 

a bean annotated with @ProcessHandler signals to the Spring Activiti support that this bean should handle wait states with a given name. As a wait state may be entered, sleep, and then be signaled, we should also support this idiom in our API. Thus, a component might look like this:

@Component 
@ProcessHandler("fulfillment")
class FulfillmentComponent { 

      @State("fulfillment-wait-state")
      Future<Customer> sleepWaitStateWhileFutureExecutes( Execution ex, @ProcessVariable long customerId ){ 

      }
}

it should be possible to inject the current ProcessInstance in the execution of a wait state handler or process starting method

We'll register a global ProcessInstance object that's injectable anywhere that's just a thread-safe proxy for the current globally available ProcessInstance.

@ProcessHandler("fulfillment") 
class StateHandler {

   @Autowired ProcessInstance currentProcessInstance ; // thread-local proxy

    @StartProcess(processKey = "fulfillment") 
      public void beginCustomerFulfllment( @ProcessVariable long customerId ){ 

     }

    @State( waitState = "mail-newsletters") 
    public void mailNewsletters ( ProcessInstance pi ){ 
       //// ...
     }

   @State(waitState = "print-labels") 
    public void fulfillment ( Execution ex, @ProcessVariable long customerId ){ 
       /// ...
    }
}

On startup, there could be an optional (on by default?) check to make sure there are actually processes deployed with that state in it. This is a poor man's compiler check.

upgrade to Spring 4 and Spring Integration 3

we can take advantage of Java 8 support, the default parameter name discover thats also included with Spring 4 and a whole slew of other good stuff. Spring Integration 3 is also a rock solid release and Spring Integration 4's already starting to ship milestones.

Plus, if ever there was a good time to build a workflow-aware fork of Spring @MVC, with the new Link support and web socket support, there's a lot to recommend Spring 4 :)

make sure there are actually processes deployed for the given process && state handlers.

check to make sure there are actually processes deployed for the given process && state handlers. Otherwise, throw exception.

Optional.

@ProcessHandler("fulfillment") 
class StateHandler {

   @State(waitState = "print-labels") 
    public void fulfillment ( Execution ex ){ 
       /// ...
    }
}

On startup, there could be an optional (on by default?) check to make sure there are actually processes deployed with that state in it. This is a poor man's compiler check.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.