package com.vci.client.workflow.delegate;
|
|
import com.vci.client.ClientSession;
|
import com.vci.client.common.objects.UserEntityObject;
|
import com.vci.client.framework.delegate.ClientBaseDelegate;
|
import com.vci.client.ui.exception.VCIException;
|
import com.vci.corba.common.VCIError;
|
import com.vci.corba.workflow.data.FlowInstanceInfo;
|
|
public class FlowInstanceClientDelegate extends ClientBaseDelegate {
|
|
/**
|
*
|
*/
|
private static final long serialVersionUID = 1L;
|
|
public FlowInstanceClientDelegate() {
|
}
|
|
public FlowInstanceClientDelegate(UserEntityObject userEntityObject) {
|
super(userEntityObject);
|
}
|
|
public String saveFlowInstance(FlowInstanceInfo info) throws VCIError {
|
return ClientSession.getWorkflowService().saveFlowInstance(info, userEntityInfo);
|
}
|
|
public void endProcessInstance(String processInstanceId) throws VCIException {
|
try{
|
ClientSession.getWorkflowService().endProcessInstance(processInstanceId,userEntityInfo);
|
} catch (VCIError e) {
|
throw convertVCIErrorToVCIException(e);
|
}
|
}
|
public void endProcessInstanceByplatform(String processInstanceId) throws VCIException {
|
try{
|
ClientSession.getWorkflowService().endProcessInstanceByplatform(processInstanceId,userEntityInfo);
|
} catch (VCIError e) {
|
throw convertVCIErrorToVCIException(e);
|
}
|
}
|
|
public FlowInstanceInfo[] getFlowInstances(String applicant) throws VCIException {
|
try {
|
FlowInstanceInfo[] infos = ClientSession.getWorkflowService().getFlowInstances(applicant);
|
return infos;
|
} catch (VCIError e) {
|
throw convertVCIErrorToVCIException(e);
|
}
|
}
|
public FlowInstanceInfo[] getFlowInstancesname(String name) throws VCIException {
|
try {
|
FlowInstanceInfo[] infos = ClientSession.getWorkflowService().getFlowInstancesname(name);
|
return infos;
|
} catch (VCIError e) {
|
throw convertVCIErrorToVCIException(e);
|
}
|
}
|
|
public VCIException convertVCIErrorToVCIException(VCIError e) {
|
return new VCIException(String.valueOf(e.code), e.messages);
|
}
|
}
|