Categories
Bizagi Tips and Tricks

Working with XMLs

EntityManagerSOA web methods

Bizagi EntityManagerSOA web methods

getEntityAsString

https://___.bizagi.com/WebServices/EntityManagerSOA.asmx?op=getEntitiesAsString

Simple query

<BizAgiWSParam>
	<EntityData>
		<EntityName>mFacility</EntityName>
	</EntityData>	
</BizAgiWSParam>

Using a complex filter

<BizAgiWSParam>
	<EntityData>
		<EntityName>mFacility</EntityName>
		<Filters>
			<![CDATA[sName='...' AND bActive=1]]>
		</Filters>
	</EntityData>
</BizAgiWSParam>

saveEntityAsString

https://___.bizagi.com/WebServices/EntityManagerSOA.asmx?op=saveEntitiesAsString

Update User

An update can be differentiated from an insertion because the update requires the explicit specification of the primary key (or business key) of the record to be updated, e.g. key=”value” (or businessKey=”Attribute=value”); the insertions do not require this specification.

<BizAgiWSParam>
	<Entities>
		<WFUSER businessKey="domain='desktop-33pg18r' AND userName='alex.smith'">
			<fullName>Alex Smith</fullName>
			<userName>alex.smith</userName>
			<domain>desktop-33pg18r</domain>
			<contactEmail>alex.smith@mail.com</contactEmail>
			<Roles>
				<ROLE key="10001"/>
				<ROLE key="10002"/>
			</Roles>
		</WFUSER>
	</Entities>
</BizAgiWSParam>
<BizAgiWSParam>
	<Entities>
		<mFacility>
			<sName>...</sName>
			<bActive>false</bActive>
			<xmOwners>
				<mPerson>
					<kpRole businessKey = "sCode='Owner'"/>
					<ksWFUser businessKey = "domain = 'domain' AND userName = 'admon'"/>
				</mPerson>
			</xmOwners>
		</mFacility>
	</Entities>
</BizAgiWSParam>

Remove the roles (id 1,2 …) from the user with the id 108700

<BizAgiWSParam>
	<Entities>
		<WFUSER key="108700">
			<Roles>
				<REMOVE>
					<idRole key="1"/>
					<idRole key="2"/>
					...
				</REMOVE>
			</Roles>
		</WFUSER>
	</Entities>
</BizAgiWSParam>
<BizAgiWSParam>
	<Entities>
		<WFUSER businessKey = "idUser = 1001">
			<REMOVE>
				<StakeHolders>
					<Add Stakeholder Name Here/>
				</StakeHolders>
			</REMOVE>
		</WFUSER>
	</Entities>
</BizAgiWSParam>

Bizagi expression

	var sXML = ''+
	'<BizAgiWSParam>'+
		'<Entities>'+
			'<mLP_CaseInformation key="'+ iCaseInfoId + '">'+
				'<xCaseHistory>'+
					'<mLP_CaseHistory>'+
						'<dDate>'+ DateTime.Today + '</dDate>'+
						'<sAction>'+ sAction + '</sAction>'+
						'<ksWFUser key="'+ iLoggedUserId + '"/>'+
						'<sDetails><![CDATA['+ sDetails + ']]></sDetails>'+
						'<dDateTime>'+ DateTime.Now + '</dDateTime>'+
					'</mLP_CaseHistory>'+
				'</xCaseHistory>'+
			'</mLP_CaseInformation>'+
		'</Entities>'+
	'</BizAgiWSParam>';
	CEntityXmlHelper.saveEntityAsString(sXML);