1 17 18 19 20 package org.apache.lenya.cms.workflow; 21 22 import org.apache.lenya.cms.publication.Document; 23 import org.apache.lenya.cms.publication.DocumentSet; 24 import org.apache.lenya.workflow.WorkflowException; 25 import org.apache.lenya.workflow.WorkflowInstance; 26 import org.apache.lenya.workflow.impl.SynchronizedWorkflowInstancesImpl; 27 28 31 public class WorkflowDocumentSet extends SynchronizedWorkflowInstancesImpl { 32 33 40 public WorkflowDocumentSet(DocumentSet documentSet, Document mainDocument) throws WorkflowException { 41 Document[] documents = documentSet.getDocuments(); 42 WorkflowInstance[] instances = new WorkflowInstance[documents.length]; 43 WorkflowFactory factory = WorkflowFactory.newInstance(); 44 for (int i = 0; i < documents.length; i++) { 45 instances[i] = factory.buildInstance(documents[i]); 46 } 47 setInstances(instances); 48 setMainInstance(factory.buildInstance(mainDocument)); 49 } 50 51 } 52 | Popular Tags |