1 5 11 package com.opensymphony.workflow.soap; 12 13 import com.opensymphony.module.propertyset.PropertySet; 14 15 import com.opensymphony.workflow.*; 16 import com.opensymphony.workflow.config.Configuration; 17 import com.opensymphony.workflow.loader.WorkflowDescriptor; 18 import com.opensymphony.workflow.ofbiz.OfbizWorkflow; 19 import com.opensymphony.workflow.query.WorkflowExpressionQuery; 20 import com.opensymphony.workflow.query.WorkflowQuery; 21 22 import electric.util.Context; 23 24 import java.util.List ; 25 import java.util.Map ; 26 27 import javax.servlet.http.HttpServletRequest ; 28 29 30 36 public class OfbizSOAPWorkflow implements Workflow { 37 39 public int[] getAvailableActions(long id) { 40 return new OfbizWorkflow(getRemoteUser()).getAvailableActions(id); 41 } 42 43 public int[] getAvailableActions(long id, Map inputs) { 44 return new OfbizWorkflow(getRemoteUser()).getAvailableActions(id, inputs); 45 } 46 47 public void setConfiguration(Configuration configuration) { 48 new OfbizWorkflow(getRemoteUser()).setConfiguration(configuration); 49 } 50 51 public List getCurrentSteps(long id) { 52 return new OfbizWorkflow(getRemoteUser()).getCurrentSteps(id); 53 } 54 55 public int getEntryState(long id) { 56 return new OfbizWorkflow(getRemoteUser()).getEntryState(id); 57 } 58 59 public List getHistorySteps(long id) { 60 return new OfbizWorkflow(getRemoteUser()).getHistorySteps(id); 61 } 62 63 public PropertySet getPropertySet(long id) { 64 return new OfbizWorkflow(getRemoteUser()).getPropertySet(id); 65 } 66 67 public List getSecurityPermissions(long id) { 68 return new OfbizWorkflow(getRemoteUser()).getSecurityPermissions(id); 69 } 70 71 public WorkflowDescriptor getWorkflowDescriptor(String workflowName) { 72 return new OfbizWorkflow(getRemoteUser()).getWorkflowDescriptor(workflowName); 73 } 74 75 public String getWorkflowName(long id) { 76 return new OfbizWorkflow(getRemoteUser()).getWorkflowName(id); 77 } 78 79 public String [] getWorkflowNames() { 80 return new OfbizWorkflow(getRemoteUser()).getWorkflowNames(); 81 } 82 83 public boolean canInitialize(String workflowName, int initialState) { 84 return new OfbizWorkflow(getRemoteUser()).canInitialize(workflowName, initialState); 85 } 86 87 public boolean canInitialize(String workflowName, int initialAction, Map inputs) { 88 return new OfbizWorkflow(getRemoteUser()).canInitialize(workflowName, initialAction, inputs); 89 } 90 91 public boolean canModifyEntryState(long id, int newState) { 92 return new OfbizWorkflow(getRemoteUser()).canModifyEntryState(id, newState); 93 } 94 95 public void changeEntryState(long id, int newState) throws WorkflowException { 96 new OfbizWorkflow(getRemoteUser()).changeEntryState(id, newState); 97 } 98 99 public void doAction(long id, int actionId, Map inputs) throws WorkflowException, StoreException { 100 new OfbizWorkflow(getRemoteUser()).doAction(id, actionId, inputs); 101 } 102 103 public void executeTriggerFunction(long id, int triggerId) throws WorkflowException { 104 new OfbizWorkflow(getRemoteUser()).executeTriggerFunction(id, triggerId); 105 } 106 107 public long initialize(String workflowName, int initialState, Map inputs) throws WorkflowException { 108 return new OfbizWorkflow(getRemoteUser()).initialize(workflowName, initialState, inputs); 109 } 110 111 public List query(WorkflowQuery query) throws StoreException, FactoryException { 112 return new OfbizWorkflow(getRemoteUser()).query(query); 113 } 114 115 public List query(WorkflowExpressionQuery query) throws WorkflowException { 116 return new OfbizWorkflow(getRemoteUser()).query(query); 117 } 118 119 public boolean removeWorkflowDescriptor(String workflowName) throws FactoryException { 120 return new OfbizWorkflow(getRemoteUser()).removeWorkflowDescriptor(workflowName); 121 } 122 123 public boolean saveWorkflowDescriptor(String workflowName, WorkflowDescriptor descriptor, boolean replace) throws FactoryException { 124 return new OfbizWorkflow(getRemoteUser()).saveWorkflowDescriptor(workflowName, descriptor, replace); 125 } 126 127 protected String getRemoteUser() { 128 HttpServletRequest request = (HttpServletRequest ) Context.thread().getProperty("httpRequest"); 129 130 return request.getRemoteUser(); 131 } 132 } 133 | Popular Tags |