140 likes | 176 Views
New Pawn Process. V0.7. Current. Final step of workflow invokes an ‘archive’ process Processes manually invoked by use on selected items Archive process locks package items after successful transfer Specified on a per-domain basis
E N D
New Pawn Process V0.7
Current • Final step of workflow invokes an ‘archive’ process • Processes manually invoked by use on selected items • Archive process locks package items after successful transfer • Specified on a per-domain basis • Two part configuration, install/instance configuration and per-execution configuration • Resources only see a per-item view of package (sax-like parsing)
New • Generic processes that can be invoked throughout package lifecycle • Allow processing to be tied to either record sets/templates or schedule authority • Allow process to modify existing packages • Approve, reject, lock, remove, create, annotate
Process Groups • Groupings of individual processes • List of permissions group may perform • User that group performs approve/reject as • Accept/Reject status filter for items • Ie, only execute against accepted items
Processes in a group • Like current archive resource • Each domain has a list of resources • Each process has a global configuration as before • Process Groups include one or more resources • Process groups may store predefined execution configuration • For automated execution • XFDU driver would be a resource that is mapped to a process in a process group
Invoking Process Groups • Invocation done on process group level • Manual • User is prompted for execution configuration • User selects items to run against group • Per-ingest call • Inline as a client called ingestObjects • Process executed on items supplied to ingestObjects • Execution configuration stored in process group • Batched call • Same as inline, except called out of band after a group of ingestObjects finish
API Changes (existing) • Events pushed to driver. • Configuration required JPanel object to be returned. • Driver was not given a complete view of items to be processed. • Driver responsible for managing inputstreams
API Changes • Configuration now optional • Can bypass using Annotations in Factory • Global and execution combined into ProcessConfiguration • Clients can extend DefaultProcessConfiguration • Processes receive file-level details by registering a listener • FileListener • Fewer Items to implement • ResourceFactory • SimpleResourceFactory can be extended • PawnProcess • Initialize and shutdown methods (DefaultPawnProcess)
Example requiring no configuration • ResourceFactory @ConfigurationRequired(execution=false, global=false) public class SampleResourceFactory extends SimpleResourceFactory<DefaultProcessConfiguration, SimplePawnProcess> { public SampleResourceFactory() { super(DefaultProcessConfiguration.class, SimplePawnProcess.class); } }
Pawn Process • Package context supplied to driver to interact with package • Add file listeners • Abort process • Get Execution Plan to iterate over items that will be processed public class SimplePawnProcess extends DefaultPawnProcess { @Override public void initialize() { System.out.println("Starting process, registering listener"); getContext().addFileListener(new MyFileListener()); } }
File Listener • Three methods. • FileDetails provides information about current file, checksum, name, etc • FileActions are actions that can be performed on current file. public interface FileListener { public void startFile(FileDetails details, FileActions actions); public void bytesAvailable(byte[] bytes); public void endFile(); }