Package org.activiti.workflow.simple.alfresco.form

Examples of org.activiti.workflow.simple.alfresco.form.AlfrescoTransitionsPropertyDefinition


    return AlfrescoTransitionsPropertyDefinition.class;
  }

  @Override
  public void convertProperty(M2Type contentType, String formSet, Form form, FormPropertyDefinition propertyDefinition, WorkflowDefinitionConversion conversion) {
    AlfrescoTransitionsPropertyDefinition def = (AlfrescoTransitionsPropertyDefinition) propertyDefinition;
   
    String propertyName = contentType.getName() + AlfrescoConversionConstants.PROPERTY_TRANSITIONS_SUFFIX;
   
    // Add to content model
    M2Property property = new M2Property();
    property.setMandatory(new M2Mandatory(def.isMandatory()));
    property.setName(propertyName);
    property.setPropertyType(AlfrescoConversionConstants.PROPERTY_TYPE_TEXT);
   
    M2Model model = AlfrescoConversionUtil.getContentModel(conversion);
    contentType.getProperties().add(property);
   
    // Create constraint for the values
    if(def.getTransitions() != null && !def.getTransitions().isEmpty()) {
      M2Constraint valueConstraint = new M2Constraint();
      valueConstraint.setType(AlfrescoConversionConstants.CONTENT_MODEL_CONSTRAINT_TYPE_LIST);
      valueConstraint.setName(propertyName + AlfrescoConversionConstants.CONTENT_MODEL_CONSTRAINT_TYPE_LIST.toLowerCase());
     
      List<String> values = new ArrayList<String>(def.getTransitions().size());
      for(ListPropertyEntry entry : def.getTransitions()) {
        values.add(entry.getValue());
      }
      valueConstraint.getParameters().add(new M2NamedValue(AlfrescoConversionConstants.CONTENT_MODEL_CONSTRAINT_ALLOWED_VALUES, null, values));
     
      // Add constraint to the root model instead of the type itself and reference it from within the property
View Full Code Here


  protected String getRequiredCountVariableName(String id, String namespacePrefix) {
    return new PropertyReference(id + "RequiredApprovalCount").getVariableReference(namespacePrefix);
  }

  protected AlfrescoTransitionsPropertyDefinition createTransitionsProperty() {
    AlfrescoTransitionsPropertyDefinition prop = new AlfrescoTransitionsPropertyDefinition();
    prop.addEntry(new ListPropertyEntry(AlfrescoConversionConstants.TRANSITION_APPROVE,
        AlfrescoConversionConstants.TRANSITION_APPROVE));
    prop.addEntry(new ListPropertyEntry(AlfrescoConversionConstants.TRANSITION_REJECT,
        AlfrescoConversionConstants.TRANSITION_REJECT));
    return prop;
  }
View Full Code Here

    HumanStepDefinition humanStep = new HumanStepDefinition();
    humanStep.setId("step1");
    FormDefinition form = new FormDefinition();
    humanStep.setForm(form);
   
    AlfrescoTransitionsPropertyDefinition transition = new AlfrescoTransitionsPropertyDefinition();
    transition.addEntry(new ListPropertyEntry("One", "One"));
    transition.addEntry(new ListPropertyEntry("Two", "Two"));
    humanStep.getForm().addFormProperty(transition);
   
    definition.addStep(humanStep);
   
    WorkflowDefinitionConversion conversion = conversionFactory.createWorkflowDefinitionConversion(definition);
View Full Code Here

TOP

Related Classes of org.activiti.workflow.simple.alfresco.form.AlfrescoTransitionsPropertyDefinition

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.