<%@ page extends="oneit.servlets.process.AJAXProcessJSP" %>

<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>

<%! protected String getName (ServletConfig config) { return "workflow_add_jsp"; } %>

<%
    ORMProcessState     process     =   (ORMProcessState)ProcessDecorator.getDefaultProcess(request);
    ObjectTransaction   objTran     =   process.getTransaction ();
    Job                 job         =   (Job) process.getAttribute("Job");
    int                 sortOrder   =   job.getWorkFlowsCount();
    ApplicationStatus   status      =   Utils.getApplicationStatus(sortOrder);
    WorkFlow            workflow    =   null;

    if(job.getWorkFlowsCount() < 10 && status != null)
    {
        workflow    =   WorkFlow.createWorkFlow(objTran);

//        workFlow.setName(status.getDescription());
        workflow.setApplicationStatus(status);
        workflow.setSortOrder(sortOrder);
        job.addToWorkFlows(workflow);
    }
%>

<oneit:form method="POST">
    
    
    <oneit:evalBody buffer="<%= getBuffer(request) %>">
        <div class="form-group row">
            <div class="col-md-12">
                <oneit:ormInput obj="<%= workflow %>"    type="text" attributeName="Name"    cssClass="form-control" />      
            </div>
        </div>
    </oneit:evalBody>
       
</oneit:form>