private static final Logger log = Logger.getLogger(XBayaWorkflowUtil.class);
private GlobalContext globalContext;
public ExpBldrWorkflow getWorkflowFromRegistry(String workflowTemplateName, ApplicationGlobalContext context){
Workflow xBayaWorkflow = null;
ExpBldrWorkflow expBldrWorkflow = new ExpBldrWorkflow();
GSSCredential cred = null;
try {
FileInputStream fis = new FileInputStream(context.getProperties().getProperty("ssl.hostcertsKeyFile"));
GlobusCredential globusCred = new GlobusCredential(fis);
cred = new GlobusGSSCredentialImpl(globusCred, GSSCredential.INITIATE_AND_ACCEPT);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ODEClient xbayaRegistryClient = new ODEClient();
// if (workflowTemplateName.startsWith("http://extreme.indiana.edu/lead/workflow/")){
// QName workflowQName = new QName(workflowTemplateName);
// xBayaWorkflow = xbayaRegistryClient.getWorkflow(URI.create(xRegistryUrl), credential, workflowQName);
// } else {
// xBayaWorkflow = xbayaRegistryClient.getWorkflow(URI.create(xRegistryUrl), credential, workflowTemplateName);
// }
if (workflowTemplateName.startsWith("http://extreme.indiana.edu/lead/workflow/")){
String[] tokens = workflowTemplateName.split("/");
workflowTemplateName = tokens[tokens.length - 1];
}
//Fetch the required elements and load into to lighter experiment builder workflow model
try {
xBayaWorkflow = xbayaRegistryClient.getWorkflow(URI.create(context.getXRegistryUrl()), cred, workflowTemplateName);
if (xBayaWorkflow != null){
expBldrWorkflow.setId(xBayaWorkflow.getUniqueWorkflowName().toString());
expBldrWorkflow.setName(xBayaWorkflow.getName());
expBldrWorkflow.setDescription(xBayaWorkflow.getDescription());
expBldrWorkflow.setWorkflowImage(xBayaWorkflow.getImage());
// for (WSComponentPort wsComponentPort : inputs) {
// wsComponentPort.setDefaultValue("<whateverxml/>");
// wsComponentPort.getDescription();
// }