Search in sources :

Example 1 with Task

use of com.google.cloud.tasks.v2.Task in project openstack4j by ContainX.

the class ImageV2Tests method createTask.

public void createTask() throws IOException {
    respondWith(TASK_JSON);
    Map<String, Object> input = new HashMap<>();
    input.put("test", "hi");
    String type = "import";
    Task t = Builders.taskBuilder().type(type).input(input).build();
    Task task = osv3().imagesV2().tasks().create(t);
    assertNotNull(task);
    assertEquals(task.getType(), type);
}
Also used : Task(org.openstack4j.model.image.v2.Task) HashMap(java.util.HashMap)

Example 2 with Task

use of com.google.cloud.tasks.v2.Task in project kie-wb-common by kiegroup.

the class FlowElementConverterTest method convertSupported.

@Test
public void convertSupported() {
    StartEvent startEvent = mock(StartEvent.class);
    tested.convertNode(startEvent);
    verify(startEventConverter).convert(startEvent);
    EndEvent endEvent = mock(EndEvent.class);
    tested.convertNode(endEvent);
    verify(endEventConverter).convert(endEvent);
    BoundaryEvent boundaryEvent = mock(BoundaryEvent.class);
    tested.convertNode(boundaryEvent);
    verify(eventConverter).convertBoundaryEvent(boundaryEvent);
    IntermediateCatchEvent intermediateCatchEvent = mock(IntermediateCatchEvent.class);
    tested.convertNode(intermediateCatchEvent);
    verify(eventConverter).convert(intermediateCatchEvent);
    IntermediateThrowEvent intermediateThrowEvent = mock(IntermediateThrowEvent.class);
    tested.convertNode(intermediateThrowEvent);
    verify(throwEventConverter).convert(intermediateThrowEvent);
    Task task = mock(Task.class);
    tested.convertNode(task);
    verify(taskConverter).convert(task);
    Gateway gateway = mock(Gateway.class);
    tested.convertNode(gateway);
    verify(gatewayConverter).convert(gateway);
    SubProcess subProcess = mock(SubProcess.class);
    tested.convertNode(subProcess);
    verify(subProcessConverter).convertSubProcess(subProcess);
    CallActivity callActivity = mock(CallActivity.class);
    tested.convertNode(callActivity);
    verify(callActivityConverter).convert(callActivity);
    TextAnnotation textAnnotation = mock(TextAnnotation.class);
    tested.convertNode(textAnnotation);
    verify(artifactsConverter).convert(textAnnotation);
    DataObjectReference dataObjectReference = mock(DataObjectReference.class);
    tested.convertNode(dataObjectReference);
    verify(artifactsConverter).convert(dataObjectReference);
}
Also used : SubProcess(org.eclipse.bpmn2.SubProcess) Task(org.eclipse.bpmn2.Task) BoundaryEvent(org.eclipse.bpmn2.BoundaryEvent) Gateway(org.eclipse.bpmn2.Gateway) IntermediateCatchEvent(org.eclipse.bpmn2.IntermediateCatchEvent) StartEvent(org.eclipse.bpmn2.StartEvent) EndEvent(org.eclipse.bpmn2.EndEvent) CallActivity(org.eclipse.bpmn2.CallActivity) TextAnnotation(org.eclipse.bpmn2.TextAnnotation) IntermediateThrowEvent(org.eclipse.bpmn2.IntermediateThrowEvent) DataObjectReference(org.eclipse.bpmn2.DataObjectReference) Test(org.junit.Test)

Example 3 with Task

use of com.google.cloud.tasks.v2.Task in project kie-wb-common by kiegroup.

the class TaskConverter method noneTask.

private PropertyWriter noneTask(Node<View<NoneTask>, ?> n) {
    Task task = bpmn2.createTask();
    task.setId(n.getUUID());
    NoneTask definition = n.getContent().getDefinition();
    ActivityPropertyWriter p = propertyWriterFactory.of(task);
    TaskGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setAbsoluteBounds(n);
    p.setSimulationSet(definition.getSimulationSet());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    return p;
}
Also used : BusinessRuleTask(org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask) CustomTask(org.kie.workbench.common.stunner.bpmn.workitem.CustomTask) GenericServiceTask(org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask) Task(org.eclipse.bpmn2.Task) ScriptTask(org.kie.workbench.common.stunner.bpmn.definition.ScriptTask) BaseTask(org.kie.workbench.common.stunner.bpmn.definition.BaseTask) BaseUserTask(org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask) NoneTask(org.kie.workbench.common.stunner.bpmn.definition.NoneTask) ActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ActivityPropertyWriter) NoneTask(org.kie.workbench.common.stunner.bpmn.definition.NoneTask) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet)

Example 4 with Task

use of com.google.cloud.tasks.v2.Task in project kie-wb-common by kiegroup.

the class TaskConverter method customTask.

private PropertyWriter customTask(Node<View<CustomTask>, ?> n) {
    org.eclipse.bpmn2.Task task = bpmn2.createTask();
    task.setId(n.getUUID());
    CustomTask definition = n.getContent().getDefinition();
    ServiceTaskPropertyWriter p = propertyWriterFactory.of(task);
    p.setServiceTaskName(definition.getName());
    TaskGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    CustomTaskExecutionSet executionSet = definition.getExecutionSet();
    p.setTaskName(executionSet.getTaskName().getValue());
    p.setAsync(executionSet.getIsAsync().getValue());
    p.setOnEntryAction(executionSet.getOnEntryAction());
    p.setOnExitAction(executionSet.getOnExitAction());
    p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue());
    p.setSlaDueDate(executionSet.getSlaDueDate().getValue());
    p.setSimulationSet(definition.getSimulationSet());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAbsoluteBounds(n);
    return p;
}
Also used : GenericServiceTaskPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GenericServiceTaskPropertyWriter) ServiceTaskPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ServiceTaskPropertyWriter) CustomTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.workitem.CustomTaskExecutionSet) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) Task(org.eclipse.bpmn2.Task) Factories.bpmn2(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.Factories.bpmn2) CustomTask(org.kie.workbench.common.stunner.bpmn.workitem.CustomTask)

Example 5 with Task

use of com.google.cloud.tasks.v2.Task in project kie-wb-common by kiegroup.

the class ActivityPropertyWriterTest method testNotEmptyInputSet.

@Test
public void testNotEmptyInputSet() {
    Task task = bpmn2.createTask();
    ActivityPropertyWriter activityPropertyWriter = new ActivityPropertyWriter(task, new FlatVariableScope(), new HashSet<>());
    activityPropertyWriter.setAssignmentsInfo(new AssignmentsInfo("|A:String|||"));
    assertNotNull(task.getIoSpecification());
    assertTrue(task.getIoSpecification().getOutputSets().isEmpty());
    assertEquals(1, task.getIoSpecification().getInputSets().size());
}
Also used : Task(org.eclipse.bpmn2.Task) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Test(org.junit.Test)

Aggregations

Task (com.google.cloud.tasks.v2.Task)28 Test (org.junit.jupiter.api.Test)19 Task (org.eclipse.bpmn2.Task)17 Test (org.junit.Test)9 CloudTasksClient (com.google.cloud.tasks.v2.CloudTasksClient)7 FlowElement (org.eclipse.bpmn2.FlowElement)5 InputSet (org.eclipse.bpmn2.InputSet)5 SubProcess (org.eclipse.bpmn2.SubProcess)5 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)5 ByteString (com.google.protobuf.ByteString)4 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)4 BusinessRuleTask (org.eclipse.bpmn2.BusinessRuleTask)4 GlobalTask (org.eclipse.bpmn2.GlobalTask)4 OutputSet (org.eclipse.bpmn2.OutputSet)4 Process (org.eclipse.bpmn2.Process)4 ReceiveTask (org.eclipse.bpmn2.ReceiveTask)4 RootElement (org.eclipse.bpmn2.RootElement)4 ScriptTask (org.eclipse.bpmn2.ScriptTask)4 SendTask (org.eclipse.bpmn2.SendTask)4 ServiceTask (org.eclipse.bpmn2.ServiceTask)4