Search in sources :

Example 1 with WorkflowPojo

use of com.qlangtech.tis.offline.pojo.WorkflowPojo in project tis by qlangtech.

the class OfflineDatasourceAction method getWorkflowPojo.

private WorkflowPojo getWorkflowPojo(Context context) {
    String name = this.getString("workflowName");
    if (StringUtils.isBlank(name)) {
        this.addErrorMessage(context, "工作流名不能为空");
        return null;
    }
    if (!isWordCharacter(name)) {
        this.addErrorMessage(context, "工作流名必须由英文字符,数字和下划线组成");
        return null;
    }
    String taskScript = this.getString("taskScript");
    if (StringUtils.isBlank(taskScript)) {
        this.addErrorMessage(context, "脚本内容不能为空");
        return null;
    }
    return new WorkflowPojo(name, new JoinRule(taskScript));
}
Also used : JoinRule(com.qlangtech.tis.git.GitUtils.JoinRule) WorkflowPojo(com.qlangtech.tis.offline.pojo.WorkflowPojo)

Example 2 with WorkflowPojo

use of com.qlangtech.tis.offline.pojo.WorkflowPojo in project tis by qlangtech.

the class OfflineDatasourceAction method doEditWorkflow.

/**
 * Do edit workflow. 编辑工作流
 *
 * @param context the context
 * @throws Exception the exception
 */
public void doEditWorkflow(Context context) throws Exception {
    WorkflowPojo pojo = getWorkflowPojo(context);
    if (pojo == null) {
        return;
    }
    offlineManager.editWorkflow(pojo, this, context);
}
Also used : WorkflowPojo(com.qlangtech.tis.offline.pojo.WorkflowPojo)

Aggregations

WorkflowPojo (com.qlangtech.tis.offline.pojo.WorkflowPojo)2 JoinRule (com.qlangtech.tis.git.GitUtils.JoinRule)1