Search in sources :

Example 1 with MockClassAttributeDefinition

use of org.alfresco.repo.forms.processor.node.MockClassAttributeDefinition in project alfresco-repository by Alfresco.

the class WorkflowFormProcessorTest method makeTaskPropertyDefs.

private Map<QName, PropertyDefinition> makeTaskPropertyDefs() {
    Map<QName, PropertyDefinition> properties = new HashMap<QName, PropertyDefinition>();
    QName intType = DataTypeDefinition.INT;
    MockClassAttributeDefinition priorityDef = MockClassAttributeDefinition.mockPropertyDefinition(PRIORITY_NAME, intType, "2");
    properties.put(PRIORITY_NAME, priorityDef);
    QName textType = DataTypeDefinition.TEXT;
    // Add a Description property
    PropertyDefinition descValue = MockClassAttributeDefinition.mockPropertyDefinition(DESC_NAME, textType);
    properties.put(DESC_NAME, descValue);
    // Add a Status property
    PropertyDefinition titleValue = MockClassAttributeDefinition.mockPropertyDefinition(STATUS_NAME, textType);
    properties.put(STATUS_NAME, titleValue);
    // Add a Status property
    PropertyDefinition with_ = MockClassAttributeDefinition.mockPropertyDefinition(PROP_WITH_, textType);
    properties.put(PROP_WITH_, with_);
    // Add a Package Action property
    QName pckgActionGroup = PROP_PACKAGE_ACTION_GROUP;
    PropertyDefinition pckgAction = MockClassAttributeDefinition.mockPropertyDefinition(pckgActionGroup, textType, "add_package_item_actions");
    properties.put(pckgActionGroup, pckgAction);
    // Add a Package Action property
    QName pckgItemActionGroup = PROP_PACKAGE_ITEM_ACTION_GROUP;
    PropertyDefinition pckgItemAction = MockClassAttributeDefinition.mockPropertyDefinition(pckgItemActionGroup, textType, "start_package_item_actions");
    properties.put(pckgItemActionGroup, pckgItemAction);
    return properties;
}
Also used : MockClassAttributeDefinition(org.alfresco.repo.forms.processor.node.MockClassAttributeDefinition) HashMap(java.util.HashMap) QName(org.alfresco.service.namespace.QName) PropertyDefinition(org.alfresco.service.cmr.dictionary.PropertyDefinition)

Example 2 with MockClassAttributeDefinition

use of org.alfresco.repo.forms.processor.node.MockClassAttributeDefinition in project alfresco-repository by Alfresco.

the class FormProcessorTest method makeTaskAssociationDefs.

protected Map<QName, AssociationDefinition> makeTaskAssociationDefs() {
    Map<QName, AssociationDefinition> associations = new HashMap<QName, AssociationDefinition>();
    QName actorName = QName.createQName(NamespaceService.BPM_MODEL_1_0_URI, "Actor");
    // Add Assigneee association
    MockClassAttributeDefinition assigneeDef = MockClassAttributeDefinition.mockAssociationDefinition(ASSIGNEE_NAME, actorName);
    associations.put(ASSIGNEE_NAME, assigneeDef);
    // Add Assigneee association
    MockClassAttributeDefinition actorsDef = MockClassAttributeDefinition.mockAssociationDefinition(ACTORS_NAME, actorName);
    associations.put(ACTORS_NAME, actorsDef);
    // Add association with _
    MockClassAttributeDefinition with_ = MockClassAttributeDefinition.mockAssociationDefinition(ASSOC_WITH_, actorName);
    associations.put(ASSOC_WITH_, with_);
    return associations;
}
Also used : MockClassAttributeDefinition(org.alfresco.repo.forms.processor.node.MockClassAttributeDefinition) AssociationDefinition(org.alfresco.service.cmr.dictionary.AssociationDefinition) HashMap(java.util.HashMap) QName(org.alfresco.service.namespace.QName)

Aggregations

HashMap (java.util.HashMap)2 MockClassAttributeDefinition (org.alfresco.repo.forms.processor.node.MockClassAttributeDefinition)2 QName (org.alfresco.service.namespace.QName)2 AssociationDefinition (org.alfresco.service.cmr.dictionary.AssociationDefinition)1 PropertyDefinition (org.alfresco.service.cmr.dictionary.PropertyDefinition)1