Examples of TaskPropertyRef


Examples of org.jbpm.formbuilder.shared.task.TaskPropertyRef

            tableOfInputs.setColumns(2);
            tableOfInputs.setHeight("" + (inputs.size() * 30) + "px");
            tableOfInputs.setEffectClasses(tableEffects);
            tableOfInputs.setEventActions(asMapOfNull(tableActions, FBScript.class));
            for (int index = 0; index < inputs.size(); index++) {
                TaskPropertyRef input = inputs.get(index);
                LabelRepresentation labelName = new LabelRepresentation();
                labelName.setEventActions(asMapOfNull(labelActions, FBScript.class));
                labelName.setEffectClasses(labelEffects);
                labelName.setValue(input.getName());
                labelName.setWidth("100px");
                tableOfInputs.setElement(index, 0, labelName);
                LabelRepresentation labelValue = new LabelRepresentation();
                labelValue.setEventActions(asMapOfNull(labelActions, FBScript.class));
                labelValue.setEffectClasses(labelEffects);
                labelValue.setWidth("200px");
                InputData data = new InputData();
                data.setName(input.getName());
                data.setValue(input.getSourceExpresion());
                data.setMimeType("multipart/form-data");
                data.setFormatter(new Formatter() {
                    @Override
                    public Object format(Object object) {
                        return object;
                    }
                    @Override
                    public Map<String, Object> getDataMap() {
                        return new HashMap<String, Object>();
                    }
                });
                labelValue.setInput(data);
                labelValue.setValue("{variable}");
                tableOfInputs.setElement(index, 1, labelValue);
            }
            LabelRepresentation labelInputs = new LabelRepresentation();
            labelInputs.setEventActions(asMapOfNull(labelActions, FBScript.class));
            labelInputs.setEffectClasses(labelEffects);
            labelInputs.setValue("Inputs:");
            form.addFormItem(labelInputs);
            form.addFormItem(tableOfInputs);
        }
        List<TaskPropertyRef> outputs = task.getOutputs();
        if (outputs != null && !outputs.isEmpty()) {
            TableRepresentation tableOfOutputs = new TableRepresentation();
            tableOfOutputs.setRows(outputs.size());
            tableOfOutputs.setColumns(2);
            tableOfOutputs.setHeight("" + (outputs.size() * 30) + "px");
            tableOfOutputs.setEffectClasses(tableEffects);
            tableOfOutputs.setEventActions(asMapOfNull(tableActions, FBScript.class));
            for (int index = 0; index < outputs.size(); index++) {
                TaskPropertyRef output = outputs.get(index);
                LabelRepresentation labelName = new LabelRepresentation();
                labelName.setEventActions(asMapOfNull(labelActions, FBScript.class));
                labelName.setEffectClasses(labelEffects);
                labelName.setValue(output.getName());
                labelName.setWidth("100px");
                tableOfOutputs.setElement(index, 0, labelName);
                TextFieldRepresentation textField = new TextFieldRepresentation();
                textField.setEventActions(asMapOfNull(textfieldActions, FBScript.class));
                textField.setWidth("200px");
                textField.setEffectClasses(textfieldEffects);
                OutputData data = new OutputData();
                data.setName(output.getName());
                data.setValue(output.getSourceExpresion());
                data.setMimeType("multipart/form-data");
                data.setFormatter(new Formatter() {
                    @Override
                    public Object format(Object object) {
                        return object;
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskPropertyRef

   
    private Grid toGrid(List<TaskPropertyRef> ioList, final List<TaskPropertyRef> selectedIos) {
        Grid grid = new Grid(ioList == null ? 1 : ioList.size(), 2);
        if (ioList != null) {
            for (int index = 0; index < ioList.size(); index++) {
                final TaskPropertyRef io = ioList.get(index);
                CheckBox checkBox = new CheckBox();
                checkBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
                    @Override
                    public void onValueChange(ValueChangeEvent<Boolean> event) {
                        Boolean val = event.getValue();
                        if (val == null || val == false) {
                            if (selectedIos.contains(io)) {
                                selectedIos.remove(io);
                            }
                        } else {
                            if (!selectedIos.contains(io)) {
                                selectedIos.add(io);
                            }
                        }
                    }
                });
                checkBox.setValue(Boolean.TRUE);
                selectedIos.add(io);
                grid.setWidget(index, 0, checkBox);
                grid.setWidget(index, 1, new Label(io.getName()));
            }
        }
        return grid;
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskPropertyRef

    private static List<TaskPropertyRef> getIOData(JSONArray jsonIO) {
        List<TaskPropertyRef> retval = new ArrayList<TaskPropertyRef>();
        if (jsonIO != null) {
            for (int index = 0; index < jsonIO.size(); index++) {
                JSONObject jsonIo = jsonIO.get(index).isObject();
                TaskPropertyRef io = new TaskPropertyRef();
                if (jsonIo.get("name") != null && jsonIo.get("name").isString() != null) {
                    io.setName(jsonIo.get("name").isString().stringValue());
                }
                if (jsonIo.get("sourceExpression") != null && jsonIo.get("sourceExpression").isString() != null) {
                    io.setSourceExpresion(jsonIo.get("sourceExpression").isString().stringValue());
                }
                retval.add(io);
            }
        }
        return retval;
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskPropertyRef

        List<TaskPropertyRef> retval = null;
        if (ioList != null) {
            retval = new ArrayList<TaskPropertyRef>(ioList.getLength());
            for (int i = 0; i < ioList.getLength(); i++) {
                Element inElem = (Element) ioList.item(i);
                TaskPropertyRef prop = new TaskPropertyRef();
                String name = inElem.getAttribute("name");
                prop.setName(name);
                String sourceExpression = inElem.getAttribute("source");
                prop.setSourceExpresion(sourceExpression);
                retval.add(prop);
            }
        }
        return retval;
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskPropertyRef

    }

    public void addOutput(String processInputName, String id) {
        for (TaskRef task : tasks) {
            if (task.getTaskName().equals(processInputName)) {
                TaskPropertyRef prop = new TaskPropertyRef();
                prop.setName(id);
                prop.setSourceExpresion("${" + id + "}");
                if (!task.getOutputs().contains(prop)) {
                    task.addOutput(id, "${" + id + "}");
                }
                return;
            }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskPropertyRef

        String name = nodeName.getNodeValue();
        TaskRef task = new TaskRef();
        task.setTaskId(name);
        List<TaskPropertyRef> inputs = new ArrayList<TaskPropertyRef>(dataInputs.size());
        for (Map.Entry<String, String> in : dataInputs.entrySet()) {
            TaskPropertyRef prop = new TaskPropertyRef();
            prop.setName(in.getValue());
            prop.setSourceExpresion(in.getValue());
            inputs.add(prop);
        }
        task.setInputs(inputs);
        List<TaskPropertyRef> outputs = new ArrayList<TaskPropertyRef>(dataOutputs.size());
        for (Map.Entry<String, String> out : dataOutputs.entrySet()) {
            TaskPropertyRef prop = new TaskPropertyRef();
            prop.setName(out.getValue());
            prop.setSourceExpresion(out.getValue());
            outputs.add(prop);
        }
        task.setOutputs(outputs);
        this.taskRepository.addTask(task);
    }
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.