use of org.apache.inlong.manager.common.pojo.workflow.form.ProcessForm in project incubator-inlong by apache.
the class StartEventProcessor method create.
@Override
public void create(StartEvent startEvent, WorkflowContext context) {
String applicant = context.getApplicant();
WorkflowProcess process = context.getProcess();
ProcessForm form = context.getProcessForm();
if (process.getFormClass() != null) {
Preconditions.checkNotNull(form, "form cannot be null");
Preconditions.checkTrue(form.getClass().isAssignableFrom(process.getFormClass()), "form type not match, should be class " + process.getFormClass());
form.validate();
} else {
Preconditions.checkNull(form, "no form required");
}
WorkflowProcessEntity processEntity = saveProcessEntity(applicant, process, form);
context.setProcessEntity(processEntity);
context.setActionContext(new WorkflowContext.ActionContext().setAction(WorkflowAction.START));
}
use of org.apache.inlong.manager.common.pojo.workflow.form.ProcessForm in project incubator-inlong by apache.
the class SourceStopEventSelector method accept.
@Override
public boolean accept(WorkflowContext context) {
ProcessForm processForm = context.getProcessForm();
if (!(processForm instanceof UpdateGroupProcessForm)) {
return false;
}
UpdateGroupProcessForm updateGroupProcessForm = (UpdateGroupProcessForm) processForm;
return updateGroupProcessForm.getOperateType() == OperateType.SUSPEND;
}
use of org.apache.inlong.manager.common.pojo.workflow.form.ProcessForm in project incubator-inlong by apache.
the class SourceDeleteEventSelector method accept.
@Override
public boolean accept(WorkflowContext context) {
ProcessForm processForm = context.getProcessForm();
if (!(processForm instanceof UpdateGroupProcessForm)) {
return false;
}
UpdateGroupProcessForm updateGroupProcessForm = (UpdateGroupProcessForm) processForm;
return updateGroupProcessForm.getOperateType() == OperateType.DELETE;
}
Aggregations