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

DEVELOPERS FORUM - Promote a Workflow Process Activity using AML

acj_3rd - Tuesday, July 6, 2010 10:05 AM:

I'm trying to promote a Workflow Process Activity using AML.

The AML was constructed after checking "Save Requests" in the Aras Innovator and viewing the resultant AML after promoting an activity listed in the users My Inbasket.

Using the AML generated by Aras Innovator, I attempted to do the same action using the nash tool.

This AML is listed below, my comments are in parens italics:

<Item type="Activity" action="EvaluateActivity">
    <Activity>51841B196BC14A768EFF062D35D766AE</Activity> (The activity id)
    <ActivityAssignment>F620F2AC7077407A9DCEA09884177588</ActivityAssignment>

    (The activity_assignment.id where  activity_assignment.source_id = activity.id)

    <Paths>
        <Path id='CD36D4D313094B6AB791E616980CED4C'>

        (The workflow_process_path.id where workflow_process_path.source_id = activity.id)

            <![CDATA[Performed]]>

            (The workflow_process_path.name where workflow_process_path.source_id = activity.id)
        </Path>
    </Paths>
    <DelegateTo>0</DelegateTo>
    <Tasks>
        <Task id='CC946DB242A6467F83D5D5791B45735A' completed='0'/>

        (The activity_task.id where activity_task.source_id = activity.id)
    </Tasks>
    <Variables/>
    <Authentication mode=''/>
    <Comments/>
    <Complete>1</Complete>
</Item>

The return value from the nash submit is:

<Result /><Message><event name="ids_modified" value="51841B196BC14A768EFF062D35D766AE" /></Message>

When this AML is submitted via nash, the Activity changes to state "Closed". However, the next activity in the Workflow Process does not become "Active". It remains in the "Pending" state. Also, the email notification is not sent to the person responsible for the next activity.

This means the workflow process is in limbo. The next activity can not be promoted from the User "My Inbasket" because the next activity is not active.

It seems like I am missing a step.

Drew Jenkins



acj_3rd - Monday, July 12, 2010 11:25 AM:

I figured out the solution, so I'm posting the solution in case another person needs to do what I'm doing.

My approach was to do a db diff between the database under 2 scenarios:

1. Promote the activity using the Aras Innovator GUI through the user's My InBasket.

Perform a DB diff of the db before and after this action.

2. Promote the Activity using AML as formatted above

Perform a DB diff of the db before and after this action.

Comparing the 2 diffs resulted in the following observations:

After the promotion using AML, there were 6 additional SQL steps that needed to be performed. These steps are:

-- 1.  The next  Activity.Modified_by_id is updated to the value of the User.id for the person who promotes the activity

-- 2.  The next Activity.state changes from 'Pending' to 'Active'

-- 3. The next Activity.active_date updated to current time

-- 4. The next Activity.modified_on updated to current time

-- 5. The next Activity.current_state changes from E1873699A2DA4E709A8C91501449B623 to EACB6244391B461EBCAF7D91E28BDFCF

(On my system 'EACB6244391B461EBCAF7D91E28BDFCF' is the id value from Life_Cycle_State for name = 'Active')

--6. The existing Workflow_process_path.is_complete set to 1

To find the next activity, use the query:

select a.id from innovator.activity a, innovator.workflow_process_path wp
 where wp.source_id = '283681FE021F45498BE1E72D175CBF54' and wp.related_id = a.id

(replace '283681FE021F45498BE1E72D175CBF54' with your activity id)

This may return more than value if the current activity has more than 1 output path.

I placed all the above functionality into a Stored Procedure and it successfully finishes the promotion of a workflow activity.

Drew Jenkins