-
Notifications
You must be signed in to change notification settings - Fork 0
solrpl/swork
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a *very* simple framework for workflow within the meaning of converting input object into output object in several steps. Goals: * simple * programmer-friendliness - most bugs detected on compile time Features: * subworkflows - workflow can be used as component in other workflow Usage: There are two base definitions: * enricher - object capable to enrich input object. For example context may be enriched by information about user and his permissions. * converter - object capable to convert input object to output object. For example request object can be converted to response object. 1. Automatic transition Collection<Stage<YourRequest, YourResponse>> enrichers = ... YourRequest request = ... Workflow<YourRequest, YourResponse, YourStateModel> workflow = new Workflow<YourRequest, YourResponse, YourStateModel>(); workflow.addAllEnrichers(enrichers); workflow.addOutputConverter(new ConvertRequestResponseOutputConverter<YourRequest, YourResponse>()); YourResponse response = workflow.enrichAndConvert(request); 2. SemiAutomatic Collection<Stage<YourRequest, YourResponse>> enrichers = ... YourRequest request = ... Workflow<YourRequest, YourResponse, YourStateModel> workflow = new Workflow<YourRequest, YourResponse, YourStateModel>(); workflow.addAllEnrichers(enrichers); workflow.addOutputConverter(new ConvertRequestResponseOutputConverter<YourRequest, YourResponse>()); Collection<YourStateModel> state = workflow.enrich(request); // check state and contiuue processing ... Collection<YourStateModel> state = workflow.enrich(request, YourStateModel.STATE_X); // check state - should be final state ... YourResponse response = workflow.convert(request); Todo: * branches * state achieved when all contributors were executed
About
Simple Workflow: enrich & convert your model
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published