Workflow Map and dependent relationship

Former Member
Former Member
I am trying to validate the proof-of-concept for a parser designed for automated integration of process models. I would like to use a server-side method in C#. Creating new workflow maps works so far. Unfortunately, I already fail in a basic functionality. I want to set an activity template as a child relation to a workflow map. Here is my previous code:
Innovator inn = this.getInnovator(); Item workflow = inn.getItemById("Workflow Map","AAE3732B971C4397917669FC46576DC8"); string id = getNewID(); // Create new instance of Relationship ItemType Item newWMA = inn.newItem("Workflow Map Activity","add"); newWMA.setProperty("source_id", "AAE3732B971C4397917669FC46576DC8"); Item relatedItem = newItem("Activity Template","add"); newWMA.setRelatedItem(relatedItem); workflow.addRelationship(newWMA); relatedItem.apply(); return this;
Unfortunately the execution always results in the following error code:
Dependent Activity Template cannot be create: source item not found.
The ItemType Activity Template is set to "dependent". I assume that the error is related to this. Many thanks for the help in advance. Greetings Rik
Parents
  • Hi Rik, There doesn't appear to be an easy way through the REST API alone to get the id of an Item property that does not have a data source. I'll file this internally to be added in a future release. I understand that this functionality isn't critical for your use case, but I did discover a solution that would allow you to get the ID as expected. You can create a server method with code like the sample below.
    string wmpId = this.getProperty("wmp_id");
    Item wmp = this.newItem("Workflow Map Path", "get");
    wmp.setID(wmpId);
    return wmp.apply();
    You can then call this method through the REST API and pass in the ID of the Workflow Map Path you want to get like:
    POST host/.../method.GetWorkflowMapPath
    {
    "@odata.type": "host/.../$metadata,
    "wmp_id": "654FF9665F2F415683722C6AA698A1DE"
    }
    The body of the response should contain the related_id as expected. Chris
    Christopher Gillis Aras Labs Software Engineer
Reply
  • Hi Rik, There doesn't appear to be an easy way through the REST API alone to get the id of an Item property that does not have a data source. I'll file this internally to be added in a future release. I understand that this functionality isn't critical for your use case, but I did discover a solution that would allow you to get the ID as expected. You can create a server method with code like the sample below.
    string wmpId = this.getProperty("wmp_id");
    Item wmp = this.newItem("Workflow Map Path", "get");
    wmp.setID(wmpId);
    return wmp.apply();
    You can then call this method through the REST API and pass in the ID of the Workflow Map Path you want to get like:
    POST host/.../method.GetWorkflowMapPath
    {
    "@odata.type": "host/.../$metadata,
    "wmp_id": "654FF9665F2F415683722C6AA698A1DE"
    }
    The body of the response should contain the related_id as expected. Chris
    Christopher Gillis Aras Labs Software Engineer
Children
No Data