3 Replies Latest reply on Aug 19, 2014 2:16 PM by Pranesh Mehta

    Adding new state to Eform

    Pranesh Mehta Expert

      Ariba OOTB makes the approved state as the final state for Eform.

       

      we have a requirement to add a new state called processed after approved for an eform.

       

      I tried adding the following to the workflow file, but this doesn't seem to be working

       

      ***********************************

      <!DOCTYPE workflow SYSTEM "../../../../ariba/server/workflowserver/workflow.dtd">

      <workflow name="ULMarketingRequistionEform" workflowClass="config.unilever.ULMarketingRequistionEform" description="Workflow for UL Marketing Req Eform">

          <beginState name="APPROVED">

                  <transition name="APPROVED_TO_PROCESSSED">

                      <fromState name="APPROVED"/>

                      <event type="ULRequisitionUploadEform:Processed"/>

                      <toState name="PROCESSED"/>

                   </transition >

          </beginState>

          <state name="PROCESSED">

              <entry>

              </entry>

          </state>

      </workflow>

      ***********************************

       

      can any one help me on how to add a new state to the eform.

       

      I know one of the way is to add a action class to the above the workflow and change the StatusString and ApprovedState in Java.

       

      but just wanted to know, if ariba has some standard customization to do this rather than doing it through java, and if no other way then is it safe to do it in java and would it have any impact and do i need to take care of any other fields other than statusstring and approvedstate

       

      any comments or response would be of great help

        • Re: Adding new state to Eform
          Glenn Magnant Apprentice

          I am not sure I understand what you are trying to do.  By attempting to edit the AWL you are attempting to add an additional workflow element to the workflow and I believe this is not the approach you should be taking.

           

          What is the goal of this requirement?  Is it to change the displayed status on the eform?  If that is the case, why not just update the StatusString from the Java that performs the business logic that moves this Eform into a "Processed" state.  In addition, I would add an extrinsic field called something like EformProcessingCompleted that I would also set to true once the Eform has been "Processed".  This is because any change in state will update the StatusString so having a field explicitly to hold the processed state is a bit more reliable then using the StatusString only.

           

          -Glenn

          • Re: Adding new state to Eform
            Scott Corbett Master

            You have the right approach, and yes you need to create an action.

             

            To move from Approved to Processed, use CreateDurableEvent action, plus any post Approval processing you might need to run. Once you're in Processed state, create another action class to set the Status to Processed. You can get the state name from the.efm file by using the PropertyTable and getPropertyForKey, then set the StatusString.

             

            See sample below.

             

            <!DOCTYPE workflow SYSTEM "../../../../ariba/server/workflowserver/workflow.dtd">

                 <workflow name="CRARequesterMaintenance"

                      workflowClass="config.cra.Eform.CRARequesterMaintenance"

                      description="Workflow for Requester Maintenance eForm">

             

                 <beginState name="BEGIN">

                      <transition name="BEGIN_TO_APPROVED">

                           <fromState name="BEGIN"/>

                           <event type="CRARequesterMaintenance:Approved"/>

                           <toState name="APPROVED"/>

                      </transition>

                 </beginState>

                 <state name="APPROVED">

                 <entry>

                      <action implementation="config.cra.Eform.RequesterMaintenance.action.CRAProcessRequesterMaintenance"></action>

                      <action implementation="ariba.common.core.action.CreateDurableEvent">

                           <parameter name="EventType" value="CRARequesterMaintenance:Processed"/>

                      </action>

                 </entry>

                 <transition name="APPROVED_TO_PROCESSED">

                      <fromState name="APPROVED"/>

                      <event type="CRARequesterMaintenance:Processed"/>

                      <toState name="PROCESSED"/>

                 </transition>

                 </state>

                 <state name="PROCESSED">

                      <entry>

                           <action implementation="config.cra.Eform.action.CRASetEformStatus">

                                <parameter name="EformState" value="Processed"/>

                           </action>

                      </entry>

                 </state>

             

            </workflow>

              • Re: Adding new state to Eform
                Pranesh Mehta Expert

                Hi Scott,

                 

                Thanks for your response, this was helpful and we were able to get the eform to processed state.

                 

                however, can you throw some light on how does <action implementation="ariba.common.core.action.CreateDurableEvent"> work, I know it creates an entry into the DurableEvent clusterroot, but at what stage does the event get called and what calls the event, I dont find much documentation about this in ariba guides,

                any docs you have will help