Examples of GlobalTask


Examples of com.alibaba.otter.node.etl.common.task.GlobalTask

    private void startTask(Pipeline pipeline, Map<StageType, GlobalTask> tasks, StageType taskType) {
        if (tasks.get(taskType) != null && tasks.get(taskType).isAlive()) {
            logger.warn("WARN ## this task = {} has started", taskType);
        }

        GlobalTask task = null;
        if (taskType.isSelect()) {
            task = new SelectTask(pipeline.getId());
        } else if (taskType.isExtract()) {
            task = new ExtractTask(pipeline.getId());
        } else if (taskType.isTransform()) {
            task = new TransformTask(pipeline.getId());
        } else if (taskType.isLoad()) {
            task = new LoadTask(pipeline.getId());
        }

        if (task != null) {
            OtterContextLocator.autowire(task); // 注入一下spring资源
            task.start();
            tasks.put(taskType, task);
            logger.info("INFO ## start this task = {} success", taskType.toString());
        }
    }
View Full Code Here

Examples of com.alibaba.otter.node.etl.common.task.GlobalTask

            logger.info("INFO ## start this task = {} success", taskType.toString());
        }
    }

    private void stopTask(Map<StageType, GlobalTask> tasks, StageType taskType) {
        GlobalTask task = tasks.remove(taskType);
        if (task != null) {
            task.shutdown();
            logger.info("INFO ## taskName = {} has shutdown", taskType);
        } else {
            logger.info("INFo ## taskName = {} is not started", taskType);
        }
View Full Code Here

Examples of com.alibaba.otter.node.etl.common.task.GlobalTask

    public String loadPendingProcess(Long pipelineId) {
        return pendingProcess(pipelineId, StageType.LOAD);
    }

    private String pendingProcess(Long pipelineId, StageType stage) {
        GlobalTask task = controllers.get(pipelineId).get(stage);
        if (task != null) {
            return "stage:" + stage + " , pending:[" + StringUtils.join(task.getPendingProcess(), ',') + "]";
        } else {
            return "node don't running stage:" + stage;
        }
    }
View Full Code Here

Examples of org.eclipse.bpmn2.GlobalTask

    public void testSimpleGlobalTaskUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("oneTask.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        assertTrue(definitions.getRootElements().iterator().next() instanceof GlobalTask);
        GlobalTask task = (GlobalTask) definitions.getRootElements().iterator().next();
        assertEquals("oneTask", task.getName());
        assertEquals("my task doc", task.getDocumentation().iterator().next().getText());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

Examples of org.eclipse.bpmn2.GlobalTask

    public void testTwoGlobalTasksUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("twoTask.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 2);
        assertTrue(definitions.getRootElements().get(0) instanceof GlobalTask);
        GlobalTask task = (GlobalTask) definitions.getRootElements().get(0);
        assertEquals("firstTask", task.getName());
        assertEquals("my task doc", task.getDocumentation().iterator().next().getText());
        GlobalTask task2 = (GlobalTask) definitions.getRootElements().get(1);
        assertEquals("secondTask", task2.getName());
        assertEquals("my task doc too", task2.getDocumentation().iterator().next().getText());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

Examples of org.eclipse.bpmn2.GlobalTask

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.GLOBAL_TASK: {
            GlobalTask globalTask = (GlobalTask) theEObject;
            T result = caseGlobalTask(globalTask);
            if (result == null)
                result = caseCallableElement(globalTask);
            if (result == null)
                result = caseRootElement(globalTask);
View Full Code Here

Examples of org.eclipse.bpmn2.GlobalTask

        }
      }

      else if (callActivity.getCalledElementRef() instanceof GlobalTask) {
        GraphicsUtil.clearActivityMarker(markerContainer, GraphicsUtil.ACTIVITY_MARKER_EXPAND);
        GlobalTask t = (GlobalTask) callActivity.getCalledElementRef();
        if (globalTaskShape == null) {
          globalTaskShape = peService.createShape(container, false);
          peService.setPropertyValue(globalTaskShape, GLOBAL_TASK_SHAPE_PROPERTY, Boolean.toString(true));
        }
        String imageId = getImageId(t);
View Full Code Here

Examples of org.eclipse.bpmn2.GlobalTask

                // if a task has sequence edges it is considered a task,
                // otherwise it is considered a global task.
                if (child instanceof Task && _outgoingFlows.get(child).isEmpty() && !_sequenceFlowTargets.contains(_objMap.get(child))) {
                    // no edges on a task at the top level! We replace it with a
                    // global task.
                    GlobalTask task = null;
                    if (child instanceof ScriptTask) {
                        task = Bpmn2Factory.eINSTANCE.createGlobalScriptTask();
                        ((GlobalScriptTask) task).setScript(((ScriptTask) child).getScript());
                        ((GlobalScriptTask) task).setScriptLanguage(((ScriptTask) child).getScriptFormat());
                        // TODO scriptLanguage missing on scriptTask
                    } else if (child instanceof UserTask) {
                        task = Bpmn2Factory.eINSTANCE.createGlobalUserTask();
                    } else if (child instanceof ServiceTask) {
                        // we don't have a global service task! Fallback on a
                        // normal global task
                        task = Bpmn2Factory.eINSTANCE.createGlobalTask();
                    } else if (child instanceof BusinessRuleTask) {
                        task = Bpmn2Factory.eINSTANCE.createGlobalBusinessRuleTask();
                    } else if (child instanceof ManualTask) {
                        task = Bpmn2Factory.eINSTANCE.createGlobalManualTask();
                    } else {
                        task = Bpmn2Factory.eINSTANCE.createGlobalTask();
                    }

                    task.setName(((Task) child).getName());
                    task.setIoSpecification(((Task) child).getIoSpecification());
                    task.getDocumentation().addAll(((Task) child).getDocumentation());
                    ((Definitions) baseElt).getRootElements().add(task);
                    continue;
                } else {
                    if (child instanceof SequenceFlow) {
                        // for some reason sequence flows are placed as root elements.
View Full Code Here

Examples of org.eclipse.bpmn2.GlobalTask

    public void testSimpleGlobalTaskUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("oneTask.json"));
        assertTrue(definitions.getRootElements().size() == 1);
        assertTrue(definitions.getRootElements().iterator().next() instanceof GlobalTask);
        GlobalTask task = (GlobalTask) definitions.getRootElements().iterator().next();
        assertEquals("oneTask", task.getName());
        assertEquals("my task doc", task.getDocumentation().iterator().next().getText());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

Examples of org.eclipse.bpmn2.GlobalTask

    public void testTwoGlobalTasksUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("twoTasks.json"));
        assertTrue(definitions.getRootElements().size() == 2);
        assertTrue(definitions.getRootElements().get(0) instanceof GlobalTask);
        GlobalTask task = (GlobalTask) definitions.getRootElements().get(0);
        assertEquals("firstTask", task.getName());
        assertEquals("my task doc", task.getDocumentation().iterator().next().getText());
        GlobalTask task2 = (GlobalTask) definitions.getRootElements().get(1);
        assertEquals("secondTask", task2.getName());
        assertEquals("my task doc too", task2.getDocumentation().iterator().next().getText());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.