I got a problem while adding a wf to a change order
below you can find the code part
send_wait(0, top_object(), "call_attr", "wf", "add_workflow_task", group_leader, chg, "PEND", (uuid)NULL, (uuid)who, task_code, (object)wftpl, (uuid)who, (duration)NULL, (int)NULL, (date)NULL, (int)0, (int)0, 1500 );
received error is;
msg: AHD05724:Not a valid transition.
has somone any idea about the solution?
are you sure that you included WAIT and PEND behaviours in your Task Type and Workflow Template?
If yes, you can try to ask ConanLam who had the same issue.
Added: try to define status as (string)NULL.
Hi cdtj, yes I have those as behaviours. ConanLam have you find out a solution for this?
Have you tried to add status as NULL?
cdtj is right, you need to set status to NULL for inserting new workflow task.
If you want to insert as other status, you will need additional steps in the spell code to update that wf task into other status.
one small thing to note is where you are inserting your task?
As the WF is linear you can't insert a task with pending status if the previous task is still in wait status and not fully complete.
So if this new task is to be inserting somewhere later in the flow the task need to be inserted with wait status.
You also need to check when your spl is triggering to ensure the previous task data is committed.
My 2 cents
Thanks for your reply
actually I'm trying to insert task right after creation of a change order but I couldn't do it neither with status PEND nor WAIT.