Process model related issue

Hi,

I have a Process model for HR approval. In the form I am capturing cancel and submit button values in a text rule input (buttonValues).

But when HR is cancelling the button the flow gets completed which I do not want to happen as the task not completed.

I want the flow to stay at the same position so that approver can again complete his task.

could someone please help me here how to achieve my goal?

Thanks

Faisal

  Discussion posts and replies are publicly visible

Parents Reply
  • The start form is used to collect the information and ideally I should have kept the 2nd Form which is an Approval Form as read only.

    You mentioned "I still don't like the terminology "cancel" for this, but that's totally up to you as a design decision. "

    Could suggest me something better here please?

    Currently, I am working on some kind of assignments. I have definitely some bandwidth to include the changes.

    Thanks

    Faisal

Children
  • 0
    Certified Lead Developer
    in reply to faisalf0003

    To add my 2 cents to this story, a task in a process should never have a cancel button. At least not in terms of that it stops the functional process. Each task must have some business value as outcome. If the business process includes a "non-happy" ending, then this must be implemented.

    But, a task in a process flow itself cannot be cancelled. This would be the same as a refusal to work!

    Regarding start forms, I always include a cancel button (and the xor in process). In my experience this "just navigate away" pattern is not understood by many people.

  • Yes Stefan,

    I have implemented the logic for Start form as you have suggested.

    Thank you and Mike and everyone here. I had a nice experience for this issue.

  • 0
    Certified Lead Developer
    in reply to faisalf0003
    Could suggest me something better here please?

    When implementing a button with functionality like what yours is doing, I sometimes use the label "Save and Close", or something similar depending on the particular situation, which should imply to the user that clicking this button will cause the task to go away but that it will be accessible again in their task list after that (which is the case here).

    When doing this you should always assess whether this is actually needed, versus having the user simply navigate away from the task if they're not ready to complete it yet - for data entry, the button approach can help save user-entered data.  For an approval form, though, I'm not sure what the value is in having the button for this purpose; if the user doesn't want to approve the current work item, they can simply click back to their task list or their site tab, etc.  You never posted a screenshot of what your User Input Task is actually doing, so it's hard for me to tell what best approach to suggest here.

  • 0
    Certified Lead Developer
    in reply to Stefan Helzle
    But, a task in a process flow itself cannot be cancelled.

    You should be more specific when you say this, because I immediately think of all the use cases where this is very untrue.  I know you're thinking of cases where a process is started by user A and eventually assigned to user B for approval / data input / etc, and therefore we shouldn't allow user B to cancel.  But the way you've written it, implies that we also shouldn't include "cancel" buttons in instances where user A starts a process, gets a few steps in, and then they realize the process is not needed.  Any such step could (and should) include "Cancel" functionality, or else there will be abandoned instances to the moon and back.

  • The clarification seems to be, the submitting user can always Cancel on any of their submit steps (which ends the process and does not submit for approval/processing).  In any situation I have where the approvers or anyone downstream needs the ability to end the process negatively, this is Denied.  On a user input task where the user is saving for later, not yet submitting but leaving the task available for themselves, I typically use Save for Later.

    In the end-negatively situations, I do most often suggest using Reject to the submitting user instead (or at least have this available along with Denied), where they can resubmit with any changes, or at this point the submitter can also use their Cancel functionality if they are not resubmitting.  I only include a Deny option when explicitly required, and it is not often.

  • You never posted a screenshot of what your User Input Task is actually doing

    The only difference between my Start form and Approval is that they differ by Approve and Reject Radio Buttons and values are saved in a boolean rule input.

    1. The button values are saved in a text rule input.

    Thanks

    Faisal

  • 0
    Certified Lead Developer
    in reply to Chris

    Interesting philosophical rabbit hole ...

    Let's see. What does "Cancel" mean? At start form level it means "Sorry, clicked wrong button". At task level, inside process flow, it means refusal to work. At business process level it means "we do not accept your request for loan".

    This is how I think about it in general with only some rare exceptions.

    I do almost never implement a "Save&Close" as this is too similar to "Save Draft".

    When my task is "Approve Request", then I have some controls allowing the user to select the outcome and a single submit button to complete the approval.

  • 0
    Certified Lead Developer
    in reply to Stefan Helzle
    I do almost never implement a "Save&Close" as this is too similar to "Save Draft".

    I've run into a lot of instances in the past where "Save Draft" is insufficient.  Mainly because when Appian created it, they didn't seem to think we needed any control over what the button does - it can't execute external saves, it can't kick off process instances (or do anything within the current process instance), and can't even force local variables to be saved into Rule Input values.

    At start form level it means "Sorry, clicked wrong button"

    I guess my main point here was just that (especially as the initial user) this concept can extend many steps into the process flow, so isn't exclusively relevant to "Start Form" level.  I rarely (intentionally) use actual start forms due to flexibility reasons, preferring instead to set up an initial task as the obligate "start form", and always at least configure "cancel button" functionality here, but also extend that to any initial steps the initiating user does prior to any point-of-no-return (assigned tasks being kicked off, important DB entries being created, etc).

  • 0
    Certified Lead Developer
    in reply to faisalf0003

    I guess I was imagining you might post a screenshot of your actual interface (in the interface designer, and including an example of the user selection(s) being populated and including the rule inputs to confirm that the value is being correctly saved).  Though I'm not sure if this is still necessary after the prior shots you've provided.

    I'm still unclear though - is something still not working as you were hoping?

  • Only loop back option is working Mike. I was given such requirement to implement where we have a cancel button and flow in approval form should not end if user cancels it. I want to know if we any other option are there to implement or only the loop back is the only option? I am happy the functionality is working fine if in case only loop back is a solution for this.

    Here are the screen shots from UI

    a!formLayout(
    label: "HR Approval Form",
    contents: {
    a!columnsLayout(
    columns: {
    a!columnLayout(
    contents: {
    a!textField(
    label: "First Name",
    labelPosition: "ABOVE",
    value: ri!empCollectDetails.firstName,
    saveInto: ri!empCollectDetails.firstName,
    refreshAfter: "UNFOCUS",
    validations: {}
    ),
    a!textField(
    label: "Gender",
    labelPosition: "ABOVE",
    value: ri!empCollectDetails.gender,
    saveInto: ri!empCollectDetails.gender,
    refreshAfter: "UNFOCUS",
    validations: {}
    ),
    a!textField(
    label: "Employee Type",
    labelPosition: "ABOVE",
    value: ri!empCollectDetails.empType,
    saveInto: ri!empCollectDetails.empType,
    refreshAfter: "UNFOCUS",
    validations: {}
    )
    }
    ),
    a!columnLayout(
    contents: {
    a!textField(
    label: "Last Name",
    labelPosition: "ABOVE",
    value: ri!empCollectDetails.lastName,
    saveInto: ri!empCollectDetails.lastName,
    refreshAfter: "UNFOCUS",
    validations: {}
    ),
    a!textField(
    label: "Phone Number",
    labelPosition: "ABOVE",
    value: ri!empCollectDetails.phoneNumber,
    saveInto: ri!empCollectDetails.phoneNumber,
    refreshAfter: "UNFOCUS",
    validations: {}
    ),
    a!textField(
    label: "Sub Employee Types",
    labelPosition: "ABOVE",
    value: ri!empCollectDetails.empSubType,
    saveInto: ri!empCollectDetails.empSubType,
    refreshAfter: "UNFOCUS",
    validations: {}
    )
    }
    )
    }
    ),
    a!boxLayout(
    label: "Box",
    contents: {
    a!radioButtonField(
    label: "",
    labelPosition: "ABOVE",
    choiceLabels: { "Approve", "Deny" },
    choiceValues: { true(), false() },
    value: ri!approvalDecision,
    saveInto: ri!approvalDecision,
    choiceLayout: "STACKED",
    validations: {}
    )
    },
    style: "STANDARD",
    marginBelow: "STANDARD"
    )
    },
    buttons: a!buttonLayout(
    primaryButtons: {
    a!buttonWidget(
    label: "Submit",
    value: "Submitted",
    saveInto: ri!buttonValue,
    submit: if(isnull(ri!approvalDecision), {}, true()),
    style: "PRIMARY"/*loadingIndicator: true*/

    )
    },
    secondaryButtons: {
    a!buttonWidget(
    label: "Cancel",
    submit: true(),
    value: "Cancelled",
    saveInto: ri!buttonValue,
    style: "NORMAL",
    validate: false
    )
    }
    )
    )