use of com.google.api.ads.admanager.axis.v202205.Activity in project kie-wb-common by kiegroup.
the class SubProcessConverterTest method JBPM_7525_eventSubProcessShouldStoreIsAsync.
@Test
public void JBPM_7525_eventSubProcessShouldStoreIsAsync() {
ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext(new GraphImpl("x", new GraphNodeStoreImpl())), new PropertyWriterFactory());
SubProcessConverter c = f.subProcessConverter();
NodeImpl<View<? extends BPMNViewDefinition>> n = new NodeImpl<>("n");
EventSubprocess subProcessNode = new EventSubprocess();
subProcessNode.getExecutionSet().setIsAsync(new IsAsync(true));
n.setContent(new ViewImpl<>(subProcessNode, Bounds.create()));
Activity activity = c.convertSubProcess(n).value().getFlowElement();
Boolean value = CustomElement.async.of(activity).get();
assertThat(value).isEqualTo(true);
}
use of com.google.api.ads.admanager.axis.v202205.Activity in project kie-wb-common by kiegroup.
the class IntermediateCompensationEventPostConverterTest method testProcessWhenOutEdgeExists.
@Test
@SuppressWarnings("unchecked")
public void testProcessWhenOutEdgeExists() {
String uuid = "UUID";
Edge edge = mock(Edge.class);
Node targetNode = mock(Node.class);
when(targetNode.getUUID()).thenReturn(uuid);
List outEdges = new ArrayList<>();
outEdges.add(edge);
when(node.getOutEdges()).thenReturn(outEdges);
Activity activity = mock(Activity.class);
when(activity.getId()).thenReturn(uuid);
when(edge.getTargetNode()).thenReturn(targetNode);
List<FlowElement> flowElements = Collections.singletonList(activity);
when(process.getFlowElements()).thenReturn(flowElements);
converter.process(processWriter, nodeWriter, (Node) node);
verify(activity).setIsForCompensation(true);
}
use of com.google.api.ads.admanager.axis.v202205.Activity in project kie-wb-common by kiegroup.
the class EventDefinitionReaderTest method testActivityRefOfWithValue.
@Test
public void testActivityRefOfWithValue() {
Activity activity = mock(Activity.class);
when(activity.getId()).thenReturn(SOME_VALUE);
testActivityRefOf(activity, SOME_VALUE);
}
use of com.google.api.ads.admanager.axis.v202205.Activity in project ORCID-Source by ORCID.
the class Api2_0_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(ActivitiesContainer actContainerV2) {
if (actContainerV2 != null) {
Collection<? extends Activity> activities = actContainerV2.retrieveActivities();
if (activities != null && !activities.isEmpty()) {
Iterator<? extends Activity> activitiesIterator = activities.iterator();
XMLGregorianCalendar latest = activitiesIterator.next().getLastModifiedDate().getValue();
while (activitiesIterator.hasNext()) {
Activity activity = activitiesIterator.next();
if (latest.compare(activity.getLastModifiedDate().getValue()) == -1) {
latest = activity.getLastModifiedDate().getValue();
}
}
actContainerV2.setLastModifiedDate(new LastModifiedDate(latest));
}
}
}
use of com.google.api.ads.admanager.axis.v202205.Activity in project kie-wb-common by kiegroup.
the class Bpmn2JsonUnmarshaller method setItemDefinitionsForActivitiesIoSpec.
public void setItemDefinitionsForActivitiesIoSpec(FlowElementsContainer container, Definitions def, List<ItemDefinition> toAddItemDefinitions) {
List<FlowElement> flowElements = container.getFlowElements();
for (FlowElement fe : flowElements) {
if (fe instanceof Activity) {
Activity ac = (Activity) fe;
if (ac.getIoSpecification() != null) {
if (ac.getIoSpecification().getDataInputs() != null) {
List<DataInput> dataInputs = ac.getIoSpecification().getDataInputs();
for (DataInput din : dataInputs) {
Iterator<FeatureMap.Entry> iter = din.getAnyAttribute().iterator();
while (iter.hasNext()) {
FeatureMap.Entry entry = iter.next();
if (entry.getEStructuralFeature().getName().equals("dtype")) {
String dinType = (String) entry.getValue();
if (dinType != null && dinType.length() > 0) {
ItemDefinition itemdef = Bpmn2Factory.eINSTANCE.createItemDefinition();
itemdef.setId("_" + din.getId() + "Item");
itemdef.setStructureRef(dinType);
toAddItemDefinitions.add(itemdef);
din.setItemSubjectRef(itemdef);
}
}
}
}
}
if (ac.getIoSpecification().getDataOutputs() != null) {
List<DataOutput> dataOutputs = ac.getIoSpecification().getDataOutputs();
for (DataOutput dout : dataOutputs) {
Iterator<FeatureMap.Entry> iter = dout.getAnyAttribute().iterator();
while (iter.hasNext()) {
FeatureMap.Entry entry = iter.next();
if (entry.getEStructuralFeature().getName().equals("dtype")) {
String doutType = (String) entry.getValue();
if (doutType != null && doutType.length() > 0) {
ItemDefinition itemdef = Bpmn2Factory.eINSTANCE.createItemDefinition();
itemdef.setId("_" + dout.getId() + "Item");
itemdef.setStructureRef(doutType);
toAddItemDefinitions.add(itemdef);
dout.setItemSubjectRef(itemdef);
}
}
}
}
}
}
} else if (fe instanceof FlowElementsContainer) {
setItemDefinitionsForActivitiesIoSpec((FlowElementsContainer) fe, def, toAddItemDefinitions);
}
}
}
Aggregations