This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Workflow tasks are not getting closed after the action

Hello All,

I have a table as amMakerChecker and based on some column value changes its updating the status column and sending the notification for approval via workflow tasks.

once the status is validated record is getting updated but the workflow task is not getting closed. need your support or help to close those workflow tasks.


Thank you.


Tools Team.

  • It looks like the workflow notifies a user, via workflow tasks (ie. user-question type worflow activity), that user input is needed (ie. approve, reject), but the user input actions are on another table (ie. second screenshot buttons right-side).  Either move the user input actions to the workflow task or code the user input actions to also complete workflow task.  Moving the user input actions to the workflow task means the related user-question workflow activity should have two outcomes (ie. approve, reject); the two outcomes can be accomplished by first opening user-question workflow activity, supplying necessary instructions / prompting user to choose (upper white area), and right-clicking on sub-tab label zone of user-question workflow activity (lower detail area) to "add linked record" as an event.  Do this twice (once for approve and once for reject).  Transition from each of these activity output events to individual automatic action type workflow activities where they will call the actions you have associated with the buttons on your second screenshot.

  • Dear Mark,

    If you have any script or links to achieve the above, could you please share with me. We will try this.

    I want to know more regarding the transition and implement the same.

    Thank you.



Reply Children
  • Example workflow activity:

    Example workflow activity detail:

     - these are sub-tabs

    Example workflow task detail:

     - these are buttons for user to select.  After selection, and clicking Modify button to save choice, the workflow will continue transition based on selected choice.

  • Using action script logic to "finish" the workflow task is a bit more complicated as you will need to identify the correct workflow task table record which can be done using the workflow instance context table record identifier (highlighted below) along with other identifiers (ie. lActivId, and lWfInstanceId)...

    ...this lDocRecordId identifier is the primary key of the table record of which the workflow is executing against.

    Dim lErr as Long

    Dim hqRecord as Long

    Dim hrRecord as Long

    hqRecord = amQueryCreate()

    lErr = amQueryGet(hqRecord,"SELECT lWorkItemId FROM amWfWorkitem WHERE lDocRecordId = " & DocRecordID & " AND ...")

    IF lErr = 0 THEN

       hrRecord = amGetRecordFromMainId("amWfWorkItem",amGetFieldLongValue(hqRecord,0))

       lErr = amSetFieldLongValue(hrRecord,"seStatus",1)

       lErr = amUpdateRecord(hrRecord)

       lErr = amReleaseHandle(hrRecord)

    END IF

    lErr = amReleaseHandle(hqRecord)