本文整理汇总了Java中org.apache.taverna.scufl2.api.profiles.Profile类的典型用法代码示例。如果您正苦于以下问题:Java Profile类的具体用法?Java Profile怎么用?Java Profile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Profile类属于org.apache.taverna.scufl2.api.profiles包,在下文中一共展示了Profile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GraphController
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
public GraphController(Workflow workflow, Profile profile,
boolean interactive, Component componentForPopups,
Alignment alignment, PortStyle portStyle, EditManager editManager,
MenuManager menuManager, ColourManager colourManager) {
this.workflow = workflow;
this.profile = profile;
this.interactive = interactive;
this.componentForPopups = componentForPopups;
this.alignment = alignment;
this.portStyle = portStyle;
this.editManager = editManager;
this.colourManager = colourManager;
this.graphEventManager = new DefaultGraphEventManager(this,
componentForPopups, menuManager);
graph = generateGraph();
}
示例2: LocalExecution
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
/**
* Constructs an Execution for executing Taverna workflows on a local
* Taverna Dataflow Engine.
*
* @param workflowBundle
* the <code>WorkflowBundle</code> containing the
* <code>Workflow</code>s required for execution
* @param workflow
* the <code>Workflow</code> to execute
* @param profile
* the <code>Profile</code> to use when executing the
* <code>Workflow</code>
* @param dataBundle
* the <code>Bundle</code> containing the data values for the
* <code>Workflow</code>
* @param referenceService
* the <code>ReferenceService</code> used to register inputs,
* outputs and intermediate values
* @throws InvalidWorkflowException
* if the specified workflow is invalid
*/
public LocalExecution(WorkflowBundle workflowBundle, Workflow workflow,
Profile profile, Bundle dataBundle,
ReferenceService referenceService, Edits edits,
ActivityService activityService,
DispatchLayerService dispatchLayerService)
throws InvalidWorkflowException {
super(workflowBundle, workflow, profile, dataBundle);
this.referenceService = referenceService;
try {
mapping = new WorkflowToDataflowMapper(workflowBundle, profile,
edits, activityService, dispatchLayerService);
Dataflow dataflow = mapping.getDataflow(workflow);
for (DataflowInputPort dataflowInputPort : dataflow.getInputPorts())
inputPorts.put(dataflowInputPort.getName(), dataflowInputPort);
facade = edits.createWorkflowInstanceFacade(dataflow,
createContext(), "");
executionMonitor = new LocalExecutionMonitor(getWorkflowReport(),
getDataBundle(), mapping, facade.getIdentifier());
} catch (InvalidDataflowException e) {
throw new InvalidWorkflowException(e);
}
}
示例3: visit
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
@Override
public boolean visit(WorkflowBean node) {
if (node instanceof Profile)
profile((Profile) node);
else if (node instanceof Activity)
activity((Activity) node);
else if (node instanceof InputActivityPort)
inputActivityPort((InputActivityPort) node);
else if (node instanceof OutputActivityPort)
outputActivityPort((OutputActivityPort) node);
else if (node instanceof ProcessorBinding)
processorBinding((ProcessorBinding) node);
else if (node instanceof ProcessorInputPortBinding)
processorInputPortBinding((ProcessorInputPortBinding) node);
else if (node instanceof ProcessorOutputPortBinding)
processorOutputPortBinding((ProcessorOutputPortBinding) node);
else if (node instanceof Configuration)
configuration((Configuration) node);
else
throw new IllegalStateException("Unexpected node " + node);
return true;
}
示例4: parseRShell22WithReferences
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
@Test
public void parseRShell22WithReferences() throws Exception {
URL wfResource = getClass().getResource(WF_RSHELL_2_2);
assertNotNull("Could not find workflow " + WF_RSHELL_2_2, wfResource);
WorkflowBundle bundle = parser
.parseT2Flow(wfResource.openStream());
Profile profile = bundle.getMainProfile();
Processor proc = bundle.getMainWorkflow().getProcessors()
.getByName("Rshell");
assertNotNull(proc);
Configuration config = scufl2Tools
.configurationForActivityBoundToProcessor(proc, profile);
assertNotNull(config);
// TODO: Check data types defined (semantic types)
}
示例5: setUp
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
workflow = new Workflow();
mainWorkflow = new Workflow();
profile = new Profile();
mainProfile = new Profile();
workflowBundle = new WorkflowBundle();
workflowBundle.setMainProfile(mainProfile);
workflowBundle.setMainWorkflow(mainWorkflow);
executionService = new LocalExecutionService();
executionEnvironment = new LocalExecutionEnvironment(executionService, null, null);
dataBundle = DataBundles.createBundle();
runProfile = new RunProfile(executionEnvironment, workflowBundle, workflow.getName(), profile.getName(), dataBundle);
}
示例6: createCustomComponent
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
@Override
protected Component createCustomComponent() {
Workflow workflow = (Workflow) getContextualSelection().getParent();
Profile profile = workflow.getParent().getMainProfile();
Port port = getSelectedPort();
// Component component =
// getContextualSelection().getRelativeToComponent();
String label;
if (port instanceof ReceiverPort) {
label = CONNECT_WITH_OUTPUT_FROM;
} else {
label = CONNECT_AS_INPUT_TO;
}
JMenu connectMenu = new JMenu(new DummyAction(label,
WorkbenchIcons.datalinkIcon));
addPortMenuItems(workflow, port, connectMenu);
addProcessorMenuItems(workflow, profile, port, connectMenu);
return connectMenu;
}
示例7: visitProfile
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
@Override
public void visitProfile(Profile bean) {
Integer profilePosition = bean.getProfilePosition();
if (profilePosition != null && profilePosition < 0)
listener.negativeValue(bean, "profilePosition", profilePosition);
if (checkComplete) {
if (bean.getProcessorBindings() == null)
listener.nullField(bean, "processorBindings");
if (bean.getConfigurations() == null)
listener.nullField(bean, "configurations");
// It may be OK for the profilePosition to be null
if (bean.getActivities() == null)
listener.nullField(bean, "activities");
}
}
示例8: fastaPscan
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
@Test
public void fastaPscan() throws Exception {
URL wfResource = getClass().getResource(WF_FASTA_AND_PSCAN);
assertNotNull("Could not find workflow " + WF_FASTA_AND_PSCAN,
wfResource);
T2FlowParser parser = new T2FlowParser();
parser.setValidating(true);
// parser.setStrict(true);
WorkflowBundle wfBundle = parser.parseT2Flow(wfResource.openStream());
Profile p = wfBundle.getMainProfile();
for (Configuration c : p.getConfigurations()) {
System.out.println(c.getConfigures());
System.out.println(c.getJson());
}
}
示例9: findActivity
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
protected Activity findActivity() {
if (getContextualSelection() == null)
return null;
Object selection = getContextualSelection().getSelection();
if (selection instanceof Activity) {
Activity activity = (Activity) selection;
if (activity.getType().equals(activityType))
return activity;
}
if (selection instanceof Processor) {
Processor processor = (Processor) selection;
Profile profile = processor.getParent().getParent().getMainProfile();
for (ProcessorBinding processorBinding : scufl2Tools.processorBindingsForProcessor(processor, profile))
if (processorBinding.getBoundActivity().getType().equals(activityType))
return processorBinding.getBoundActivity();
}
return null;
}
示例10: processorPortBindingForPortInternal
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
protected ProcessorPortBinding<?, ?> processorPortBindingForPortInternal(
Port port, Profile profile) {
List<ProcessorBinding> processorBindings;
if (port instanceof ProcessorPort) {
ProcessorPort processorPort = (ProcessorPort) port;
processorBindings = processorBindingsForProcessor(
processorPort.getParent(), profile);
} else if (port instanceof ActivityPort) {
ActivityPort activityPort = (ActivityPort) port;
processorBindings = processorBindingsToActivity(activityPort
.getParent());
} else
throw new IllegalArgumentException(
"Port must be a ProcessorPort or ActivityPort");
for (ProcessorBinding procBinding : processorBindings) {
ProcessorPortBinding<?, ?> portBinding = processorPortBindingInternalInBinding(
port, procBinding);
if (portBinding != null)
return portBinding;
}
return null;
}
示例11: serviceTypes
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
public Set<String> serviceTypes(String[] filepaths) throws ReaderException, IOException, WriterException {
Set<String> types = new LinkedHashSet<String>();
WorkflowBundleIO io = new WorkflowBundleIO();
for (String filepath : filepaths) {
File file = new File(filepath);
// mediaType = null --> guess
WorkflowBundle wfBundle = io.readBundle(file, null);
for (Profile profile : wfBundle.getProfiles()) {
for (Activity activity : profile.getActivities()) {
types.add(activity.getType().toASCIIString());
}
}
}
return types;
}
示例12: testCompletenessOfMissingProfilePosition
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
@Test
public void testCompletenessOfMissingProfilePosition() {
// should be OK
Profile profile = new Profile();
profile.setProfilePosition(null);
CorrectnessValidator cv = new CorrectnessValidator();
ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
cv.checkCorrectness(profile, true, rcvl);
Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
boolean problem = false;
for (NullFieldProblem nlp : nullFieldProblems) {
if (nlp.getBean().equals(profile) && nlp.getFieldName().equals("profilePosition")) {
problem = true;
}
}
assertFalse(problem);
}
示例13: testCorrectnessOfInvalidProfilePosition
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
@Test
public void testCorrectnessOfInvalidProfilePosition() {
Profile profile = new Profile();
Integer profilePosition = Integer.valueOf(-3);
profile.setProfilePosition(profilePosition);
CorrectnessValidator cv = new CorrectnessValidator();
ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
cv.checkCorrectness(profile, false, rcvl);
Set<NegativeValueProblem> negativeValueProblems = rcvl.getNegativeValueProblems();
boolean problem = false;
for (NegativeValueProblem nlp : negativeValueProblems) {
if (nlp.getBean().equals(profile) && nlp.getFieldName().equals("profilePosition") && nlp.getFieldValue().equals(profilePosition)) {
problem = true;
}
}
assertTrue(problem);
}
示例14: testInScopeMainProfile
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
@Test
public void testInScopeMainProfile() {
DummyWorkflowBundle dwb = new DummyWorkflowBundle();
Profile profile = new Profile();
dwb.setMainProfile(profile);
NamedSet<Profile> profiles = new NamedSet<Profile>();
dwb.setProfiles(profiles);
profiles.add(profile);
CorrectnessValidator cv = new CorrectnessValidator();
ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
cv.checkCorrectness(dwb, false, rcvl);
Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
boolean problem = false;
for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) {
if (nlp.getBean().equals(dwb) && nlp.getFieldName().equals("mainProfile") && nlp.getValue().equals(profile)) {
problem = true;
}
}
assertFalse(problem);
}
示例15: testCorrectnessOfOutOfScopeBoundProcessor1
import org.apache.taverna.scufl2.api.profiles.Profile; //导入依赖的package包/类
@Test
public void testCorrectnessOfOutOfScopeBoundProcessor1() {
WorkflowBundle wb = new WorkflowBundle();
Profile profile = new Profile();
profile.setParent(wb);
ProcessorBinding pb = new ProcessorBinding();
Processor orphanProcessor = new Processor();
pb.setBoundProcessor(orphanProcessor);
pb.setParent(profile);
CorrectnessValidator cv = new CorrectnessValidator();
ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
cv.checkCorrectness(pb, false, rcvl);
Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
assertFalse(outOfScopeValueProblems.isEmpty());
boolean problem = false;
for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) {
if (nlp.getBean().equals(pb) && nlp.getFieldName().equals("boundProcessor") && nlp.getValue().equals(orphanProcessor)) {
problem = true;
}
}
assertTrue(problem);
}