cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Data List Showing Generic Fields

mkay
Champ in-the-making
Champ in-the-making
As part of a workflow I'm working on, I made a  custom data list to track the current status of the workflow. The scripts to interact with it work just fine and the data list is created with all of the fields that I specified in the model. For relevance, I am using 4.2.f Community Edition.

However, it is also generating a bunch of what look like generic fields. I don't need or want these, so how do I prevent them from being created?

Here is the model for the data list:

<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="dtdlm:deliveryTicketDataListModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

    <!– Optional meta-data about the model –>
    <description>Data list type to track progress of a Delivery Ticket Workflow.</description>
    <author>Mike Kay</author>
    <version>1.0</version>

    <!– Imports are required to allow references to definitions in other models –>
    <imports>
        <!– Import Alfresco Dictionary Definitions –>
        <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
        <!– Import Alfresco Content Domain Model Definitions –>
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
        <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
        <import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl" />
    </imports>

    <!– Introduction of new namespaces defined by this model –>
    <namespaces>
        <namespace uri="http://www.test.com/model/deliveryTicketDataListModel/1.0" prefix="dtdlm" />
    </namespaces>
   
    <!– Constraint definitions –>
    <constraints>
    </constraints>
   
        <!– Type and property definitions –>
    <types>
        <type name="dtdlm:deliveryTicketDataList">
            <title>Active Delivery Ticket</title>
            <description>Delivery Ticket in Progress</description>           
            <parent>dl:dataListItem</parent>
            <properties>
                <property name="dtdlm:title">
                    <title>Title</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
                <property name="dtdlm:dateSubmitted">
                    <title>Current State</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
                <property name="dtdlm:submitter">
                    <title>Submitted By</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
                <property name="dtdlm:dateChanged">
                    <title>Last Activity</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
                <property name="dtdlm:status">
                    <title>Status</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
            </properties>
        </type>
    </types>
   
</model>



The List is built and populated in my workflow definition using this script:

//execution.setVariable("alfrescoSite", "testing");
                                    execution.setVariable("alfrescoSite", "workflow-testing");
                                   
                                    // Set unique node token based on the initiator's user name + a timestamp
                                    execution.setVariable("deliveryTicketWorkflow_nodeName", initiator.properties.userName + "_" + Date.now());
                                  
                                    //
                                    // Create initial data list item
                                    //
                   
                                    // Get the site name and dataLists
                                    // var site = siteService.getSite(execution.getVariable("alfrescoSite"));
                                    var dataLists = companyhome.childByNamePath("Sites/" + execution.getVariable("alfrescoSite") + "/dataLists");
                                    var site = companyhome.childByNamePath("Sites/" + execution.getVariable("alfrescoSite"));
                                    // Check for data list existence
                                    if (!dataLists) {
                                     
                                      var dataLists = site.createNode("dataLists", "cm:folder");
                                    
                                      var dataListProps = new Array(1);
                                      dataListProps["st:componentId"] = "dataLists";
                                      dataLists.addAspect("st:siteContainer", dataListProps);
                                      dataLists.save();
                                    }
                                    
                                    // Create new data list variable
                                    var deliveryTicketDataList = dataLists.childByNamePath("deliveryTicketDataList");
                                   
                                    // If the data list hasn't been created yet, create it
                                    if (!deliveryTicketDataList) {
                                      var deliveryTicketDataList = dataLists.createNode("deliveryTicketDataList","dl:dataList");
                                    
                                      // Tells Alfresco share which type of items to create
                                      deliveryTicketDataList.properties["dl:dataListItemType"] = "dtdlm:deliveryTicketDataList";
                                    
                                      deliveryTicketDataList.save();
                                      var deliveryTicketDataListProps = [];
                                      deliveryTicketDataListProps["cm:title"] = "Delivery Tickets: In Progress";
                                      deliveryTicketDataListProps["cm:description"] = "Delivery tickets that are in progress.";
                                      deliveryTicketDataList.addAspect("cm:titled", deliveryTicketDataListProps);
                                    }
                                    
                                    var deliveryTicket = deliveryTicketDataList.childByNamePath(execution.getVariable("deliveryTicketWorkflow_nodeName"));
                                   
                                    // If node was removed, create it
                                    if (!deliveryTicket ) {
                                        var deliveryTicket = deliveryTicketDataList.createNode(execution.getVariable("deliveryTicketWorkflow_nodeName"), "dtdlm:deliveryTicketDataList");
                                        deliveryTicket.properties["dtdlm:title"] = execution.getVariable("bpm_workflowDescription");
                                        deliveryTicket.properties["dtdlm:submitter"] = initiator.properties.firstName + " " + person.properties.lastName;
                                        deliveryTicket.properties["dtdlm:dateSubmitted"] = Date().toString();
                                        deliveryTicket.properties["dtdlm:status"] = "Initial Submission";
                                        deliveryTicket.properties["dtdlm:dateChanged"] = Date().toString();
                                        deliveryTicket.save();
                                    }




When I run the workflow, the DataList on my site shows these additional fields: Created Date; Current State; Creator; Name; Content; Locale; Modifier; Modified Date; Last Accessed Date; Actions.

Any idea where I went wrong? I'm assuming it's a fault in the script, but I don't really know.
1 REPLY 1

mkay
Champ in-the-making
Champ in-the-making
I've gone back and resolved this issue. For similarly ailed time travelers: the issue was in my config-custom. I had "dtdlm:dataList" where I should have had "dtdlm:deliveryTicketDataList"