当前位置: 首页>>代码示例>>Java>>正文


Java PropertyDefinition类代码示例

本文整理汇总了Java中org.kuali.rice.kew.api.document.PropertyDefinition的典型用法代码示例。如果您正苦于以下问题:Java PropertyDefinition类的具体用法?Java PropertyDefinition怎么用?Java PropertyDefinition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropertyDefinition类属于org.kuali.rice.kew.api.document包,在下文中一共展示了PropertyDefinition类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: WorkflowAttributeDefinition

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
private WorkflowAttributeDefinition(Builder builder) {
	this.attributeName = builder.getAttributeName();
	if (builder.getParameters() == null) {
		this.parameters = Collections.emptyList();
	} else {
		this.parameters = new ArrayList<String>(builder.getParameters());
	}
	if (builder.getPropertyDefinitions() == null) {
		this.propertyDefinitions = Collections.emptyList();
	} else {
		this.propertyDefinitions = new ArrayList<PropertyDefinition>(builder.getPropertyDefinitions());
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:WorkflowAttributeDefinition.java

示例2: getPropertyDefinitionsAsMap

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
/**
 * Returns the property definitions on this attribute definition as a map of strings instead of a list of
 * {@code PropertyDefinition} objects.
 *
 * @return a map representation of the property definitions on this workflow attribute definition
 */
public Map<String, String> getPropertyDefinitionsAsMap() {
    Map<String, String> propertiesDefinitionsMap = new HashMap<String, String>();
    for (PropertyDefinition propertyDefinition : getPropertyDefinitions()) {
        propertiesDefinitionsMap.put(propertyDefinition.getName(), propertyDefinition.getValue());
    }
    return Collections.unmodifiableMap(propertiesDefinitionsMap);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:WorkflowAttributeDefinition.java

示例3: addPropertyDefinition

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
/**
       * Adds the given property definition to the list of property definitions maintained by this builder.
       *
       * @param propertyDefinition the property definition to set, should not be null
       * @throws IllegalArgumentException if the given property definition is null
       */
public void addPropertyDefinition(PropertyDefinition propertyDefinition) {
	if (propertyDefinition == null) {
		throw new IllegalArgumentException("propertyDefinition must be non-null.");
	}
	propertyDefinitions.add(propertyDefinition);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:WorkflowAttributeDefinition.java

示例4: setPropertyDefinitions

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
/**
       * Sets the list of property definitions maintained by this build to the given list.
       *
       * @param propertyDefinitions the list of property definitions to set
       */
public void setPropertyDefinitions(List<PropertyDefinition> propertyDefinitions) {
	if (propertyDefinitions == null) {
		setPropertyDefinitions(new ArrayList<PropertyDefinition>());
	}
	this.propertyDefinitions = new ArrayList<PropertyDefinition>(propertyDefinitions);
	
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:WorkflowAttributeDefinition.java

示例5: getPropertyDefinition

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
/**
    * Returns the property definition on this build which has the given name if it exists.  This method will return
    * a null value if a definition with the given name cannot be found.
    *
    * @param name the name of the property definition to retrieve
    *
    * @return the property definition with the given name, or null if no such property definition is found
    *
    * @throws IllegalArgumentException if the given name is a null or blank value
    */
public PropertyDefinition getPropertyDefinition(String name) {
    if (StringUtils.isBlank(name)) {
        throw new IllegalArgumentException("name was null or blank");
    }
    for (PropertyDefinition propertyDefinition : propertyDefinitions) {
        if (propertyDefinition.equals(name)) {
            return propertyDefinition;
        }
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:WorkflowAttributeDefinition.java

示例6: testChainedBlanketApproval

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
/**
 * Test the blanket approval of a document chained by the post processor
 *
 * @throws Exception
 */
@Ignore
@Test
public void testChainedBlanketApproval() throws Exception {
    // Generate child document
    WorkflowDocument childDocument = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(TEST_USER_EWESTFAL), ChainedChildSetup.DOCUMENT_TYPE_NAME);
    WorkflowAttributeDefinition.Builder childDocAttribute = WorkflowAttributeDefinition.Builder.create(ChainedParentSetup.CHILD_DOC_ATTRIBUTE);
    PropertyDefinition docIdProperty = PropertyDefinition.create(
            ChainedParentSetup.DOC_ID_PROPERTY, childDocument.getDocumentId());
    childDocAttribute.addPropertyDefinition(docIdProperty);

    // Generate a parent document, apply child attribute
    WorkflowDocument parentDocument = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(TEST_USER_EWESTFAL), ChainedParentSetup.DOCUMENT_TYPE_NAME);
    //parentDocument.addAttributeDefinition(childDocAttribute.build());
    //parentDocument.saveDocumentData();

    // Issue with attribute definition save
    String fullContent = parentDocument.getDocumentContent().getFullContent();
    String newContent = "<documentContent><attributeContent><documentId>" + childDocument.getDocumentId() + "</documentId></attributeContent></documentContent>";
    DocumentContentUpdate.Builder documentContentUpdateBuilder = DocumentContentUpdate.Builder.create();
    documentContentUpdateBuilder.setAttributeContent(newContent);
    parentDocument.updateDocumentContent(documentContentUpdateBuilder.build());
    parentDocument.saveDocumentData();

    parentDocument.blanketApprove("");
    parentDocument = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName(TEST_USER_EWESTFAL), parentDocument.getDocumentId());
    assertTrue("Parent Document should be processed.", parentDocument.isProcessed());

    childDocument = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName(TEST_USER_EWESTFAL), childDocument.getDocumentId());
    assertTrue("Child Document should be processed.", childDocument.isProcessed());

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:37,代码来源:BlanketApproveTest.java

示例7: testParameterizedNetworkIdAttribute

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
@Test
public void testParameterizedNetworkIdAttribute() throws Exception {
	loadXmlFile("ParameterizedNetworkIdRoleAttributeTestConfig.xml");

	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(
			"ewestfal"), "NetworkIdRoleAttributeTest");

	WorkflowAttributeDefinition.Builder networkIdDef1 = WorkflowAttributeDefinition.Builder.create(
			"NetworkIdRoleAttribute");
	PropertyDefinition networkIdProp1 = PropertyDefinition.create(
			NETWORK_ID_PROP, "rkirkend");
	networkIdDef1.addPropertyDefinition(networkIdProp1);

	document.addAttributeDefinition(networkIdDef1.build());

	document.route("Routing!");

	// load the document as rkirkend

	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document
			.getDocumentId());
	assertTrue("Document should be ENROUTE", document.isEnroute());
	assertTrue("rkirkend should have an approve request.", document
			.isApprovalRequested());

	// now let's verify the XML

	XPath xPath = XPathHelper.newXPath();
	assertTrue("Should have found the ID.", (Boolean) xPath.evaluate(
			"//" + ATTRIBUTE_NAME + "/thisIdRocks", new InputSource(
					new StringReader(document.getDocumentContent()
							.getFullContent())), XPathConstants.BOOLEAN));

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:35,代码来源:NetworkIdRoleAttributeTest.java

示例8: testParameterizedPrincipalIdAttribute

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
@Test
public void testParameterizedPrincipalIdAttribute() throws Exception {
	loadXmlFile("ParameterizedPrincipalIdRoleAttributeTestConfig.xml");

	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(
			"ewestfal"), "PrincipalIdRoleAttributeTest");

	WorkflowAttributeDefinition.Builder principalIdDef1 = WorkflowAttributeDefinition.Builder.create(
			"PrincipalIdRoleAttribute");
	PropertyDefinition principalIdProp1 = PropertyDefinition.create(
			PRINCIPAL_ID_PROP, KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName("rkirkend").getPrincipalId());
	principalIdDef1.addPropertyDefinition(principalIdProp1);

	document.addAttributeDefinition(principalIdDef1.build());

	document.route("Routing!");

	// load the document as rkirkend

	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document
			.getDocumentId());
	assertTrue("Document should be ENROUTE", document.isEnroute());
	assertTrue("rkirkend should have an approve request.", document
			.isApprovalRequested());

	// now let's verify the XML

	XPath xPath = XPathHelper.newXPath();
	assertTrue("Should have found the ID.", (Boolean) xPath.evaluate(
			"//" + ATTRIBUTE_NAME + "/thisIdRocks", new InputSource(
					new StringReader(document.getDocumentContent()
							.getFullContent())), XPathConstants.BOOLEAN));

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:35,代码来源:PrincipalIdRoleAttributeTest.java

示例9: Builder

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
private Builder(String attributeName) {
	setAttributeName(attributeName);
	setParameters(new ArrayList<String>());
	setPropertyDefinitions(new ArrayList<PropertyDefinition>());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:WorkflowAttributeDefinition.java

示例10: testNetworkIdAttribute

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
@Test
public void testNetworkIdAttribute() throws Exception {
	loadXmlFile("NetworkIdRoleAttributeTestConfig.xml");

	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(
			"ewestfal"), "NetworkIdRoleAttributeTest");

	WorkflowAttributeDefinition.Builder networkIdDef1 = WorkflowAttributeDefinition.Builder.create("NetworkIdRoleAttribute");
	PropertyDefinition networkIdProp1 = PropertyDefinition.create(
			NETWORK_ID_PROP, "rkirkend");
	networkIdDef1.addPropertyDefinition(networkIdProp1);

	WorkflowAttributeDefinition.Builder networkIdDef2 = WorkflowAttributeDefinition.Builder.create(
			"NetworkIdRoleAttribute");
	PropertyDefinition networkIdProp2 = PropertyDefinition.create(
			NETWORK_ID_PROP, "bmcgough");
	networkIdDef2.addPropertyDefinition(networkIdProp2);

	document.addAttributeDefinition(networkIdDef1.build());
	document.addAttributeDefinition(networkIdDef2.build());

	document.route("Routing!");

	// load the document as rkirkend

	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document
			.getDocumentId());
	assertTrue("Document should be ENROUTE", document.isEnroute());
	assertTrue("rkirkend should have an approve request.", document
			.isApprovalRequested());

	// load the document as bmcgough
	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("bmcgough"), document
			.getDocumentId());
	assertTrue("bmcgough should have an approve request.", document
			.isApprovalRequested());

	// submit an approve as bmcgough
	document.approve("i approve");

	// reload as rkirkend, verify still enroute
	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document
			.getDocumentId());
	assertTrue("Document should be ENROUTE", document.isEnroute());
	assertTrue("rkirkend should have an approve request.", document
			.isApprovalRequested());
	document.approve("i also approve");

	// now the document should be FINAL
	assertTrue("Document should be FINAL", document.isFinal());

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:53,代码来源:NetworkIdRoleAttributeTest.java

示例11: testUniversityIdAttribute

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
@Test
   public void testUniversityIdAttribute() throws Exception {
loadXmlFile("UniversityIdRoleAttributeTestConfig.xml");

// network id to university id mapping as defined in DefaultSuiteTestData.xml
// -----------------------------------
// ewestfal     ->     2001
// rkirkend     ->     2002
// bmcgough     ->     2004

WorkflowDocument document = WorkflowDocumentFactory.createDocument("2001", "UniversityIdRoleAttributeTest");

WorkflowAttributeDefinition.Builder universityIdDef1 = WorkflowAttributeDefinition.Builder.create("UniversityIdRoleAttribute");
PropertyDefinition universityIdProp1 = PropertyDefinition.create(UNIVERSITY_ID_PROP, "2002");
universityIdDef1.addPropertyDefinition(universityIdProp1);

WorkflowAttributeDefinition.Builder universityIdDef2 = WorkflowAttributeDefinition.Builder.create("UniversityIdRoleAttribute");
PropertyDefinition universityIdProp2 = PropertyDefinition.create(UNIVERSITY_ID_PROP, "2004");
universityIdDef2.addPropertyDefinition(universityIdProp2);

document.addAttributeDefinition(universityIdDef1.build());
document.addAttributeDefinition(universityIdDef2.build());

document.route("Routing!");

// load the document as rkirkend

document = WorkflowDocumentFactory.loadDocument("2002", document.getDocumentId());
assertTrue("Document should be ENROUTE", document.isEnroute());
assertTrue("rkirkend should have an approve request.", document.isApprovalRequested());

// load the document as bmcgough
document = WorkflowDocumentFactory.loadDocument("2004", document.getDocumentId());
assertTrue("bmcgough should have an approve request.", document.isApprovalRequested());

// submit an approve as bmcgough
document.approve("i approve");

// reload as rkirkend, verify still enroute
document = WorkflowDocumentFactory.loadDocument("2002", document.getDocumentId());
assertTrue("Document should be ENROUTE", document.isEnroute());
assertTrue("rkirkend should have an approve request.", document.isApprovalRequested());
document.approve("i also approve");

// now the document should be FINAL
assertTrue("Document should be FINAL", document.isFinal());

   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:49,代码来源:UniversityIdRoleAttributeTest.java

示例12: testParameterizedUniversityIdAttribute

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
@Test
   public void testParameterizedUniversityIdAttribute() throws Exception {
loadXmlFile("ParameterizedUniversityIdRoleAttributeTestConfig.xml");

WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "UniversityIdRoleAttributeTest");

WorkflowAttributeDefinition.Builder univIdDef1 = WorkflowAttributeDefinition.Builder.create("UniversityIdRoleAttribute");
PropertyDefinition univIdProp1 = PropertyDefinition.create(UNIVERSITY_ID_PROP, "2002");
univIdDef1.addPropertyDefinition(univIdProp1);
	
document.addAttributeDefinition(univIdDef1.build());

document.route("Routing!");

// load the document as rkirkend

document = WorkflowDocumentFactory.loadDocument("2002", document.getDocumentId());
assertTrue("Document should be ENROUTE", document.isEnroute());
assertTrue("rkirkend should have an approve request.", document.isApprovalRequested());

// now let's verify the XML

XPath xPath = XPathHelper.newXPath();
assertTrue("Should have found the ID.", (Boolean)xPath.evaluate("//UniversityIdRoleAttribute/thisIdRocks", new InputSource(new StringReader(document.getDocumentContent().getFullContent())), XPathConstants.BOOLEAN));

   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:UniversityIdRoleAttributeTest.java

示例13: testPrincipalIdAttribute

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
@Test
public void testPrincipalIdAttribute() throws Exception {
	loadXmlFile("PrincipalIdRoleAttributeTestConfig.xml");

	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(
			"ewestfal"), "PrincipalIdRoleAttributeTest");

	WorkflowAttributeDefinition.Builder principalIdDef1 = WorkflowAttributeDefinition.Builder.create(
			"PrincipalIdRoleAttribute");
	PropertyDefinition principalIdProp1 = PropertyDefinition.create(
			PRINCIPAL_ID_PROP, KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName("rkirkend").getPrincipalId());
	principalIdDef1.addPropertyDefinition(principalIdProp1);

	WorkflowAttributeDefinition.Builder principalIdDef2 = WorkflowAttributeDefinition.Builder.create(
			"PrincipalIdRoleAttribute");
	PropertyDefinition principalIdProp2 = PropertyDefinition.create(
			PRINCIPAL_ID_PROP, KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName("bmcgough").getPrincipalId());
	principalIdDef2.addPropertyDefinition(principalIdProp2);

	document.addAttributeDefinition(principalIdDef1.build());
	document.addAttributeDefinition(principalIdDef2.build());

	document.route("Routing!");

	// load the document as rkirkend

	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document
			.getDocumentId());
	assertTrue("Document should be ENROUTE", document.isEnroute());
	assertTrue("rkirkend should have an approve request.", document
			.isApprovalRequested());

	// load the document as bmcgough
	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("bmcgough"), document
			.getDocumentId());
	assertTrue("bmcgough should have an approve request.", document
			.isApprovalRequested());

	// submit an approve as bmcgough
	document.approve("i approve");

	// reload as rkirkend, verify still enroute
	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document
			.getDocumentId());
	assertTrue("Document should be ENROUTE", document.isEnroute());
	assertTrue("rkirkend should have an approve request.", document
			.isApprovalRequested());
	document.approve("i also approve");

	// now the document should be FINAL
	assertTrue("Document should be FINAL", document.isFinal());

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:54,代码来源:PrincipalIdRoleAttributeTest.java

示例14: getPropertyDefinitions

import org.kuali.rice.kew.api.document.PropertyDefinition; //导入依赖的package包/类
/**
 * Returns an unmodifiable list of property names and values that will be passed to the attribute upon construction.
 * This list will never be null but it may be empty.
 *
 * @return the list of property names and values to will be be passed to the attribute upon construction
 */
public List<PropertyDefinition> getPropertyDefinitions() {
	return Collections.unmodifiableList(propertyDefinitions);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:WorkflowAttributeDefinition.java


注:本文中的org.kuali.rice.kew.api.document.PropertyDefinition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。