use of com.google.api.ads.admanager.axis.v202202.Activity in project libSBOLj by SynBioDex.
the class Provenance_CodonOptimization method main.
public static void main(String[] args) throws Exception {
NamespaceBinding myAppNs = NamespaceBinding("http://myapp.com/", "myapp");
SBOLDocument document = new SBOLDocument();
document.addNamespace(URI.create(myAppNs.getNamespaceURI()), myAppNs.getPrefix());
document.setDefaultURIprefix(myAppNs.getNamespaceURI());
ComponentDefinition optimizedCds = getCds(document, "codon_optimized", "Codon optimised CDS");
ComponentDefinition sourceCds = getCds(document, "non_codon_optimized", "Non Codon optimised CDS");
optimizedCds.addWasDerivedFrom(sourceCds.getIdentity());
// Create the agent definition for the codon optimization software
Agent agent = document.createAgent("codon_optimization_software");
agent.setName("Codon Optimization Software");
// Create the generic top level entity for the codon optimization activity
Activity activity = document.createActivity("codon_optimization_activity");
activity.setName("Codon Optimization Activity");
// Create the qualifiedUsage annotation to describe the use of the non codon optimized CDS component
activity.createUsage("usage", sourceCds.getIdentity()).addRole(URI.create("http://sbols.org/v2#source"));
// Create the qualifiedAssociation annotation to describe the use of the software agent used in the activity
activity.createAssociation("association", agent.getIdentity()).addRole(myAppNs.namespacedUri("codonoptimiser"));
optimizedCds.addWasGeneratedBy(activity.getIdentity());
SBOLWriter.write(document, System.out);
}
use of com.google.api.ads.admanager.axis.v202202.Activity in project kie-wb-common by kiegroup.
the class AbstractThrowEventCompensationEventPostConverter method linkActivityRef.
protected void linkActivityRef(Process process, ThrowEvent throwEvent, String activityRef) {
if (!isEmpty(activityRef)) {
final CompensateEventDefinition compensateEvent = (CompensateEventDefinition) throwEvent.getEventDefinitions().get(0);
final Activity activity = findActivity(process, activityRef);
if (activity != null) {
compensateEvent.setActivityRef(activity);
} else {
LOG.warn("Referred activity: " + activityRef + " was not found for event: id: " + throwEvent.getId() + ", name: " + throwEvent.getName());
}
}
}
use of com.google.api.ads.admanager.axis.v202202.Activity in project kie-wb-common by kiegroup.
the class AbstractCompensationEventPostConverter method findActivity.
protected Activity findActivity(FlowElementsContainer container, String uuid) {
final List<FlowElementsContainer> subContainers = new ArrayList<>();
for (FlowElement flowElement : container.getFlowElements()) {
if (flowElement instanceof Activity) {
if (flowElement.getId().equals(uuid)) {
return (Activity) flowElement;
} else if (flowElement instanceof SubProcess) {
subContainers.add((SubProcess) flowElement);
}
}
}
Activity result;
for (FlowElementsContainer subContainer : subContainers) {
result = findActivity(subContainer, uuid);
if (result != null) {
return result;
}
}
return null;
}
use of com.google.api.ads.admanager.axis.v202202.Activity in project kie-wb-common by kiegroup.
the class BoundaryEventPropertyReaderTest method testComputeBoundsWhenNoDockerInfo.
private void testComputeBoundsWhenNoDockerInfo(float eventX, float eventY, float expectedX, float expectedY) {
FeatureMap featureMap = mock(FeatureMap.class);
List<FeatureMap.Entry> entries = new ArrayList<>();
when(featureMap.stream()).thenReturn(entries.stream());
when(boundaryEvent.getAnyAttribute()).thenReturn(featureMap);
String activityId = "activityId";
Activity sourceActivity = mock(Activity.class);
BPMNShape sourceActivityShape = mock(BPMNShape.class);
org.eclipse.dd.dc.Bounds activityBounds = mockBounds(ACTIVITY_X, ACTIVITY_Y, ACTIVITY_WIDTH, ACTIVITY_HEIGHT);
when(sourceActivity.getId()).thenReturn(activityId);
when(sourceActivityShape.getBounds()).thenReturn(activityBounds);
when(definitionResolver.getShape(activityId)).thenReturn(sourceActivityShape);
when(boundaryEvent.getAttachedToRef()).thenReturn(sourceActivity);
float eventWidth = 56;
float eventHeight = 56;
org.eclipse.dd.dc.Bounds eventBounds = mockBounds(eventX, eventY, eventWidth, eventHeight);
Bounds result = propertyReader.computeBounds(eventBounds);
assertEquals(expectedX, result.getX(), 0);
assertEquals(expectedY, result.getY(), 0);
}
use of com.google.api.ads.admanager.axis.v202202.Activity in project kie-wb-common by kiegroup.
the class BoundaryEventPropertyWriterTest method testSetParentActivity.
@Test
public void testSetParentActivity() {
ActivityPropertyWriter parentActivityWriter = mock(ActivityPropertyWriter.class);
Activity activity = mock(Activity.class);
when(parentActivityWriter.getFlowElement()).thenReturn(activity);
propertyWriter.setParentActivity(parentActivityWriter);
verify(element).setAttachedToRef(activity);
}
Aggregations