Package org.activiti.workflow.simple.alfresco.model

Examples of org.activiti.workflow.simple.alfresco.model.M2ClassAssociation


    M2Model model = AlfrescoConversionUtil.getContentModel(conversion);

    // Check if model contains an aspect for the property
    String propertyName = getPropertyName(referenceDefinition, conversion);

    M2ClassAssociation association = new M2ClassAssociation();
    association.setName(propertyName);
    association.setTitle(referenceDefinition.getName());
    M2AssociationSource source = new M2AssociationSource();
    source.setMany(false);
    source.setMandatory(true);
    M2AssociationTarget target = new M2AssociationTarget();
    target.setClassName(referenceDefinition.getType());
    target.setMandatory(referenceDefinition.isMandatory());

    // Determine whether or not it's allowed to select multiple targets
    boolean isTargetMany = extractBooleanFromParameters(referenceDefinition.getParameters(),
        AlfrescoConversionConstants.PARAMETER_REFERENCE_MANY, false);
    target.setMany(isTargetMany);

    association.setTarget(target);
    association.setSource(source);

    M2Aspect aspect = model.getAspect(propertyName);
    if (aspect != null) {
      if (aspect.getAssociations().isEmpty()) {
        aspect.getAssociations().add(association);
View Full Code Here


   
    if(stepDefinition.getAssignmentType() == HumanStepAssignmentType.USERS) {
      String assignmentVariableName = id + "Assignee";
     
      // Add the assignee-property to the content-model
      M2ClassAssociation reviewAssignee = new M2ClassAssociation();
      M2AssociationTarget target = new M2AssociationTarget();
      target.setClassName(AlfrescoConversionConstants.CONTENT_TYPE_PEOPLE);
      target.setMandatory(true);
      target.setMany(false);
     
      M2AssociationSource source = new M2AssociationSource();
      source.setMany(false);
      source.setMandatory(true);
     
      reviewAssignee.setName(AlfrescoConversionUtil.getQualifiedName(namespacePrefix, assignmentVariableName));
      reviewAssignee.setTarget(target);
      reviewAssignee.setSource(source);
     
      userTaskType.getAssociations().add(reviewAssignee);
      userTask.setAssignee(new PropertyReference(assignmentVariableName).getUsernameReferenceExpression(namespacePrefix));
     
      // Finally, add the multi-instance characteristics to the userTask
View Full Code Here

    assertNotNull(model);
    M2Type type = model.getTypes().get(0);
    assertNotNull(type);
   
    // Simple text
    M2ClassAssociation association = getAssociationFromType("person", type);
    assertEquals("cm:person", association.getTarget().getClassName());
    assertTrue(association.getTarget().isMandatory());
  }
View Full Code Here

TOP

Related Classes of org.activiti.workflow.simple.alfresco.model.M2ClassAssociation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.